@vonage/vivid 4.16.1 → 4.17.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 +3201 -281
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +147 -39
- package/index.js +64 -59
- package/lib/accordion/definition.d.ts +2 -0
- package/lib/accordion-item/definition.d.ts +2 -0
- package/lib/action-group/definition.d.ts +2 -0
- package/lib/alert/definition.d.ts +2 -0
- package/lib/audio-player/definition.d.ts +2 -0
- package/lib/avatar/definition.d.ts +2 -0
- package/lib/badge/definition.d.ts +2 -0
- package/lib/banner/definition.d.ts +2 -0
- package/lib/breadcrumb/definition.d.ts +2 -0
- package/lib/breadcrumb-item/definition.d.ts +2 -0
- package/lib/button/definition.d.ts +2 -0
- package/lib/calendar/calendar.d.ts +2 -0
- package/lib/calendar/definition.d.ts +2 -0
- package/lib/calendar-event/definition.d.ts +2 -0
- package/lib/card/definition.d.ts +2 -0
- package/lib/checkbox/definition.d.ts +2 -0
- package/lib/combobox/definition.d.ts +2 -0
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/definition.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +2 -0
- package/lib/date-range-picker/definition.d.ts +2 -0
- package/lib/dial-pad/definition.d.ts +2 -0
- package/lib/dialog/definition.d.ts +2 -0
- package/lib/divider/definition.d.ts +2 -0
- package/lib/empty-state/definition.d.ts +2 -0
- package/lib/enums.d.ts +6 -0
- package/lib/fab/definition.d.ts +2 -0
- package/lib/file-picker/definition.d.ts +2 -0
- package/lib/header/definition.d.ts +2 -0
- package/lib/icon/definition.d.ts +2 -0
- package/lib/layout/definition.d.ts +2 -0
- package/lib/menu/definition.d.ts +2 -0
- package/lib/menu/menu.d.ts +454 -4
- package/lib/menu-item/definition.d.ts +2 -0
- package/lib/nav/definition.d.ts +2 -0
- package/lib/nav-disclosure/definition.d.ts +2 -0
- package/lib/nav-item/definition.d.ts +2 -0
- package/lib/note/definition.d.ts +2 -0
- package/lib/number-field/definition.d.ts +2 -0
- package/lib/option/definition.d.ts +2 -0
- package/lib/pagination/definition.d.ts +2 -0
- package/lib/popup/definition.d.ts +0 -1
- package/lib/popup/popup.d.ts +25 -0
- package/lib/progress/definition.d.ts +2 -0
- package/lib/progress-ring/definition.d.ts +2 -0
- package/lib/radio/definition.d.ts +2 -0
- package/lib/radio-group/definition.d.ts +2 -0
- package/lib/range-slider/definition.d.ts +2 -0
- package/lib/rich-text-editor/definition.d.ts +2 -0
- package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +2 -0
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +7 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +13 -0
- package/lib/rich-text-editor/rich-text-editor.template.d.ts +4 -0
- package/lib/searchable-select/definition.d.ts +2 -0
- package/lib/select/definition.d.ts +2 -0
- package/lib/selectable-box/definition.d.ts +2 -0
- package/lib/side-drawer/definition.d.ts +2 -0
- package/lib/slider/definition.d.ts +2 -0
- package/lib/split-button/definition.d.ts +2 -0
- package/lib/switch/definition.d.ts +2 -0
- package/lib/tab/definition.d.ts +2 -0
- package/lib/tab-panel/definition.d.ts +2 -0
- package/lib/tabs/definition.d.ts +2 -0
- package/lib/tag/definition.d.ts +2 -0
- package/lib/tag-group/definition.d.ts +2 -0
- package/lib/text-area/definition.d.ts +2 -0
- package/lib/text-field/definition.d.ts +2 -0
- package/lib/time-picker/definition.d.ts +2 -0
- package/lib/time-picker/inline-time-picker/columns.d.ts +13 -0
- package/lib/time-picker/inline-time-picker/definition.d.ts +1 -0
- package/lib/time-picker/inline-time-picker/inline-time-picker.d.ts +15 -0
- package/lib/time-picker/inline-time-picker/inline-time-picker.template.d.ts +5 -0
- package/lib/time-picker/time-picker.template.d.ts +1 -2
- package/lib/toggletip/definition.d.ts +2 -0
- package/lib/toggletip/toggletip.d.ts +454 -4
- package/lib/tooltip/definition.d.ts +2 -0
- package/lib/tooltip/tooltip.d.ts +454 -4
- package/lib/tree-item/definition.d.ts +2 -0
- package/lib/tree-view/definition.d.ts +2 -0
- package/lib/video-player/definition.d.ts +2 -0
- package/menu/index.js +1 -1
- package/package.json +7 -2
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/rich-text-editor/index.cjs +5 -0
- package/rich-text-editor/index.js +3 -0
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/affix.cjs +1 -3
- package/shared/affix.js +2 -4
- package/shared/anchored.cjs +12 -9
- package/shared/anchored.js +13 -10
- package/shared/definition.js +1 -1
- package/shared/definition10.cjs +1 -0
- package/shared/definition10.js +2 -2
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +2 -2
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +2 -2
- package/shared/definition13.cjs +15 -2
- package/shared/definition13.js +16 -4
- package/shared/definition14.cjs +3 -2
- package/shared/definition14.js +4 -4
- package/shared/definition15.cjs +1 -1
- package/shared/definition15.js +2 -2
- package/shared/definition16.cjs +18 -18
- package/shared/definition16.js +6 -6
- package/shared/definition17.cjs +3 -0
- package/shared/definition17.js +2 -2
- package/shared/definition18.cjs +7 -7
- package/shared/definition18.js +4 -4
- package/shared/definition19.cjs +15 -15
- package/shared/definition19.js +4 -4
- package/shared/definition2.cjs +1 -0
- package/shared/definition2.js +2 -2
- package/shared/definition20.cjs +5 -4
- package/shared/definition20.js +6 -6
- package/shared/definition21.cjs +3 -2
- package/shared/definition21.js +4 -4
- package/shared/definition22.js +1 -1
- package/shared/definition23.cjs +2 -1
- package/shared/definition23.js +3 -3
- package/shared/definition24.cjs +2 -1
- package/shared/definition24.js +3 -3
- package/shared/definition25.cjs +14 -14
- package/shared/definition25.js +3 -3
- package/shared/definition26.cjs +2 -1
- package/shared/definition26.js +3 -3
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +2 -2
- package/shared/definition28.cjs +1 -0
- package/shared/definition28.js +2 -2
- package/shared/definition29.cjs +53 -61
- package/shared/definition29.js +54 -63
- package/shared/definition3.cjs +1 -0
- package/shared/definition3.js +2 -2
- package/shared/definition30.cjs +1 -0
- package/shared/definition30.js +2 -2
- package/shared/definition31.cjs +1 -0
- package/shared/definition31.js +2 -2
- package/shared/definition32.cjs +1 -0
- package/shared/definition32.js +2 -2
- package/shared/definition33.cjs +2 -1
- package/shared/definition33.js +3 -3
- package/shared/definition34.cjs +25 -25
- package/shared/definition34.js +5 -5
- package/shared/definition35.cjs +1 -1
- package/shared/definition35.js +2 -2
- package/shared/definition36.cjs +2 -1
- package/shared/definition36.js +3 -3
- package/shared/definition37.cjs +1 -1
- package/shared/definition37.js +2 -2
- package/shared/definition38.cjs +2 -1
- package/shared/definition38.js +3 -3
- package/shared/definition39.cjs +1 -0
- package/shared/definition39.js +2 -2
- package/shared/definition4.cjs +3 -2
- package/shared/definition4.js +4 -4
- package/shared/definition40.cjs +1 -1
- package/shared/definition40.js +2 -2
- package/shared/definition41.cjs +30 -30
- package/shared/definition41.js +5 -5
- package/shared/definition42.cjs +12538 -1046
- package/shared/definition42.js +12538 -1047
- package/shared/definition43.cjs +927 -701
- package/shared/definition43.js +929 -702
- package/shared/definition44.cjs +874 -104
- package/shared/definition44.js +874 -104
- package/shared/definition45.cjs +114 -90
- package/shared/definition45.js +113 -90
- package/shared/definition46.cjs +88 -464
- package/shared/definition46.js +87 -463
- package/shared/definition47.cjs +463 -109
- package/shared/definition47.js +462 -109
- package/shared/definition48.cjs +108 -106
- package/shared/definition48.js +107 -106
- package/shared/definition49.cjs +139 -13
- package/shared/definition49.js +138 -13
- package/shared/definition5.cjs +3 -2
- package/shared/definition5.js +5 -5
- package/shared/definition50.cjs +16 -114
- package/shared/definition50.js +15 -114
- package/shared/definition51.cjs +79 -485
- package/shared/definition51.js +78 -485
- package/shared/definition52.cjs +503 -23
- package/shared/definition52.js +502 -23
- package/shared/definition53.cjs +25 -123
- package/shared/definition53.js +24 -123
- package/shared/definition54.cjs +96 -254
- package/shared/definition54.js +96 -255
- package/shared/definition55.cjs +261 -59
- package/shared/definition55.js +262 -60
- package/shared/definition56.cjs +72 -861
- package/shared/definition56.js +72 -861
- package/shared/definition57.cjs +880 -107
- package/shared/definition57.js +880 -107
- package/shared/definition58.cjs +104 -88
- package/shared/definition58.js +104 -89
- package/shared/definition59.cjs +80 -165
- package/shared/definition59.js +79 -163
- package/shared/definition6.cjs +2 -1
- package/shared/definition6.js +3 -3
- package/shared/definition60.cjs +142 -228
- package/shared/definition60.js +141 -229
- package/shared/definition61.cjs +233 -70146
- package/shared/definition61.js +232 -70146
- package/shared/definition62.cjs +69381 -28
- package/shared/definition62.js +69380 -27
- package/shared/definition63.cjs +28 -2163
- package/shared/definition63.js +27 -2161
- package/shared/definition64.cjs +2195 -0
- package/shared/definition64.js +2190 -0
- package/shared/definition7.cjs +2 -1
- package/shared/definition7.js +3 -3
- package/shared/definition8.cjs +2 -1
- package/shared/definition8.js +3 -3
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +2 -2
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.cjs +7 -7
- package/shared/form-elements.js +8 -8
- package/shared/foundation/vivid-element/vivid-element.d.ts +1 -0
- package/shared/patterns/anchored.d.ts +891 -10
- package/shared/patterns/trapped-focus.d.ts +2 -0
- package/shared/presentationDate.cjs +5 -7
- package/shared/presentationDate.js +5 -7
- package/shared/slider.template.cjs +4 -4
- package/shared/slider.template.js +4 -4
- package/shared/text-anchor.template.cjs +2 -2
- package/shared/text-anchor.template.js +2 -2
- package/shared/text-field.cjs +555 -2
- package/shared/text-field.js +554 -2
- package/shared/text-field2.cjs +2 -572
- package/shared/text-field2.js +2 -571
- package/shared/trapped-focus.cjs +7 -1
- package/shared/trapped-focus.js +7 -1
- package/shared/utils/mixins.d.ts +3 -0
- package/shared/vivid-element.cjs +3 -0
- package/shared/vivid-element.js +4 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.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/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +22795 -1
package/shared/definition59.cjs
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const definition = require('./
|
|
3
|
+
const definition = require('./definition64.cjs');
|
|
4
4
|
const vividElement = require('./vivid-element.cjs');
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const dom = require('./dom.cjs');
|
|
8
|
-
const slotted = require('./slotted.cjs');
|
|
9
|
-
const children = require('./children.cjs');
|
|
10
|
-
const when = require('./when.cjs');
|
|
5
|
+
const anchored = require('./anchored.cjs');
|
|
6
|
+
const index = require('./index.cjs');
|
|
11
7
|
const classNames = require('./class-names.cjs');
|
|
12
|
-
const ref = require('./ref.cjs');
|
|
13
8
|
|
|
14
|
-
const styles = ":host
|
|
9
|
+
const styles = ":host :host{display:var(--_popup-display, inline)}:host :host([slotted-anchor]){--_popup-display: contents}.control{pointer-events:none}.tooltip{width:var(--tooltip-inline-size, auto);max-inline-size:var(--tooltip-max-inline-size, 30ch)}.tooltip-text{padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
15
10
|
|
|
16
11
|
var __defProp = Object.defineProperty;
|
|
17
12
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -22,189 +17,109 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
22
17
|
if (result) __defProp(target, key, result);
|
|
23
18
|
return result;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
|
-
return dom.isHTMLElement(el) && el.getAttribute("role") === "treeitem";
|
|
27
|
-
}
|
|
28
|
-
class TreeItem extends vividElement.VividElement {
|
|
20
|
+
class Tooltip extends anchored.Anchored(vividElement.VividElement) {
|
|
29
21
|
constructor() {
|
|
30
22
|
super(...arguments);
|
|
31
|
-
this.
|
|
32
|
-
this
|
|
33
|
-
|
|
34
|
-
this.focusable = false;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the tree is nested
|
|
37
|
-
*
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
this.isNestedItem = () => {
|
|
41
|
-
return isTreeItemElement(this.parentElement);
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Handle expand button click
|
|
45
|
-
*
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
this.handleExpandCollapseButtonClick = (e) => {
|
|
49
|
-
if (!this.disabled && !e.defaultPrevented) {
|
|
50
|
-
this.expanded = !this.expanded;
|
|
51
|
-
}
|
|
23
|
+
this.open = false;
|
|
24
|
+
this.#show = () => {
|
|
25
|
+
this.open = true;
|
|
52
26
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
*
|
|
56
|
-
* @internal
|
|
57
|
-
*/
|
|
58
|
-
this.handleFocus = (_e) => {
|
|
59
|
-
this.setAttribute("tabindex", "0");
|
|
27
|
+
this.#hide = () => {
|
|
28
|
+
this.open = false;
|
|
60
29
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
this.handleBlur = (_e) => {
|
|
67
|
-
this.setAttribute("tabindex", "-1");
|
|
30
|
+
this.#closeOnEscape = (e) => {
|
|
31
|
+
if (e.key === "Escape") this.#hide();
|
|
68
32
|
};
|
|
69
33
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
selectedChanged() {
|
|
76
|
-
if (this.$fastController.isConnected) {
|
|
77
|
-
this.$emit("selected-change", this);
|
|
78
|
-
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
this.#updateListeners();
|
|
79
37
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (isTreeItemElement(node)) {
|
|
84
|
-
node.nested = true;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
super.disconnectedCallback();
|
|
40
|
+
this.#updateListeners();
|
|
88
41
|
}
|
|
89
42
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @public
|
|
93
|
-
* @param el - the element to focus
|
|
43
|
+
* @internal
|
|
94
44
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
45
|
+
_anchorElChanged(oldValue, newValue) {
|
|
46
|
+
if (oldValue) this.#cleanupAnchor(oldValue);
|
|
47
|
+
if (newValue) this.#setupAnchor(newValue);
|
|
48
|
+
}
|
|
49
|
+
#setupAnchor(a) {
|
|
50
|
+
a.addEventListener("mouseover", this.#show);
|
|
51
|
+
a.addEventListener("mouseout", this.#hide);
|
|
52
|
+
a.addEventListener("focusin", this.#show);
|
|
53
|
+
a.addEventListener("focusout", this.#hide);
|
|
54
|
+
}
|
|
55
|
+
#cleanupAnchor(a) {
|
|
56
|
+
a.removeEventListener("mouseover", this.#show);
|
|
57
|
+
a.removeEventListener("mouseout", this.#hide);
|
|
58
|
+
a.removeEventListener("focusin", this.#show);
|
|
59
|
+
a.removeEventListener("focusout", this.#hide);
|
|
60
|
+
}
|
|
61
|
+
#show;
|
|
62
|
+
#hide;
|
|
63
|
+
#updateListeners() {
|
|
64
|
+
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
65
|
+
if (this.open && this.isConnected) {
|
|
66
|
+
document.addEventListener("keydown", this.#closeOnEscape);
|
|
67
|
+
}
|
|
98
68
|
}
|
|
69
|
+
#closeOnEscape;
|
|
99
70
|
/**
|
|
100
|
-
* Gets number of children
|
|
101
|
-
*
|
|
102
71
|
* @internal
|
|
103
72
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return isTreeItemElement(item);
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
return treeChildren.length;
|
|
73
|
+
openChanged(oldValue) {
|
|
74
|
+
if (oldValue === void 0) return;
|
|
75
|
+
this.#updateListeners();
|
|
111
76
|
}
|
|
112
77
|
}
|
|
113
78
|
__decorateClass([
|
|
114
79
|
vividElement.attr
|
|
115
|
-
],
|
|
80
|
+
], Tooltip.prototype, "text");
|
|
116
81
|
__decorateClass([
|
|
117
|
-
vividElement.attr({ mode: "
|
|
118
|
-
],
|
|
119
|
-
__decorateClass([
|
|
120
|
-
vividElement.attr({
|
|
121
|
-
mode: "boolean"
|
|
122
|
-
})
|
|
123
|
-
], TreeItem.prototype, "selected");
|
|
82
|
+
vividElement.attr({ mode: "fromView" })
|
|
83
|
+
], Tooltip.prototype, "placement");
|
|
124
84
|
__decorateClass([
|
|
125
85
|
vividElement.attr({ mode: "boolean" })
|
|
126
|
-
],
|
|
127
|
-
__decorateClass([
|
|
128
|
-
vividElement.observable
|
|
129
|
-
], TreeItem.prototype, "focusable");
|
|
130
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
131
|
-
__decorateClass([
|
|
132
|
-
vividElement.observable
|
|
133
|
-
], TreeItem.prototype, "childItems");
|
|
134
|
-
__decorateClass([
|
|
135
|
-
vividElement.observable
|
|
136
|
-
], TreeItem.prototype, "items");
|
|
137
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
138
|
-
__decorateClass([
|
|
139
|
-
vividElement.observable
|
|
140
|
-
], TreeItem.prototype, "nested");
|
|
141
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
142
|
-
__decorateClass([
|
|
143
|
-
vividElement.observable
|
|
144
|
-
], TreeItem.prototype, "renderCollapsedChildren");
|
|
145
|
-
applyMixins.applyMixins(TreeItem, affix.AffixIcon);
|
|
86
|
+
], Tooltip.prototype, "open");
|
|
146
87
|
|
|
147
|
-
const getClasses = ({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
);
|
|
152
|
-
const expandCollapseButton = (context) => {
|
|
153
|
-
const iconTag = context.tagFor(definition.Icon);
|
|
88
|
+
const getClasses = ({ open }) => classNames.classNames("control", ["open", Boolean(open)]);
|
|
89
|
+
const TooltipTemplate = (context) => {
|
|
90
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
91
|
+
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
154
92
|
return vividElement.html`
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
173
|
-
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
174
|
-
${children.children({
|
|
175
|
-
property: "childItems",
|
|
176
|
-
filter: slotted.elements(context.tagFor(TreeItem))
|
|
177
|
-
})}
|
|
178
|
-
>
|
|
179
|
-
<div class="${getClasses}">
|
|
180
|
-
${when.when(
|
|
181
|
-
(x) => x.childItems && x.childItems.length > 0,
|
|
182
|
-
expandCollapseButton(context)
|
|
183
|
-
)}
|
|
184
|
-
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
185
|
-
${(x) => x.text}
|
|
186
|
-
</div>
|
|
187
|
-
${when.when(
|
|
188
|
-
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
189
|
-
vividElement.html` <div role="group" class="items">
|
|
190
|
-
<slot name="item" ${slotted.slotted("items")}></slot>
|
|
191
|
-
</div>`
|
|
192
|
-
)}
|
|
193
|
-
</template>`;
|
|
93
|
+
${anchorSlotTemplate}
|
|
94
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
95
|
+
:placement=${(x) => x.placement}
|
|
96
|
+
:anchor="${(x) => x._anchorEl}"
|
|
97
|
+
:open="${(x) => x.open}"
|
|
98
|
+
@keydown="${(x, c) => {
|
|
99
|
+
if (x.open && index.handleEscapeKeyAndStopPropogation(c.event)) {
|
|
100
|
+
x.open = false;
|
|
101
|
+
}
|
|
102
|
+
}}"
|
|
103
|
+
exportparts="vvd-theme-alternate">
|
|
104
|
+
<div class="tooltip" role="tooltip">
|
|
105
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
106
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
107
|
+
</header>
|
|
108
|
+
</div>
|
|
109
|
+
</${popupTag}>`;
|
|
194
110
|
};
|
|
195
111
|
|
|
196
|
-
const
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
[definition.
|
|
112
|
+
const tooltipDefinition = vividElement.defineVividComponent(
|
|
113
|
+
"tooltip",
|
|
114
|
+
Tooltip,
|
|
115
|
+
TooltipTemplate,
|
|
116
|
+
[definition.popupDefinition],
|
|
201
117
|
{
|
|
202
118
|
styles
|
|
203
119
|
}
|
|
204
120
|
);
|
|
205
|
-
const
|
|
121
|
+
const registerTooltip = vividElement.createRegisterFunction(tooltipDefinition);
|
|
206
122
|
|
|
207
|
-
exports.
|
|
208
|
-
exports.
|
|
209
|
-
exports.
|
|
210
|
-
exports.treeItemDefinition = treeItemDefinition;
|
|
123
|
+
exports.Tooltip = Tooltip;
|
|
124
|
+
exports.registerTooltip = registerTooltip;
|
|
125
|
+
exports.tooltipDefinition = tooltipDefinition;
|
package/shared/definition59.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { V as VividElement, a as attr,
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { i as isHTMLElement } from './dom.js';
|
|
6
|
-
import { e as elements, s as slotted } from './slotted.js';
|
|
7
|
-
import { c as children } from './children.js';
|
|
8
|
-
import { w as when } from './when.js';
|
|
1
|
+
import { P as Popup, p as popupDefinition } from './definition64.js';
|
|
2
|
+
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
3
|
+
import { A as Anchored, a as anchorSlotTemplateFactory } from './anchored.js';
|
|
4
|
+
import { h as handleEscapeKeyAndStopPropogation } from './index.js';
|
|
9
5
|
import { c as classNames } from './class-names.js';
|
|
10
|
-
import { r as ref } from './ref.js';
|
|
11
6
|
|
|
12
|
-
const styles = ":host
|
|
7
|
+
const styles = ":host :host{display:var(--_popup-display, inline)}:host :host([slotted-anchor]){--_popup-display: contents}.control{pointer-events:none}.tooltip{width:var(--tooltip-inline-size, auto);max-inline-size:var(--tooltip-max-inline-size, 30ch)}.tooltip-text{padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
13
8
|
|
|
14
9
|
var __defProp = Object.defineProperty;
|
|
15
10
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -20,186 +15,107 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
20
15
|
if (result) __defProp(target, key, result);
|
|
21
16
|
return result;
|
|
22
17
|
};
|
|
23
|
-
|
|
24
|
-
return isHTMLElement(el) && el.getAttribute("role") === "treeitem";
|
|
25
|
-
}
|
|
26
|
-
class TreeItem extends VividElement {
|
|
18
|
+
class Tooltip extends Anchored(VividElement) {
|
|
27
19
|
constructor() {
|
|
28
20
|
super(...arguments);
|
|
29
|
-
this.
|
|
30
|
-
this
|
|
31
|
-
|
|
32
|
-
this.focusable = false;
|
|
33
|
-
/**
|
|
34
|
-
* Whether the tree is nested
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
this.isNestedItem = () => {
|
|
39
|
-
return isTreeItemElement(this.parentElement);
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Handle expand button click
|
|
43
|
-
*
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
this.handleExpandCollapseButtonClick = (e) => {
|
|
47
|
-
if (!this.disabled && !e.defaultPrevented) {
|
|
48
|
-
this.expanded = !this.expanded;
|
|
49
|
-
}
|
|
21
|
+
this.open = false;
|
|
22
|
+
this.#show = () => {
|
|
23
|
+
this.open = true;
|
|
50
24
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
this.handleFocus = (_e) => {
|
|
57
|
-
this.setAttribute("tabindex", "0");
|
|
25
|
+
this.#hide = () => {
|
|
26
|
+
this.open = false;
|
|
58
27
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
* @internal
|
|
63
|
-
*/
|
|
64
|
-
this.handleBlur = (_e) => {
|
|
65
|
-
this.setAttribute("tabindex", "-1");
|
|
28
|
+
this.#closeOnEscape = (e) => {
|
|
29
|
+
if (e.key === "Escape") this.#hide();
|
|
66
30
|
};
|
|
67
31
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
selectedChanged() {
|
|
74
|
-
if (this.$fastController.isConnected) {
|
|
75
|
-
this.$emit("selected-change", this);
|
|
76
|
-
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
this.#updateListeners();
|
|
77
35
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (isTreeItemElement(node)) {
|
|
82
|
-
node.nested = true;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
super.disconnectedCallback();
|
|
38
|
+
this.#updateListeners();
|
|
86
39
|
}
|
|
87
40
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
91
|
-
* @param el - the element to focus
|
|
41
|
+
* @internal
|
|
92
42
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
43
|
+
_anchorElChanged(oldValue, newValue) {
|
|
44
|
+
if (oldValue) this.#cleanupAnchor(oldValue);
|
|
45
|
+
if (newValue) this.#setupAnchor(newValue);
|
|
46
|
+
}
|
|
47
|
+
#setupAnchor(a) {
|
|
48
|
+
a.addEventListener("mouseover", this.#show);
|
|
49
|
+
a.addEventListener("mouseout", this.#hide);
|
|
50
|
+
a.addEventListener("focusin", this.#show);
|
|
51
|
+
a.addEventListener("focusout", this.#hide);
|
|
52
|
+
}
|
|
53
|
+
#cleanupAnchor(a) {
|
|
54
|
+
a.removeEventListener("mouseover", this.#show);
|
|
55
|
+
a.removeEventListener("mouseout", this.#hide);
|
|
56
|
+
a.removeEventListener("focusin", this.#show);
|
|
57
|
+
a.removeEventListener("focusout", this.#hide);
|
|
58
|
+
}
|
|
59
|
+
#show;
|
|
60
|
+
#hide;
|
|
61
|
+
#updateListeners() {
|
|
62
|
+
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
63
|
+
if (this.open && this.isConnected) {
|
|
64
|
+
document.addEventListener("keydown", this.#closeOnEscape);
|
|
65
|
+
}
|
|
96
66
|
}
|
|
67
|
+
#closeOnEscape;
|
|
97
68
|
/**
|
|
98
|
-
* Gets number of children
|
|
99
|
-
*
|
|
100
69
|
* @internal
|
|
101
70
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return isTreeItemElement(item);
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
return treeChildren.length;
|
|
71
|
+
openChanged(oldValue) {
|
|
72
|
+
if (oldValue === void 0) return;
|
|
73
|
+
this.#updateListeners();
|
|
109
74
|
}
|
|
110
75
|
}
|
|
111
76
|
__decorateClass([
|
|
112
77
|
attr
|
|
113
|
-
],
|
|
78
|
+
], Tooltip.prototype, "text");
|
|
114
79
|
__decorateClass([
|
|
115
|
-
attr({ mode: "
|
|
116
|
-
],
|
|
117
|
-
__decorateClass([
|
|
118
|
-
attr({
|
|
119
|
-
mode: "boolean"
|
|
120
|
-
})
|
|
121
|
-
], TreeItem.prototype, "selected");
|
|
80
|
+
attr({ mode: "fromView" })
|
|
81
|
+
], Tooltip.prototype, "placement");
|
|
122
82
|
__decorateClass([
|
|
123
83
|
attr({ mode: "boolean" })
|
|
124
|
-
],
|
|
125
|
-
__decorateClass([
|
|
126
|
-
observable
|
|
127
|
-
], TreeItem.prototype, "focusable");
|
|
128
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
129
|
-
__decorateClass([
|
|
130
|
-
observable
|
|
131
|
-
], TreeItem.prototype, "childItems");
|
|
132
|
-
__decorateClass([
|
|
133
|
-
observable
|
|
134
|
-
], TreeItem.prototype, "items");
|
|
135
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
136
|
-
__decorateClass([
|
|
137
|
-
observable
|
|
138
|
-
], TreeItem.prototype, "nested");
|
|
139
|
-
// @ts-expect-error Type is incorrectly non-optional
|
|
140
|
-
__decorateClass([
|
|
141
|
-
observable
|
|
142
|
-
], TreeItem.prototype, "renderCollapsedChildren");
|
|
143
|
-
applyMixins(TreeItem, AffixIcon);
|
|
84
|
+
], Tooltip.prototype, "open");
|
|
144
85
|
|
|
145
|
-
const getClasses = ({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
);
|
|
150
|
-
const expandCollapseButton = (context) => {
|
|
151
|
-
const iconTag = context.tagFor(Icon);
|
|
86
|
+
const getClasses = ({ open }) => classNames("control", ["open", Boolean(open)]);
|
|
87
|
+
const TooltipTemplate = (context) => {
|
|
88
|
+
const popupTag = context.tagFor(Popup);
|
|
89
|
+
const anchorSlotTemplate = anchorSlotTemplateFactory();
|
|
152
90
|
return html`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
171
|
-
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
172
|
-
${children({
|
|
173
|
-
property: "childItems",
|
|
174
|
-
filter: elements(context.tagFor(TreeItem))
|
|
175
|
-
})}
|
|
176
|
-
>
|
|
177
|
-
<div class="${getClasses}">
|
|
178
|
-
${when(
|
|
179
|
-
(x) => x.childItems && x.childItems.length > 0,
|
|
180
|
-
expandCollapseButton(context)
|
|
181
|
-
)}
|
|
182
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
183
|
-
${(x) => x.text}
|
|
184
|
-
</div>
|
|
185
|
-
${when(
|
|
186
|
-
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
187
|
-
html` <div role="group" class="items">
|
|
188
|
-
<slot name="item" ${slotted("items")}></slot>
|
|
189
|
-
</div>`
|
|
190
|
-
)}
|
|
191
|
-
</template>`;
|
|
91
|
+
${anchorSlotTemplate}
|
|
92
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
93
|
+
:placement=${(x) => x.placement}
|
|
94
|
+
:anchor="${(x) => x._anchorEl}"
|
|
95
|
+
:open="${(x) => x.open}"
|
|
96
|
+
@keydown="${(x, c) => {
|
|
97
|
+
if (x.open && handleEscapeKeyAndStopPropogation(c.event)) {
|
|
98
|
+
x.open = false;
|
|
99
|
+
}
|
|
100
|
+
}}"
|
|
101
|
+
exportparts="vvd-theme-alternate">
|
|
102
|
+
<div class="tooltip" role="tooltip">
|
|
103
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
104
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
105
|
+
</header>
|
|
106
|
+
</div>
|
|
107
|
+
</${popupTag}>`;
|
|
192
108
|
};
|
|
193
109
|
|
|
194
|
-
const
|
|
195
|
-
"
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
[
|
|
110
|
+
const tooltipDefinition = defineVividComponent(
|
|
111
|
+
"tooltip",
|
|
112
|
+
Tooltip,
|
|
113
|
+
TooltipTemplate,
|
|
114
|
+
[popupDefinition],
|
|
199
115
|
{
|
|
200
116
|
styles
|
|
201
117
|
}
|
|
202
118
|
);
|
|
203
|
-
const
|
|
119
|
+
const registerTooltip = createRegisterFunction(tooltipDefinition);
|
|
204
120
|
|
|
205
|
-
export {
|
|
121
|
+
export { Tooltip as T, registerTooltip as r, tooltipDefinition as t };
|
package/shared/definition6.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const definition = require('./definition27.cjs');
|
|
4
4
|
const vividElement = require('./vivid-element.cjs');
|
|
5
|
-
const when = require('./when.cjs');
|
|
6
5
|
const classNames = require('./class-names.cjs');
|
|
6
|
+
const when = require('./when.cjs');
|
|
7
7
|
|
|
8
8
|
const styles = ".base.connotation-cta{--_connotation-color-primary: var(--vvd-avatar-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-avatar-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-firm: var(--vvd-avatar-cta-firm, var(--vvd-color-cta-600));--_connotation-color-firm-all: var(--vvd-avatar-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-avatar-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-pale: var(--vvd-avatar-cta-pale, var(--vvd-color-cta-300));--_connotation-color-soft: var(--vvd-avatar-cta-soft, var(--vvd-color-cta-100));--_connotation-color-contrast: var(--vvd-avatar-cta-contrast, var(--vvd-color-cta-800))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-avatar-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-avatar-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-firm: var(--vvd-avatar-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-firm-all: var(--vvd-avatar-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-fierce: var(--vvd-avatar-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-pale: var(--vvd-avatar-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-soft: var(--vvd-avatar-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-contrast: var(--vvd-avatar-accent-contrast, var(--vvd-color-neutral-800))}.base{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.base.appearance-outlined{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base.appearance-subtle{--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;border-radius:var(--_avatar-border-radius);background-color:var(--_appearance-color-fill);block-size:var(--_size);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:var(--_size);vertical-align:middle}.base.size-condensed{--_size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base.size-condensed .initials{font:var(--vvd-typography-base-condensed-bold)}.base.size-condensed .icon{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base.size-expanded{--_size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base.size-expanded .initials{font:var(--vvd-typography-heading-4)}.base.size-expanded .icon{font-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base:not(.size-condensed,.size-expanded){--_size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base:not(.size-condensed,.size-expanded) .initials{font:var(--vvd-typography-base-extended-bold)}.base:not(.size-condensed,.size-expanded) .icon{font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base:not(.shape-pill){--_avatar-border-radius: 8px}.base:not(.shape-pill).size-condensed{--_avatar-border-radius: 4px}.base.shape-pill{--_avatar-border-radius: 50%}.base .initials{text-transform:uppercase}.base ::slotted(*){block-size:100%;inline-size:100%;object-fit:cover}";
|
|
9
9
|
|
|
@@ -77,5 +77,6 @@ const avatarDefinition = vividElement.defineVividComponent(
|
|
|
77
77
|
);
|
|
78
78
|
const registerAvatar = vividElement.createRegisterFunction(avatarDefinition);
|
|
79
79
|
|
|
80
|
+
exports.Avatar = Avatar;
|
|
80
81
|
exports.avatarDefinition = avatarDefinition;
|
|
81
82
|
exports.registerAvatar = registerAvatar;
|
package/shared/definition6.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { I as Icon, i as iconDefinition } from './definition27.js';
|
|
2
|
-
import { V as VividElement, a as attr, h as html, d as
|
|
3
|
-
import { w as when } from './when.js';
|
|
2
|
+
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
4
3
|
import { c as classNames } from './class-names.js';
|
|
4
|
+
import { w as when } from './when.js';
|
|
5
5
|
|
|
6
6
|
const styles = ".base.connotation-cta{--_connotation-color-primary: var(--vvd-avatar-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-avatar-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-firm: var(--vvd-avatar-cta-firm, var(--vvd-color-cta-600));--_connotation-color-firm-all: var(--vvd-avatar-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-avatar-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-pale: var(--vvd-avatar-cta-pale, var(--vvd-color-cta-300));--_connotation-color-soft: var(--vvd-avatar-cta-soft, var(--vvd-color-cta-100));--_connotation-color-contrast: var(--vvd-avatar-cta-contrast, var(--vvd-color-cta-800))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-avatar-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-avatar-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-firm: var(--vvd-avatar-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-firm-all: var(--vvd-avatar-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-fierce: var(--vvd-avatar-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-pale: var(--vvd-avatar-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-soft: var(--vvd-avatar-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-contrast: var(--vvd-avatar-accent-contrast, var(--vvd-color-neutral-800))}.base{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.base.appearance-outlined{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-300)}.base.appearance-duotone{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base.appearance-subtle{--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;border-radius:var(--_avatar-border-radius);background-color:var(--_appearance-color-fill);block-size:var(--_size);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);inline-size:var(--_size);vertical-align:middle}.base.size-condensed{--_size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base.size-condensed .initials{font:var(--vvd-typography-base-condensed-bold)}.base.size-condensed .icon{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base.size-expanded{--_size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base.size-expanded .initials{font:var(--vvd-typography-heading-4)}.base.size-expanded .icon{font-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base:not(.size-condensed,.size-expanded){--_size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.base:not(.size-condensed,.size-expanded) .initials{font:var(--vvd-typography-base-extended-bold)}.base:not(.size-condensed,.size-expanded) .icon{font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.base:not(.shape-pill){--_avatar-border-radius: 8px}.base:not(.shape-pill).size-condensed{--_avatar-border-radius: 4px}.base.shape-pill{--_avatar-border-radius: 50%}.base .initials{text-transform:uppercase}.base ::slotted(*){block-size:100%;inline-size:100%;object-fit:cover}";
|
|
7
7
|
|
|
@@ -75,4 +75,4 @@ const avatarDefinition = defineVividComponent(
|
|
|
75
75
|
);
|
|
76
76
|
const registerAvatar = createRegisterFunction(avatarDefinition);
|
|
77
77
|
|
|
78
|
-
export { avatarDefinition as a, registerAvatar as r };
|
|
78
|
+
export { Avatar as A, avatarDefinition as a, registerAvatar as r };
|