@vonage/vivid 3.0.0-next.129 → 3.0.0-next.130
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/combobox/index.js +33 -0
- package/custom-elements.json +102 -0
- package/dialog/index.js +1 -1
- package/divider/index.js +1 -1
- package/fab/index.js +1 -1
- package/header/index.js +1 -1
- package/index.js +30 -26
- package/layout/index.js +1 -1
- package/lib/combobox/combobox.d.ts +14 -0
- package/lib/combobox/combobox.template.d.ts +4 -0
- package/lib/combobox/definition.d.ts +3 -0
- package/lib/combobox/index.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/listbox/index.js +3 -2
- package/menu/index.js +3 -3
- package/menu-item/index.js +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/number-field/index.js +4 -3
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/popup/index.js +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition13.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition16.js +1 -1
- package/shared/definition17.js +709 -198
- package/shared/definition18.js +1630 -64
- package/shared/definition19.js +242 -68
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +205 -40
- package/shared/definition21.js +67 -33
- package/shared/definition22.js +70 -1038
- package/shared/definition23.js +44 -247
- package/shared/definition24.js +35 -339
- package/shared/definition25.js +46 -1632
- package/shared/definition26.js +268 -271
- package/shared/definition27.js +344 -14
- package/shared/definition28.js +13 -67
- package/shared/definition29.js +65 -21
- package/shared/definition30.js +20 -45
- package/shared/definition31.js +40 -78
- package/shared/definition32.js +76 -59
- package/shared/definition33.js +67 -35
- package/shared/definition34.js +31 -421
- package/shared/definition35.js +418 -69
- package/shared/definition36.js +66 -572
- package/shared/definition37.js +526 -81
- package/shared/definition38.js +85 -217
- package/shared/definition39.js +246 -85
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +110 -68
- package/shared/definition41.js +77 -0
- package/shared/definition5.js +1 -1
- 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 +3 -225
- package/shared/listbox.js +1002 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -2
- package/shared/text-field.js +3 -0
- package/shared/text-field2.js +225 -0
- package/side-drawer/index.js +1 -1
- package/slider/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/switch/index.js +1 -1
- package/text-area/index.js +2 -1
- package/text-field/index.js +3 -1
- package/tooltip/index.js +2 -2
- package/vivid.api.json +123 -0
package/shared/definition23.js
CHANGED
|
@@ -1,261 +1,58 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import {
|
|
3
|
-
import { f as focusRegistries } from './definition4.js';
|
|
4
|
-
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
-
import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
6
|
-
import { S as StartEnd } from './start-end.js';
|
|
7
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
8
|
-
import { i as isHTMLElement } from './dom.js';
|
|
9
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
10
|
-
import './icon.js';
|
|
11
|
-
import { w as when } from './when.js';
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { E as Elevation, e as elevationRegistries } from './definition15.js';
|
|
12
3
|
import { c as classNames } from './class-names.js';
|
|
13
4
|
|
|
14
|
-
|
|
15
|
-
* Determines if the element is a {@link (ListboxOption:class)}
|
|
16
|
-
*
|
|
17
|
-
* @param element - the element to test.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
function isListboxOption(el) {
|
|
21
|
-
return (isHTMLElement(el) &&
|
|
22
|
-
(el.getAttribute("role") === "option" ||
|
|
23
|
-
el instanceof HTMLOptionElement));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* An Option Custom HTML Element.
|
|
27
|
-
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
|
|
28
|
-
*
|
|
29
|
-
* @slot start - Content which can be provided before the listbox option content
|
|
30
|
-
* @slot end - Content which can be provided after the listbox option content
|
|
31
|
-
* @slot - The default slot for listbox option content
|
|
32
|
-
* @csspart content - Wraps the listbox option content
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
class ListboxOption$1 extends FoundationElement {
|
|
37
|
-
constructor(text, value, defaultSelected, selected) {
|
|
38
|
-
super();
|
|
39
|
-
/**
|
|
40
|
-
* The defaultSelected state of the option.
|
|
41
|
-
* @public
|
|
42
|
-
*/
|
|
43
|
-
this.defaultSelected = false;
|
|
44
|
-
/**
|
|
45
|
-
* Tracks whether the "selected" property has been changed.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
this.dirtySelected = false;
|
|
49
|
-
/**
|
|
50
|
-
* The checked state of the control.
|
|
51
|
-
*
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
this.selected = this.defaultSelected;
|
|
55
|
-
/**
|
|
56
|
-
* Track whether the value has been changed from the initial value
|
|
57
|
-
*/
|
|
58
|
-
this.dirtyValue = false;
|
|
59
|
-
if (text) {
|
|
60
|
-
this.textContent = text;
|
|
61
|
-
}
|
|
62
|
-
if (value) {
|
|
63
|
-
this.initialValue = value;
|
|
64
|
-
}
|
|
65
|
-
if (defaultSelected) {
|
|
66
|
-
this.defaultSelected = defaultSelected;
|
|
67
|
-
}
|
|
68
|
-
if (selected) {
|
|
69
|
-
this.selected = selected;
|
|
70
|
-
}
|
|
71
|
-
this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
|
|
72
|
-
this.proxy.disabled = this.disabled;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Updates the ariaChecked property when the checked property changes.
|
|
76
|
-
*
|
|
77
|
-
* @param prev - the previous checked value
|
|
78
|
-
* @param next - the current checked value
|
|
79
|
-
*
|
|
80
|
-
* @public
|
|
81
|
-
*/
|
|
82
|
-
checkedChanged(prev, next) {
|
|
83
|
-
if (typeof next === "boolean") {
|
|
84
|
-
this.ariaChecked = next ? "true" : "false";
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
this.ariaChecked = null;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Updates the proxy's text content when the default slot changes.
|
|
91
|
-
* @param prev - the previous content value
|
|
92
|
-
* @param next - the current content value
|
|
93
|
-
*
|
|
94
|
-
* @internal
|
|
95
|
-
*/
|
|
96
|
-
contentChanged(prev, next) {
|
|
97
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
98
|
-
this.proxy.textContent = this.textContent;
|
|
99
|
-
}
|
|
100
|
-
this.$emit("contentchange", null, { bubbles: true });
|
|
101
|
-
}
|
|
102
|
-
defaultSelectedChanged() {
|
|
103
|
-
if (!this.dirtySelected) {
|
|
104
|
-
this.selected = this.defaultSelected;
|
|
105
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
106
|
-
this.proxy.selected = this.defaultSelected;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
disabledChanged(prev, next) {
|
|
111
|
-
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
112
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
113
|
-
this.proxy.disabled = this.disabled;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
selectedAttributeChanged() {
|
|
117
|
-
this.defaultSelected = this.selectedAttribute;
|
|
118
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
119
|
-
this.proxy.defaultSelected = this.defaultSelected;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
selectedChanged() {
|
|
123
|
-
this.ariaSelected = this.selected ? "true" : "false";
|
|
124
|
-
if (!this.dirtySelected) {
|
|
125
|
-
this.dirtySelected = true;
|
|
126
|
-
}
|
|
127
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
128
|
-
this.proxy.selected = this.selected;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
initialValueChanged(previous, next) {
|
|
132
|
-
// If the value is clean and the component is connected to the DOM
|
|
133
|
-
// then set value equal to the attribute value.
|
|
134
|
-
if (!this.dirtyValue) {
|
|
135
|
-
this.value = this.initialValue;
|
|
136
|
-
this.dirtyValue = false;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
get label() {
|
|
140
|
-
var _a;
|
|
141
|
-
return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
|
|
142
|
-
}
|
|
143
|
-
get text() {
|
|
144
|
-
var _a, _b;
|
|
145
|
-
return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
|
|
146
|
-
}
|
|
147
|
-
set value(next) {
|
|
148
|
-
const newValue = `${next !== null && next !== void 0 ? next : ""}`;
|
|
149
|
-
this._value = newValue;
|
|
150
|
-
this.dirtyValue = true;
|
|
151
|
-
if (this.proxy instanceof HTMLOptionElement) {
|
|
152
|
-
this.proxy.value = newValue;
|
|
153
|
-
}
|
|
154
|
-
Observable.notify(this, "value");
|
|
155
|
-
}
|
|
156
|
-
get value() {
|
|
157
|
-
var _a;
|
|
158
|
-
Observable.track(this, "value");
|
|
159
|
-
return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
|
|
160
|
-
}
|
|
161
|
-
get form() {
|
|
162
|
-
return this.proxy ? this.proxy.form : null;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
__decorate([
|
|
166
|
-
observable
|
|
167
|
-
], ListboxOption$1.prototype, "checked", void 0);
|
|
168
|
-
__decorate([
|
|
169
|
-
observable
|
|
170
|
-
], ListboxOption$1.prototype, "content", void 0);
|
|
171
|
-
__decorate([
|
|
172
|
-
observable
|
|
173
|
-
], ListboxOption$1.prototype, "defaultSelected", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
attr({ mode: "boolean" })
|
|
176
|
-
], ListboxOption$1.prototype, "disabled", void 0);
|
|
177
|
-
__decorate([
|
|
178
|
-
attr({ attribute: "selected", mode: "boolean" })
|
|
179
|
-
], ListboxOption$1.prototype, "selectedAttribute", void 0);
|
|
180
|
-
__decorate([
|
|
181
|
-
observable
|
|
182
|
-
], ListboxOption$1.prototype, "selected", void 0);
|
|
183
|
-
__decorate([
|
|
184
|
-
attr({ attribute: "value", mode: "fromView" })
|
|
185
|
-
], ListboxOption$1.prototype, "initialValue", void 0);
|
|
186
|
-
/**
|
|
187
|
-
* States and properties relating to the ARIA `option` role.
|
|
188
|
-
*
|
|
189
|
-
* @public
|
|
190
|
-
*/
|
|
191
|
-
class DelegatesARIAListboxOption {
|
|
192
|
-
}
|
|
193
|
-
__decorate([
|
|
194
|
-
observable
|
|
195
|
-
], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
|
|
196
|
-
__decorate([
|
|
197
|
-
observable
|
|
198
|
-
], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
|
|
199
|
-
__decorate([
|
|
200
|
-
observable
|
|
201
|
-
], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
observable
|
|
204
|
-
], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
|
|
205
|
-
applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
|
|
206
|
-
applyMixins(ListboxOption$1, StartEnd, DelegatesARIAListboxOption);
|
|
5
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 05 Jan 2023 11:33:10 GMT\n */\n.base {\n z-index: 1;\n block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n font: var(--vvd-typography-heading-4);\n inline-size: 100%;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n\n.app-content {\n --vvd-header-block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}";
|
|
207
6
|
|
|
208
|
-
class
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
var _a;
|
|
214
|
-
return (_a = this._text) !== null && _a !== void 0 ? _a : '';
|
|
7
|
+
class Header extends FoundationElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.elevationShadow = false;
|
|
11
|
+
this.alternate = false;
|
|
215
12
|
}
|
|
216
13
|
}
|
|
217
14
|
__decorate([attr({
|
|
218
|
-
attribute: '
|
|
219
|
-
|
|
220
|
-
|
|
15
|
+
attribute: 'elevation-shadow',
|
|
16
|
+
mode: 'boolean'
|
|
17
|
+
}), __metadata("design:type", Object)], Header.prototype, "elevationShadow", void 0);
|
|
18
|
+
__decorate([attr({
|
|
19
|
+
mode: 'boolean'
|
|
20
|
+
}), __metadata("design:type", Object)], Header.prototype, "alternate", void 0);
|
|
221
21
|
|
|
222
22
|
let _ = t => t,
|
|
223
|
-
_t
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
checked
|
|
230
|
-
}) => classNames('base', ['disabled', disabled], ['selected', Boolean(selected)], ['active', Boolean(checked)], ['icon', Boolean(icon)]);
|
|
231
|
-
const ListboxOptionTemplate = context => {
|
|
232
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
233
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
23
|
+
_t;
|
|
24
|
+
const getPartAlternate = ({
|
|
25
|
+
alternate
|
|
26
|
+
}) => classNames(['vvd-theme-alternate', Boolean(alternate)]);
|
|
27
|
+
const headerTemplate = context => {
|
|
28
|
+
const elevationTag = context.tagFor(Elevation);
|
|
234
29
|
return html(_t || (_t = _`
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
30
|
+
<${0} dp="4" ?no-shadow=${0}>
|
|
31
|
+
<header class="base" part="base">
|
|
32
|
+
<!-- a container is needed to distinguish the surface background color of the
|
|
33
|
+
element from its shadow when applying elevation with alternate -->
|
|
34
|
+
<div class="container" part="${0}">
|
|
35
|
+
<section class="header-content">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</section>
|
|
38
|
+
<section class="header-content">
|
|
39
|
+
<slot name="action-items"></slot>
|
|
40
|
+
</section>
|
|
41
|
+
</div>
|
|
42
|
+
</header>
|
|
43
|
+
</${0}>
|
|
44
|
+
<div class="app-content">
|
|
45
|
+
<slot name="app-content"></slot>
|
|
46
|
+
</div>
|
|
47
|
+
`), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
|
|
249
48
|
};
|
|
250
49
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
baseName: 'option',
|
|
255
|
-
template: ListboxOptionTemplate,
|
|
50
|
+
const headerDefinition = Header.compose({
|
|
51
|
+
baseName: 'header',
|
|
52
|
+
template: headerTemplate,
|
|
256
53
|
styles: css_248z
|
|
257
54
|
});
|
|
258
|
-
const
|
|
259
|
-
const
|
|
55
|
+
const headerRegistries = [headerDefinition(), ...elevationRegistries];
|
|
56
|
+
const registerHeader = registerFactory(headerRegistries);
|
|
260
57
|
|
|
261
|
-
export {
|
|
58
|
+
export { headerRegistries as a, headerDefinition as h, registerHeader as r };
|