@vonage/vivid 3.0.0-next.30 → 3.0.0-next.31
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/action-group/index.js +1 -1
- package/divider/index.js +88 -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/package.json +3 -2
- package/popup/index.js +14 -6
- package/shared/form-associated.js +2 -1
- package/tooltip/index.js +2 -2
package/action-group/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import '../shared/export.js';
|
|
|
6
6
|
import '../shared/object-keys.js';
|
|
7
7
|
import '../shared/iterators.js';
|
|
8
8
|
|
|
9
|
-
var css_248z = ":host {\n display: inline-block;\n}\n\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n inline-size: inherit;\n vertical-align: middle;\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::before {\n position: absolute;\n z-index: 1;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inset: 0;\n pointer-events: none;\n}\n.base:not(.tight) {\n padding: 4px;\n column-gap: 4px;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.base.shape-pill {\n border-radius: 24px;\n}\n\n::slotted([role=separator]) {\n width: 1px;\n align-self: stretch;\n background-color: var(--vvd-color-neutral-30);\n margin-block: 4px;\n}";
|
|
9
|
+
var css_248z = ":host {\n display: inline-block;\n}\n\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n inline-size: inherit;\n vertical-align: middle;\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::before {\n position: absolute;\n z-index: 1;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inset: 0;\n pointer-events: none;\n}\n.base:not(.tight) {\n padding: 4px;\n column-gap: 4px;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.base.shape-pill {\n border-radius: 24px;\n}\n\n::slotted([role=separator]) {\n width: 1px;\n align-self: stretch;\n background-color: var(--vvd-color-neutral-30);\n margin-block: 4px;\n}\n\n::slotted([vwc-divider]) {\n align-self: stretch;\n margin-block: 4px;\n}";
|
|
10
10
|
styleInject(css_248z);
|
|
11
11
|
|
|
12
12
|
class ActionGroup extends FoundationElement {
|
package/divider/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Standard orientation values
|
|
7
|
+
*/
|
|
8
|
+
const Orientation = {
|
|
9
|
+
horizontal: "horizontal",
|
|
10
|
+
vertical: "vertical",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Divider roles
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
const DividerRole = {
|
|
18
|
+
/**
|
|
19
|
+
* The divider semantically separates content
|
|
20
|
+
*/
|
|
21
|
+
separator: "separator",
|
|
22
|
+
/**
|
|
23
|
+
* The divider has no semantic value and is for visual presentation only.
|
|
24
|
+
*/
|
|
25
|
+
presentation: "presentation",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Divider Custom HTML Element.
|
|
30
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
class Divider$1 extends FoundationElement {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
/**
|
|
38
|
+
* The role of the element.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* HTML Attribute: role
|
|
43
|
+
*/
|
|
44
|
+
this.role = DividerRole.separator;
|
|
45
|
+
/**
|
|
46
|
+
* The orientation of the divider.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
* @remarks
|
|
50
|
+
* HTML Attribute: orientation
|
|
51
|
+
*/
|
|
52
|
+
this.orientation = Orientation.horizontal;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
__decorate([
|
|
56
|
+
attr
|
|
57
|
+
], Divider$1.prototype, "role", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
attr
|
|
60
|
+
], Divider$1.prototype, "orientation", void 0);
|
|
61
|
+
|
|
62
|
+
var css_248z = ":host {\n display: block;\n}\n\n.base {\n display: block;\n background-color: var(--vvd-color-neutral-30);\n}\n.base:not(.vertical) {\n block-size: 1px;\n inline-size: 100%;\n}\n.base.vertical {\n block-size: 100%;\n inline-size: 1px;\n}";
|
|
63
|
+
styleInject(css_248z);
|
|
64
|
+
|
|
65
|
+
class Divider extends Divider$1 {}
|
|
66
|
+
|
|
67
|
+
let _ = t => t,
|
|
68
|
+
_t;
|
|
69
|
+
|
|
70
|
+
const getClasses = ({
|
|
71
|
+
orientation
|
|
72
|
+
}) => classNames('base', [`${orientation}`, Boolean(orientation)]);
|
|
73
|
+
|
|
74
|
+
const DividerTemplate = () => html(_t || (_t = _`
|
|
75
|
+
<span
|
|
76
|
+
class="${0}"
|
|
77
|
+
orientation="${0}"
|
|
78
|
+
role="${0}"
|
|
79
|
+
></span>`), getClasses, x => x.orientation, x => x.role);
|
|
80
|
+
|
|
81
|
+
const vividDivider = Divider.compose({
|
|
82
|
+
baseName: 'divider',
|
|
83
|
+
template: DividerTemplate,
|
|
84
|
+
styles: css_248z
|
|
85
|
+
});
|
|
86
|
+
designSystem.register(vividDivider());
|
|
87
|
+
|
|
88
|
+
export { vividDivider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ViewTemplate } from '@microsoft/fast-element';
|
|
2
|
+
import type { ElementDefinitionContext, FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
3
|
+
import type { Divider } from './divider';
|
|
4
|
+
export declare const DividerTemplate: (context: ElementDefinitionContext, definition: FoundationElementDefinition) => ViewTemplate<Divider>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { FoundationElementDefinition } from '@microsoft/fast-foundation';
|
|
2
|
+
export declare const vividDivider: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<FoundationElementDefinition> | undefined) => import("@microsoft/fast-foundation").FoundationElementRegistry<FoundationElementDefinition, import("@microsoft/fast-element").Constructable<import("@microsoft/fast-foundation").FoundationElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/vivid",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./index.esm.js",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"./text": "./text",
|
|
31
31
|
"./text-field": "./text-field",
|
|
32
32
|
"./tooltip": "./tooltip",
|
|
33
|
-
"./checkbox": "./checkbox"
|
|
33
|
+
"./checkbox": "./checkbox",
|
|
34
|
+
"./divider": "./divider"
|
|
34
35
|
},
|
|
35
36
|
"typings": "./index.d.ts",
|
|
36
37
|
"dependencies": {
|
package/popup/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { o as objectCreate } from '../shared/web.dom-collections.iterator.js';
|
|
|
6
6
|
import '../shared/es.object.assign.js';
|
|
7
7
|
import { j as anObject$3, e as fails$5, g as global$3, v as functionCall, f as functionUncurryThis, Q as shared$1, y as internalState, _ as _export, w as wellKnownSymbol$2, u as defineBuiltIn$1, K as createNonEnumerableProperty$1, x as isObject$1, c as classofRaw, B as requireObjectCoercible$2, R as toIntegerOrInfinity$1, S as toPropertyKey$1, o as objectDefineProperty, J as createPropertyDescriptor$1, A as lengthOfArrayLike$1, T as toAbsoluteIndex$1, i as isCallable$1, U as toLength$1, z as getMethod$1 } from '../shared/export.js';
|
|
8
8
|
import { t as toString$3 } from '../shared/to-string.js';
|
|
9
|
+
import { a as keyEscape } from '../shared/form-associated.js';
|
|
9
10
|
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
10
11
|
import { w as when } from '../shared/when.js';
|
|
11
12
|
import { r as ref } from '../shared/aria-global.js';
|
|
@@ -18,7 +19,6 @@ import '../shared/focus.js';
|
|
|
18
19
|
import '../shared/affix.js';
|
|
19
20
|
import '../shared/button.js';
|
|
20
21
|
import '../shared/apply-mixins.js';
|
|
21
|
-
import '../shared/form-associated.js';
|
|
22
22
|
import '../shared/focus2.js';
|
|
23
23
|
import '../shared/object-keys.js';
|
|
24
24
|
|
|
@@ -1927,7 +1927,7 @@ const computePosition = (reference, floating, options) => computePosition$1(refe
|
|
|
1927
1927
|
...options
|
|
1928
1928
|
});
|
|
1929
1929
|
|
|
1930
|
-
var _Popup_instances, _Popup_arrowPosition_get, _Popup_padding_get, _Popup_distance_get, _Popup_strategy_get, _Popup_middleware_get, _Popup_cleanup, _Popup_anchorEl, _Popup_assignPopupPosition, _Popup_assignArrowPosition, _Popup_getAnchorById;
|
|
1930
|
+
var _Popup_instances, _Popup_arrowPosition_get, _Popup_padding_get, _Popup_distance_get, _Popup_strategy_get, _Popup_middleware_get, _Popup_cleanup, _Popup_anchorEl, _Popup_assignPopupPosition, _Popup_assignArrowPosition, _Popup_getAnchorById, _Popup_handleKeydown;
|
|
1931
1931
|
class Popup extends FoundationElement {
|
|
1932
1932
|
constructor() {
|
|
1933
1933
|
super();
|
|
@@ -1946,14 +1946,15 @@ class Popup extends FoundationElement {
|
|
|
1946
1946
|
}
|
|
1947
1947
|
|
|
1948
1948
|
disconnectedCallback() {
|
|
1949
|
-
var _a;
|
|
1949
|
+
var _a, _b;
|
|
1950
1950
|
|
|
1951
1951
|
super.disconnectedCallback();
|
|
1952
|
-
(_a = __classPrivateFieldGet(this,
|
|
1952
|
+
(_a = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', e => __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_handleKeydown).call(this, e));
|
|
1953
|
+
(_b = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1953
1954
|
}
|
|
1954
1955
|
|
|
1955
1956
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
1956
|
-
var _a;
|
|
1957
|
+
var _a, _b;
|
|
1957
1958
|
|
|
1958
1959
|
super.attributeChangedCallback(name, oldValue, newValue);
|
|
1959
1960
|
|
|
@@ -1962,6 +1963,7 @@ class Popup extends FoundationElement {
|
|
|
1962
1963
|
{
|
|
1963
1964
|
__classPrivateFieldSet(this, _Popup_anchorEl, __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_getAnchorById).call(this), "f");
|
|
1964
1965
|
|
|
1966
|
+
(_a = __classPrivateFieldGet(this, _Popup_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.addEventListener('keydown', e => __classPrivateFieldGet(this, _Popup_instances, "m", _Popup_handleKeydown).call(this, e));
|
|
1965
1967
|
break;
|
|
1966
1968
|
}
|
|
1967
1969
|
}
|
|
@@ -1969,7 +1971,7 @@ class Popup extends FoundationElement {
|
|
|
1969
1971
|
if (__classPrivateFieldGet(this, _Popup_anchorEl, "f") && this.popupEl) {
|
|
1970
1972
|
__classPrivateFieldSet(this, _Popup_cleanup, autoUpdate(__classPrivateFieldGet(this, _Popup_anchorEl, "f"), this.popupEl, () => this.updatePosition()), "f");
|
|
1971
1973
|
} else {
|
|
1972
|
-
(
|
|
1974
|
+
(_b = __classPrivateFieldGet(this, _Popup_cleanup, "f")) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1973
1975
|
}
|
|
1974
1976
|
}
|
|
1975
1977
|
|
|
@@ -2046,6 +2048,12 @@ _Popup_cleanup = new WeakMap(), _Popup_anchorEl = new WeakMap(), _Popup_instance
|
|
|
2046
2048
|
});
|
|
2047
2049
|
}, _Popup_getAnchorById = function _Popup_getAnchorById() {
|
|
2048
2050
|
return document.getElementById(this.anchor);
|
|
2051
|
+
}, _Popup_handleKeydown = function _Popup_handleKeydown({
|
|
2052
|
+
key
|
|
2053
|
+
}) {
|
|
2054
|
+
if (key === keyEscape) {
|
|
2055
|
+
this.open = false;
|
|
2056
|
+
}
|
|
2049
2057
|
};
|
|
2050
2058
|
|
|
2051
2059
|
__decorate([attr({
|
|
@@ -77,6 +77,7 @@ var KeyCodes;
|
|
|
77
77
|
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
78
78
|
})(KeyCodes || (KeyCodes = {}));
|
|
79
79
|
const keyEnter = "Enter";
|
|
80
|
+
const keyEscape = "Escape";
|
|
80
81
|
const keySpace = " ";
|
|
81
82
|
|
|
82
83
|
const proxySlotName = "form-associated-proxy";
|
|
@@ -544,4 +545,4 @@ function CheckableFormAssociated(BaseCtor) {
|
|
|
544
545
|
return D;
|
|
545
546
|
}
|
|
546
547
|
|
|
547
|
-
export { CheckableFormAssociated as C, FormAssociated as F, keySpace as k };
|
|
548
|
+
export { CheckableFormAssociated as C, FormAssociated as F, keyEscape as a, keySpace as k };
|
package/tooltip/index.js
CHANGED
|
@@ -50,9 +50,9 @@ let _2 = t => t,
|
|
|
50
50
|
const getClasses = _ => classNames('control');
|
|
51
51
|
|
|
52
52
|
const TooltipTemplate = () => html(_t || (_t = _2`
|
|
53
|
-
<vwc-popup class="${0}" arrow alternate
|
|
53
|
+
<vwc-popup class="${0}" arrow alternate
|
|
54
54
|
corner=${0} open=${0} anchor=${0}
|
|
55
|
-
exportparts="vvd-theme-alternate">
|
|
55
|
+
exportparts="vvd-theme-alternate" role="tooltip">
|
|
56
56
|
<div class="tooltip">
|
|
57
57
|
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
58
58
|
<div class="tooltip-text">${0}</div>
|