@vonage/vivid 3.7.0 → 3.9.0
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/custom-elements.json +332 -0
- package/index.js +7 -5
- package/lib/button/button.d.ts +1 -1
- package/lib/components.d.ts +2 -0
- package/lib/select/select.d.ts +2 -2
- package/lib/tag/definition.d.ts +4 -0
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/tag.d.ts +22 -0
- package/lib/tag/tag.template.d.ts +4 -0
- package/lib/tag-group/definition.d.ts +3 -0
- package/lib/tag-group/index.d.ts +1 -0
- package/lib/tag-group/tag-group.d.ts +3 -0
- package/lib/tag-group/tag-group.template.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +2 -1
- package/package.json +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition13.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +1 -1
- package/shared/definition19.js +2 -3
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +1 -1
- package/shared/definition21.js +2 -2
- package/shared/definition22.js +1 -1
- package/shared/definition23.js +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.js +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition29.js +1 -1
- package/shared/definition31.js +1 -1
- package/shared/definition32.js +1 -1
- package/shared/definition33.js +1 -1
- package/shared/definition34.js +1 -1
- package/shared/definition35.js +1 -1
- package/shared/definition36.js +1 -1
- package/shared/definition37.js +1 -1
- package/shared/definition38.js +12 -10
- package/shared/definition39.js +1 -1
- package/shared/definition4.js +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.js +1 -1
- package/shared/definition44.js +1 -1
- package/shared/definition45.js +90 -250
- package/shared/definition46.js +20 -112
- package/shared/definition47.js +265 -65
- package/shared/definition48.js +98 -58
- package/shared/definition49.js +69 -295
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +79 -0
- package/shared/definition51.js +305 -0
- package/shared/definition6.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.js +1 -1
- package/shared/definition9.js +1 -1
- package/shared/form-elements.js +45 -6
- package/shared/icon.js +1 -1
- package/shared/patterns/form-elements/form-elements.d.ts +16 -2
- package/shared/text-field.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +31 -0
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/tag/index.js +16 -0
- package/tag-group/index.js +5 -0
- package/text-area/index.js +1 -2
- package/text-field/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +394 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { F as FoundationElement, W as DOM, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { T as TreeItem, i as isTreeItemElement } from './tree-item.js';
|
|
3
|
+
import { i as isHTMLElement, g as getDisplayedNodes } from './dom.js';
|
|
4
|
+
import { d as keyEnter, c as keyArrowUp, b as keyArrowDown, h as keyArrowRight, i as keyArrowLeft, k as keyEnd, a as keyHome } from './key-codes.js';
|
|
5
|
+
import { s as slotted } from './slotted.js';
|
|
6
|
+
import { r as ref } from './ref.js';
|
|
7
|
+
import { c as classNames } from './class-names.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A Tree view Custom HTML Element.
|
|
11
|
+
* Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.
|
|
12
|
+
*
|
|
13
|
+
* @slot - The default slot for tree items
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
class TreeView$1 extends FoundationElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
/**
|
|
21
|
+
* The tree item that is designated to be in the tab queue.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
this.currentFocused = null;
|
|
26
|
+
/**
|
|
27
|
+
* Handle focus events
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
this.handleFocus = (e) => {
|
|
32
|
+
if (this.slottedTreeItems.length < 1) {
|
|
33
|
+
// no child items, nothing to do
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (e.target === this) {
|
|
37
|
+
if (this.currentFocused === null) {
|
|
38
|
+
this.currentFocused = this.getValidFocusableItem();
|
|
39
|
+
}
|
|
40
|
+
if (this.currentFocused !== null) {
|
|
41
|
+
TreeItem.focusItem(this.currentFocused);
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (this.contains(e.target)) {
|
|
46
|
+
this.setAttribute("tabindex", "-1");
|
|
47
|
+
this.currentFocused = e.target;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Handle blur events
|
|
52
|
+
*
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
this.handleBlur = (e) => {
|
|
56
|
+
if (e.target instanceof HTMLElement &&
|
|
57
|
+
(e.relatedTarget === null || !this.contains(e.relatedTarget))) {
|
|
58
|
+
this.setAttribute("tabindex", "0");
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* KeyDown handler
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
this.handleKeyDown = (e) => {
|
|
67
|
+
if (e.defaultPrevented) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (this.slottedTreeItems.length < 1) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
const treeItems = this.getVisibleNodes();
|
|
74
|
+
switch (e.key) {
|
|
75
|
+
case keyHome:
|
|
76
|
+
if (treeItems.length) {
|
|
77
|
+
TreeItem.focusItem(treeItems[0]);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
case keyEnd:
|
|
81
|
+
if (treeItems.length) {
|
|
82
|
+
TreeItem.focusItem(treeItems[treeItems.length - 1]);
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
case keyArrowLeft:
|
|
86
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
87
|
+
const item = e.target;
|
|
88
|
+
if (item instanceof TreeItem &&
|
|
89
|
+
item.childItemLength() > 0 &&
|
|
90
|
+
item.expanded) {
|
|
91
|
+
item.expanded = false;
|
|
92
|
+
}
|
|
93
|
+
else if (item instanceof TreeItem &&
|
|
94
|
+
item.parentElement instanceof TreeItem) {
|
|
95
|
+
TreeItem.focusItem(item.parentElement);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
case keyArrowRight:
|
|
100
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
101
|
+
const item = e.target;
|
|
102
|
+
if (item instanceof TreeItem &&
|
|
103
|
+
item.childItemLength() > 0 &&
|
|
104
|
+
!item.expanded) {
|
|
105
|
+
item.expanded = true;
|
|
106
|
+
}
|
|
107
|
+
else if (item instanceof TreeItem && item.childItemLength() > 0) {
|
|
108
|
+
this.focusNextNode(1, e.target);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
case keyArrowDown:
|
|
113
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
114
|
+
this.focusNextNode(1, e.target);
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
case keyArrowUp:
|
|
118
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
119
|
+
this.focusNextNode(-1, e.target);
|
|
120
|
+
}
|
|
121
|
+
return;
|
|
122
|
+
case keyEnter:
|
|
123
|
+
// In single-select trees where selection does not follow focus (see note below),
|
|
124
|
+
// the default action is typically to select the focused node.
|
|
125
|
+
this.handleClick(e);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// don't prevent default if we took no action
|
|
129
|
+
return true;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Handles the selected-changed events bubbling up
|
|
133
|
+
* from child tree items
|
|
134
|
+
*
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
this.handleSelectedChange = (e) => {
|
|
138
|
+
if (e.defaultPrevented) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
const item = e.target;
|
|
145
|
+
if (item.selected) {
|
|
146
|
+
if (this.currentSelected && this.currentSelected !== item) {
|
|
147
|
+
this.currentSelected.selected = false;
|
|
148
|
+
}
|
|
149
|
+
// new selected item
|
|
150
|
+
this.currentSelected = item;
|
|
151
|
+
}
|
|
152
|
+
else if (!item.selected && this.currentSelected === item) {
|
|
153
|
+
// selected item deselected
|
|
154
|
+
this.currentSelected = null;
|
|
155
|
+
}
|
|
156
|
+
return;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Updates the tree view when slottedTreeItems changes
|
|
160
|
+
*/
|
|
161
|
+
this.setItems = () => {
|
|
162
|
+
// force single selection
|
|
163
|
+
// defaults to first one found
|
|
164
|
+
const selectedItem = this.treeView.querySelector("[aria-selected='true']");
|
|
165
|
+
this.currentSelected = selectedItem;
|
|
166
|
+
// invalidate the current focused item if it is no longer valid
|
|
167
|
+
if (this.currentFocused === null || !this.contains(this.currentFocused)) {
|
|
168
|
+
this.currentFocused = this.getValidFocusableItem();
|
|
169
|
+
}
|
|
170
|
+
// toggle properties on child elements
|
|
171
|
+
this.nested = this.checkForNestedItems();
|
|
172
|
+
const treeItems = this.getVisibleNodes();
|
|
173
|
+
treeItems.forEach(node => {
|
|
174
|
+
if (isTreeItemElement(node)) {
|
|
175
|
+
node.nested = this.nested;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* check if the item is focusable
|
|
181
|
+
*/
|
|
182
|
+
this.isFocusableElement = (el) => {
|
|
183
|
+
return isTreeItemElement(el);
|
|
184
|
+
};
|
|
185
|
+
this.isSelectedElement = (el) => {
|
|
186
|
+
return el.selected;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
slottedTreeItemsChanged() {
|
|
190
|
+
if (this.$fastController.isConnected) {
|
|
191
|
+
// update for slotted children change
|
|
192
|
+
this.setItems();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
connectedCallback() {
|
|
196
|
+
super.connectedCallback();
|
|
197
|
+
this.setAttribute("tabindex", "0");
|
|
198
|
+
DOM.queueUpdate(() => {
|
|
199
|
+
this.setItems();
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Handles click events bubbling up
|
|
204
|
+
*
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
handleClick(e) {
|
|
208
|
+
if (e.defaultPrevented) {
|
|
209
|
+
// handled, do nothing
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {
|
|
213
|
+
// not a tree item, ignore
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
const item = e.target;
|
|
217
|
+
if (!item.disabled) {
|
|
218
|
+
item.selected = !item.selected;
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Move focus to a tree item based on its offset from the provided item
|
|
224
|
+
*/
|
|
225
|
+
focusNextNode(delta, item) {
|
|
226
|
+
const visibleNodes = this.getVisibleNodes();
|
|
227
|
+
if (!visibleNodes) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];
|
|
231
|
+
if (isHTMLElement(focusItem)) {
|
|
232
|
+
TreeItem.focusItem(focusItem);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* checks if there are any nested tree items
|
|
237
|
+
*/
|
|
238
|
+
getValidFocusableItem() {
|
|
239
|
+
const treeItems = this.getVisibleNodes();
|
|
240
|
+
// default to selected element if there is one
|
|
241
|
+
let focusIndex = treeItems.findIndex(this.isSelectedElement);
|
|
242
|
+
if (focusIndex === -1) {
|
|
243
|
+
// otherwise first focusable tree item
|
|
244
|
+
focusIndex = treeItems.findIndex(this.isFocusableElement);
|
|
245
|
+
}
|
|
246
|
+
if (focusIndex !== -1) {
|
|
247
|
+
return treeItems[focusIndex];
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* checks if there are any nested tree items
|
|
253
|
+
*/
|
|
254
|
+
checkForNestedItems() {
|
|
255
|
+
return this.slottedTreeItems.some((node) => {
|
|
256
|
+
return isTreeItemElement(node) && node.querySelector("[role='treeitem']");
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
getVisibleNodes() {
|
|
260
|
+
return getDisplayedNodes(this, "[role='treeitem']") || [];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
__decorate([
|
|
264
|
+
attr({ attribute: "render-collapsed-nodes" })
|
|
265
|
+
], TreeView$1.prototype, "renderCollapsedNodes", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
observable
|
|
268
|
+
], TreeView$1.prototype, "currentSelected", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
observable
|
|
271
|
+
], TreeView$1.prototype, "slottedTreeItems", void 0);
|
|
272
|
+
|
|
273
|
+
var css_248z = ".control {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}";
|
|
274
|
+
|
|
275
|
+
class TreeView extends TreeView$1 {}
|
|
276
|
+
|
|
277
|
+
let _2 = t => t,
|
|
278
|
+
_t;
|
|
279
|
+
const getClasses = _ => classNames('control');
|
|
280
|
+
const TreeViewTemplate = () => {
|
|
281
|
+
return html(_t || (_t = _2`
|
|
282
|
+
<template
|
|
283
|
+
role="tree"
|
|
284
|
+
${0}
|
|
285
|
+
@keydown="${0}"
|
|
286
|
+
@focusin="${0}"
|
|
287
|
+
@focusout="${0}"
|
|
288
|
+
@click="${0}"
|
|
289
|
+
@selected-change="${0}"
|
|
290
|
+
>
|
|
291
|
+
<div class="${0}">
|
|
292
|
+
<slot ${0}></slot>
|
|
293
|
+
</div>
|
|
294
|
+
</template>`), ref('treeView'), (x, c) => x.handleKeyDown(c.event), (x, c) => x.handleFocus(c.event), (x, c) => x.handleBlur(c.event), (x, c) => x.handleClick(c.event), (x, c) => x.handleSelectedChange(c.event), getClasses, slotted('slottedTreeItems'));
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const treeViewDefinition = TreeView.compose({
|
|
298
|
+
baseName: 'tree-view',
|
|
299
|
+
template: TreeViewTemplate,
|
|
300
|
+
styles: css_248z
|
|
301
|
+
});
|
|
302
|
+
const treeViewRegistries = [treeViewDefinition()];
|
|
303
|
+
const registerTreeView = registerFactory(treeViewRegistries);
|
|
304
|
+
|
|
305
|
+
export { treeViewRegistries as a, registerTreeView as r, treeViewDefinition as t };
|
package/shared/definition6.js
CHANGED
|
@@ -4,7 +4,7 @@ import { I as Icon } from './icon.js';
|
|
|
4
4
|
import { w as when } from './when.js';
|
|
5
5
|
import { c as classNames } from './class-names.js';
|
|
6
6
|
|
|
7
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
7
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.base {\n display: inline-flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n vertical-align: middle;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-pale: var(--vvd-color-cta-300);\n}\n.base:not(.connotation-cta) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-pale: var(--vvd-color-neutral-300);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base.appearance-duotone {\n --_appearance-color-text: var(--_connotation-color-fierce);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-pale);\n}\n.base.size-condensed {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size-condensed .initials {\n font: var(--vvd-typography-base-condensed-bold);\n}\n.base.size-condensed .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) / 2);\n line-height: 1;\n}\n.base.size-expanded {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-expanded .initials {\n font: var(--vvd-typography-heading-4);\n}\n.base.size-expanded .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8)) / 2);\n line-height: 1;\n}\n.base:not(.size-condensed, .size-expanded) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.size-condensed, .size-expanded) .initials {\n font: var(--vvd-typography-base-extended-bold);\n}\n.base:not(.size-condensed, .size-expanded) .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n line-height: 1;\n}\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n.base.shape-pill {\n border-radius: 50%;\n}\n.base .initials {\n text-transform: uppercase;\n}\n.base ::slotted(*) {\n block-size: 100%;\n inline-size: 100%;\n object-fit: cover;\n}";
|
|
8
8
|
|
|
9
9
|
class Avatar extends FoundationElement {}
|
|
10
10
|
__decorate([attr, __metadata("design:type", String)], Avatar.prototype, "connotation", void 0);
|
package/shared/definition7.js
CHANGED
|
@@ -12,7 +12,7 @@ __decorate([attr, __metadata("design:type", String)], Badge.prototype, "appearan
|
|
|
12
12
|
__decorate([attr, __metadata("design:type", String)], Badge.prototype, "text", void 0);
|
|
13
13
|
applyMixins(Badge, AffixIconWithTrailing);
|
|
14
14
|
|
|
15
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
15
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.base {\n --_badge-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_badge-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n column-gap: 8px;\n font: var(--vvd-typography-base-condensed-bold);\n max-inline-size: 100%;\n padding-inline: 8px;\n vertical-align: middle;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-cta-500);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-pale: var(--vvd-color-cta-300);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-soft: var(--vvd-color-success-100);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-pale: var(--vvd-color-success-300);\n --_connotation-color-fierce: var(--vvd-color-success-700);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-pale: var(--vvd-color-alert-300);\n --_connotation-color-fierce: var(--vvd-color-alert-700);\n}\n.base.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-300);\n --_connotation-color-primary-text: var(--vvd-color-canvas-text);\n --_connotation-color-intermediate: var(--vvd-color-warning-300);\n --_connotation-color-soft: var(--vvd-color-warning-100);\n --_connotation-color-contrast: var(--vvd-color-warning-800);\n --_connotation-color-pale: var(--vvd-color-warning-300);\n --_connotation-color-fierce: var(--vvd-color-warning-700);\n}\n.base.connotation-information {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-information-500);\n --_connotation-color-soft: var(--vvd-color-information-100);\n --_connotation-color-contrast: var(--vvd-color-information-800);\n --_connotation-color-pale: var(--vvd-color-information-300);\n --_connotation-color-fierce: var(--vvd-color-information-700);\n}\n.base:not(.connotation-cta, .connotation-success, .connotation-alert, .connotation-warning, .connotation-information) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-pale: var(--vvd-color-neutral-300);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-duotone {\n --_appearance-color-text: var(--_connotation-color-fierce);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-pale);\n}\n.base.appearance-subtle {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base.icon-only {\n contain: size;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .base.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .base.icon-only {\n inline-size: var(--_badge-block-size);\n }\n}\n\n.text {\n overflow: hidden;\n max-inline-size: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 4px;\n}\n\n.base.shape-pill {\n border-radius: 14px;\n}\n\n/* Icon */\n.icon {\n font-size: calc(var(--_badge-block-size) / 1.6667);\n line-height: 1;\n}\n.icon-trailing .icon {\n order: 1;\n}";
|
|
16
16
|
|
|
17
17
|
let _ = t => t,
|
|
18
18
|
_t,
|
package/shared/definition8.js
CHANGED
|
@@ -7,7 +7,7 @@ import { a as applyMixins } from './apply-mixins.js';
|
|
|
7
7
|
import { w as when } from './when.js';
|
|
8
8
|
import { c as classNames } from './class-names.js';
|
|
9
9
|
|
|
10
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
10
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.control {\n overflow: hidden;\n max-height: 160px;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n transition: max-height var(--transition-delay, 200ms);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-300);\n --_connotation-color-primary-text: var(--vvd-color-canvas-text);\n}\n.control:not(.connotation-success, .connotation-alert, .connotation-announcement, .connotation-warning) {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control.removing {\n max-height: 0;\n}\n.control > .header {\n display: flex;\n min-height: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n align-items: center;\n justify-content: flex-start;\n font: var(--vvd-typography-base-bold);\n}\n.control > .header > .user-content {\n display: flex;\n flex: 1 0;\n align-items: center;\n justify-content: center;\n padding-inline: 16px;\n}\n.control > .header > .user-content > .icon {\n flex: 0 0 auto;\n font-size: 20px;\n line-height: 1;\n margin-inline-end: 15px;\n}\n.control > .header > .user-content > .action-items {\n display: inline-block;\n flex: 0 0 auto;\n padding-inline-start: 15px;\n}\n.control > .header > .user-content > .message {\n padding: 20px 0;\n}\n.control > .header > .dismiss-button {\n --vvd-icon-button-color: inherit;\n flex: 0 0 auto;\n margin-inline-end: 8px;\n}";
|
|
11
11
|
|
|
12
12
|
var _Banner_handleRemoveEnd, _Banner_closeOnKeyDown;
|
|
13
13
|
const connotationIconMap = new Map([[Connotation.Information, 'info-solid'], [Connotation.Announcement, 'megaphone-solid'], [Connotation.Success, 'check-circle-solid'], [Connotation.Warning, 'warning-solid'], [Connotation.Alert, 'error-solid']]);
|
package/shared/definition9.js
CHANGED
|
@@ -32,7 +32,7 @@ __decorate([attr({
|
|
|
32
32
|
__decorate([attr, __metadata("design:type", String)], Button.prototype, "label", void 0);
|
|
33
33
|
applyMixins(Button, AffixIconWithTrailing);
|
|
34
34
|
|
|
35
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
35
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n:host {\n display: inline-block;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n border: 0 none;\n margin: 0;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_button-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n gap: var(--_button-icon-gap);\n vertical-align: middle;\n white-space: nowrap;\n /* Shape */\n /* Size */\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n --_connotation-color-faint: var(--vvd-color-cta-50);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-success-600);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-fierce: var(--vvd-color-success-700);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-soft: var(--vvd-color-success-100);\n --_connotation-color-faint: var(--vvd-color-success-50);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-alert-600);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-fierce: var(--vvd-color-alert-700);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n --_connotation-color-faint: var(--vvd-color-alert-50);\n}\n.control:not(.connotation-cta, .connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n}\n.control.appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.control:not(.icon-only) {\n inline-size: 100%;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control:not(:disabled) {\n cursor: pointer;\n}\n.control:disabled {\n cursor: not-allowed;\n}\n.control.icon-only {\n contain: size;\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(--_button-block-size);\n }\n}\n.control:not(.shape-pill) {\n border-radius: 6px;\n}\n.control.shape-pill:not(.icon-only, .stacked) {\n border-radius: 24px;\n}\n.control.shape-pill.stacked {\n border-radius: 24px;\n}\n.control.shape-pill.icon-only {\n border-radius: 50%;\n}\n.control:not(.stacked).size-super-condensed {\n --_button-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n font: var(--vvd-typography-base-condensed-bold);\n}\n.control:not(.stacked).size-super-condensed:not(.icon-only) {\n --_button-icon-gap: 4px;\n padding-inline: 8px;\n}\n.control:not(.stacked).size-condensed {\n --_button-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n font: var(--vvd-typography-base-condensed-bold);\n}\n.control:not(.stacked).size-condensed:not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control:not(.stacked).size-expanded {\n --_button-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n font: var(--vvd-typography-base-extended-bold);\n}\n.control:not(.stacked).size-expanded:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:not(.stacked):not(.size-condensed, .size-expanded, .size-super-condensed) {\n --_button-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n font: var(--vvd-typography-base-bold);\n}\n.control:not(.stacked):not(.size-condensed, .size-expanded, .size-super-condensed):not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control.stacked {\n flex-direction: column;\n justify-content: center;\n}\n.control.stacked.size-super-condensed {\n --stacked-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n --_button-block-size: calc(var(--stacked-size) + 20px);\n font: var(--vvd-typography-base-condensed-bold);\n}\n.control.stacked.size-super-condensed:not(.icon-only) {\n --_button-icon-gap: 4px;\n padding-inline: 8px;\n}\n.control.stacked.size-condensed {\n --stacked-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n --_button-block-size: calc(var(--stacked-size) + 24px);\n font: var(--vvd-typography-base-condensed-bold);\n}\n.control.stacked.size-condensed:not(.icon-only) {\n --_button-icon-gap: 6px;\n padding-inline: 12px;\n}\n.control.stacked.size-expanded {\n --stacked-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n --_button-block-size: calc(var(--stacked-size) + 32px);\n font: var(--vvd-typography-base-extended-bold);\n}\n.control.stacked.size-expanded:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control.stacked:not(.size-condensed, .size-expanded, .size-super-condensed) {\n --stacked-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n --_button-block-size: calc(var(--stacked-size) + 28px);\n font: var(--vvd-typography-base-bold);\n}\n.control.stacked:not(.size-condensed, .size-expanded, .size-super-condensed):not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 16px;\n}\n\n/* Icon */\n.icon {\n line-height: 1;\n}\n.icon-trailing .icon {\n order: 1;\n}\n.control.stacked > .icon {\n font-size: calc(var(--stacked-size) / 2);\n}\n.control:not(.stacked) > .icon {\n font-size: calc(var(--_button-block-size) / 2);\n}\n\n:not(:focus-visible) > .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}\n\n.pending {\n order: 2;\n}";
|
|
36
36
|
|
|
37
37
|
let _ = t => t,
|
|
38
38
|
_t,
|
package/shared/form-elements.js
CHANGED
|
@@ -2,9 +2,9 @@ import { _ as __decorate, a as attr, b as __metadata, o as observable, a6 as vol
|
|
|
2
2
|
import { I as Icon } from './icon.js';
|
|
3
3
|
import { w as when } from './when.js';
|
|
4
4
|
|
|
5
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
5
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.message {\n display: flex;\n contain: inline-size;\n font: var(--vvd-typography-base-condensed);\n gap: 4px;\n grid-column: 1/-1;\n}\n.message-text {\n color: var(--vvd-color-canvas-text);\n}\n.helper-message .message-text {\n color: var(--_low-ink-color);\n}\n.message-icon {\n font-size: 16px;\n}\n.success-message .message-icon {\n color: var(--vvd-color-success-500);\n}\n.error-message .message-icon {\n color: var(--vvd-color-alert-500);\n}";
|
|
6
6
|
|
|
7
|
-
let
|
|
7
|
+
let _2 = t => t,
|
|
8
8
|
_t,
|
|
9
9
|
_t2,
|
|
10
10
|
_t3;
|
|
@@ -103,7 +103,7 @@ function getFeedbackTemplate(messageType, context) {
|
|
|
103
103
|
const iconTag = context.tagFor(Icon);
|
|
104
104
|
const messageTypeConfig = MessageTypeMap[messageType];
|
|
105
105
|
const iconType = messageTypeConfig.iconType;
|
|
106
|
-
return html(_t || (_t =
|
|
106
|
+
return html(_t || (_t = _2`
|
|
107
107
|
<style>
|
|
108
108
|
${0}
|
|
109
109
|
|
|
@@ -111,7 +111,7 @@ function getFeedbackTemplate(messageType, context) {
|
|
|
111
111
|
<div class="message ${0}-message">
|
|
112
112
|
${0}
|
|
113
113
|
${0}
|
|
114
|
-
</div>`), css_248z, MessageTypeMap[messageType].className, when(() => iconType, html(_t2 || (_t2 =
|
|
114
|
+
</div>`), css_248z, MessageTypeMap[messageType].className, when(() => iconType, html(_t2 || (_t2 = _2`
|
|
115
115
|
<${0} class="message-icon" name="${0}"></${0}>`), iconTag, iconType, iconTag)), feedbackMessage({
|
|
116
116
|
messageProperty: MessageTypeMap[messageType].messageProperty
|
|
117
117
|
}));
|
|
@@ -119,9 +119,48 @@ function getFeedbackTemplate(messageType, context) {
|
|
|
119
119
|
function feedbackMessage({
|
|
120
120
|
messageProperty
|
|
121
121
|
}) {
|
|
122
|
-
return html(_t3 || (_t3 =
|
|
122
|
+
return html(_t3 || (_t3 = _2`
|
|
123
123
|
<span class="message-text">${0}</span>
|
|
124
124
|
`), x => x[messageProperty]);
|
|
125
125
|
}
|
|
126
|
+
function errorText(constructor) {
|
|
127
|
+
var _Decorated_shouldValidate, _Decorated_prevSuccessText;
|
|
128
|
+
class Decorated extends constructor {
|
|
129
|
+
constructor(...args) {
|
|
130
|
+
super(...args);
|
|
131
|
+
_Decorated_shouldValidate.set(this, true);
|
|
132
|
+
_Decorated_prevSuccessText.set(this, '');
|
|
133
|
+
this._validate = this.validate;
|
|
134
|
+
this.validate = () => {
|
|
135
|
+
if (__classPrivateFieldGet(this, _Decorated_shouldValidate, "f")) this._validate();
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
errorTextChanged(_, newmsg) {
|
|
139
|
+
if (newmsg) {
|
|
140
|
+
this.setValidity({
|
|
141
|
+
customError: true
|
|
142
|
+
}, newmsg, this.control);
|
|
143
|
+
__classPrivateFieldSet(this, _Decorated_prevSuccessText, this.successText, "f");
|
|
144
|
+
this.successText = '';
|
|
145
|
+
this.userValid = !this.userValid;
|
|
146
|
+
this.userValid = false;
|
|
147
|
+
__classPrivateFieldSet(this, _Decorated_shouldValidate, false, "f");
|
|
148
|
+
} else {
|
|
149
|
+
this.setValidity({
|
|
150
|
+
customError: false
|
|
151
|
+
}, '', this.control);
|
|
152
|
+
this.successText = __classPrivateFieldGet(this, _Decorated_prevSuccessText, "f");
|
|
153
|
+
this.userValid = true;
|
|
154
|
+
__classPrivateFieldSet(this, _Decorated_shouldValidate, true, "f");
|
|
155
|
+
this._validate();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
_Decorated_shouldValidate = new WeakMap(), _Decorated_prevSuccessText = new WeakMap();
|
|
160
|
+
__decorate([attr({
|
|
161
|
+
attribute: 'error-text'
|
|
162
|
+
}), __metadata("design:type", String)], Decorated.prototype, "errorText", void 0);
|
|
163
|
+
return Decorated;
|
|
164
|
+
}
|
|
126
165
|
|
|
127
|
-
export { FormElementSuccessText as F, FormElementHelperText as a, FormElementCharCount as b, formElements as f, getFeedbackTemplate as g };
|
|
166
|
+
export { FormElementSuccessText as F, FormElementHelperText as a, FormElementCharCount as b, errorText as e, formElements as f, getFeedbackTemplate as g };
|
package/shared/icon.js
CHANGED
|
@@ -1325,7 +1325,7 @@ const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
|
|
|
1325
1325
|
</svg>`;
|
|
1326
1326
|
|
|
1327
1327
|
const BASE_URL = 'https://icon.resources.vonage.com';
|
|
1328
|
-
const ICON_SET_VERSION = '4.
|
|
1328
|
+
const ICON_SET_VERSION = '4.1.1';
|
|
1329
1329
|
const PLACEHOLDER_DELAY = 500;
|
|
1330
1330
|
const PLACEHOLDER_TIMEOUT = 2000;
|
|
1331
1331
|
const baseUrlTemplate = (resource, version) => [BASE_URL, `v${version}`, resource].join('/');
|
|
@@ -14,6 +14,9 @@ export interface FormElementSuccessText {
|
|
|
14
14
|
export interface FormElementCharCount {
|
|
15
15
|
charCount: boolean;
|
|
16
16
|
}
|
|
17
|
+
export interface ErrorText {
|
|
18
|
+
errorText: string;
|
|
19
|
+
}
|
|
17
20
|
export declare class FormElementHelperText {
|
|
18
21
|
helperText?: string;
|
|
19
22
|
}
|
|
@@ -30,14 +33,25 @@ export declare function formElements<T extends {
|
|
|
30
33
|
[x: string]: any;
|
|
31
34
|
label?: string | undefined;
|
|
32
35
|
userValid: boolean;
|
|
33
|
-
"__#
|
|
36
|
+
"__#8956@#blurred": boolean;
|
|
34
37
|
readonly errorValidationMessage: any;
|
|
35
38
|
connectedCallback(): void;
|
|
36
|
-
"__#
|
|
39
|
+
"__#8956@#handleInvalidEvent": () => void;
|
|
37
40
|
disconnectedCallback(): void;
|
|
38
41
|
validate: () => void;
|
|
39
42
|
};
|
|
40
43
|
} & T;
|
|
41
44
|
declare type FeedbackType = 'error' | 'helper' | 'success';
|
|
42
45
|
export declare function getFeedbackTemplate(messageType: FeedbackType, context: ElementDefinitionContext): import("@microsoft/fast-element").ViewTemplate<FormElement, any>;
|
|
46
|
+
export declare function errorText<T extends {
|
|
47
|
+
new (...args: any[]): Record<string, any>;
|
|
48
|
+
}>(constructor: T): {
|
|
49
|
+
new (...args: any[]): {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
errorText?: string | undefined;
|
|
52
|
+
"__#8957@#shouldValidate": boolean;
|
|
53
|
+
"__#8957@#prevSuccessText": string;
|
|
54
|
+
errorTextChanged(_: string, newmsg: string | undefined): void;
|
|
55
|
+
};
|
|
56
|
+
} & T;
|
|
43
57
|
export {};
|
package/shared/text-field.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
1
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\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-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-backdrop: var(--vvd-color-success-50);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-faint: var(--vvd-color-success-50);\n --_connotation-color-soft: var(--vvd-color-success-100);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-backdrop: var(--vvd-color-alert-50);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-faint: var(--vvd-color-alert-50);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n}\n.base:not(.connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n grid-column: 1/4;\n transition: color 0.2s;\n /* Shape */\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\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 width: 100%;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\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: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n.control:disabled {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control::placeholder, .control:disabled::placeholder {\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color); /* 1. sets text fill to current `color` for safari */\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-inline-start: var(--_text-field-gutter);\n line-height: 1;\n}\n.icon + .control {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 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}";
|
|
2
2
|
|
|
3
3
|
export { css_248z as c };
|
package/styles/core/all.css
CHANGED
package/styles/core/theme.css
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: SpeziaCompleteVariableUpright;
|
|
3
|
+
font-stretch: 50% 200%;
|
|
4
|
+
font-weight: 1 1000;
|
|
5
|
+
font-display: optional;
|
|
6
|
+
src: url("https://fonts.resources.vonage.com/fonts/v2/SpeziaCompleteVariableUprightWeb.woff2") format("woff2");
|
|
7
|
+
}
|
|
8
|
+
@font-face {
|
|
9
|
+
font-family: SpeziaMonoCompleteVariable;
|
|
10
|
+
font-stretch: 50% 200%;
|
|
11
|
+
font-weight: 1 1000;
|
|
12
|
+
font-display: optional;
|
|
13
|
+
src: url("https://fonts.resources.vonage.com/fonts/v2/SpeziaMonoCompleteVariableWeb.woff2") format("woff2");
|
|
14
|
+
}
|
|
15
|
+
.vvd-root {
|
|
16
|
+
--vvd-typography-headline: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 4.125)/1.3333333333333333 SpeziaCompleteVariableUpright;
|
|
17
|
+
--vvd-typography-subtitle: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 3.25)/1.3076923076923077 SpeziaCompleteVariableUpright;
|
|
18
|
+
--vvd-typography-heading-1: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 2.5)/1.3 SpeziaCompleteVariableUpright;
|
|
19
|
+
--vvd-typography-heading-2: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 2)/1.375 SpeziaCompleteVariableUpright;
|
|
20
|
+
--vvd-typography-heading-3: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 1.625)/1.3846153846153846 SpeziaCompleteVariableUpright;
|
|
21
|
+
--vvd-typography-heading-4: 500 condensed calc(var(--vvd-size-font-scale-base, 16px) * 1.25)/1.4 SpeziaCompleteVariableUpright;
|
|
22
|
+
--vvd-typography-base: 400 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px) * 0.875)/1.4285714285714286 SpeziaCompleteVariableUpright;
|
|
23
|
+
--vvd-typography-base-bold: 600 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px) * 0.875)/1.4285714285714286 SpeziaCompleteVariableUpright;
|
|
24
|
+
--vvd-typography-base-code: 400 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px) * 0.875)/1.4285714285714286 SpeziaMonoCompleteVariable;
|
|
25
|
+
--vvd-typography-base-condensed: 400 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px) * 0.75)/1.3333333333333333 SpeziaCompleteVariableUpright;
|
|
26
|
+
--vvd-typography-base-condensed-bold: 600 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px) * 0.75)/1.3333333333333333 SpeziaCompleteVariableUpright;
|
|
27
|
+
--vvd-typography-base-extended: 400 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px))/1.5 SpeziaCompleteVariableUpright;
|
|
28
|
+
--vvd-typography-base-extended-bold: 600 ultra-condensed calc(var(--vvd-size-font-scale-base, 16px))/1.5 SpeziaCompleteVariableUpright;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*# sourceMappingURL=spezia-variable.css.map */
|