@vonage/vivid 4.12.1 → 4.13.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 +1388 -128
- package/lib/file-picker/file-picker.d.ts +6 -0
- package/lib/menu/menu.d.ts +16 -3
- package/lib/menu-item/menu-item.d.ts +10 -2
- package/lib/option/option.d.ts +27 -7
- package/lib/switch/switch.d.ts +5 -2
- package/lib/switch/switch.form-associated.d.ts +10 -0
- package/lib/tabs/tabs.d.ts +3 -2
- package/lib/text-area/text-area.d.ts +25 -3
- package/lib/text-area/text-field.form-associated.d.ts +10 -0
- package/lib/text-field/text-field.d.ts +28 -3
- package/lib/text-field/text-field.form-associated.d.ts +10 -0
- package/package.json +1 -1
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition17.cjs +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition20.cjs +2 -1
- package/shared/definition20.js +2 -1
- package/shared/definition21.cjs +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition24.cjs +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.cjs +24 -3
- package/shared/definition25.js +24 -3
- package/shared/definition29.cjs +358 -559
- package/shared/definition29.js +359 -560
- package/shared/definition30.cjs +2 -0
- package/shared/definition30.js +2 -0
- package/shared/definition35.cjs +222 -2
- package/shared/definition35.js +222 -2
- package/shared/definition36.cjs +149 -14
- package/shared/definition36.js +150 -15
- package/shared/definition46.cjs +1 -1
- package/shared/definition46.js +1 -1
- package/shared/definition47.cjs +5 -14
- package/shared/definition47.js +1 -10
- package/shared/definition49.cjs +65 -90
- package/shared/definition49.js +66 -91
- package/shared/definition51.cjs +1 -1
- package/shared/definition51.js +1 -1
- package/shared/definition52.cjs +15 -1
- package/shared/definition52.js +15 -1
- package/shared/definition55.cjs +160 -180
- package/shared/definition55.js +160 -180
- package/shared/definition56.cjs +3 -307
- package/shared/definition56.js +5 -309
- package/shared/definition57.cjs +8 -7
- package/shared/definition57.js +3 -2
- package/shared/definition64.cjs +18 -7
- package/shared/definition64.js +19 -8
- package/shared/listbox.cjs +198 -3
- package/shared/listbox.js +197 -2
- package/shared/{direction.cjs → localization.cjs} +12 -3
- package/shared/{direction.js → localization.js} +12 -3
- package/shared/presentationDate.cjs +8 -8
- package/shared/presentationDate.js +1 -1
- package/shared/text-field2.cjs +538 -194
- package/shared/text-field2.js +539 -195
- package/styles/core/all.css +21 -1
- package/styles/core/theme.css +21 -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/vivid.api.json +44 -0
- package/shared/Reflector.cjs +0 -71
- package/shared/Reflector.js +0 -69
- package/shared/listbox-option.cjs +0 -204
- package/shared/listbox-option.js +0 -201
package/shared/definition36.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
const definition = require('./definition27.cjs');
|
|
5
5
|
const affix = require('./affix.cjs');
|
|
6
|
-
const
|
|
6
|
+
const ariaGlobal = require('./aria-global2.cjs');
|
|
7
7
|
const applyMixins = require('./apply-mixins.cjs');
|
|
8
8
|
const icon = require('./icon.cjs');
|
|
9
9
|
const when = require('./when.cjs');
|
|
@@ -18,19 +18,93 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
18
18
|
if (result) __defProp(target, key, result);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
class ListboxOption extends
|
|
22
|
-
constructor() {
|
|
23
|
-
super(
|
|
21
|
+
class ListboxOption extends index.FoundationElement {
|
|
22
|
+
constructor(text, value, defaultSelected, selected) {
|
|
23
|
+
super();
|
|
24
|
+
this.defaultSelected = false;
|
|
25
|
+
/**
|
|
26
|
+
* Tracks whether the "selected" property has been changed.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
this.dirtySelected = false;
|
|
30
|
+
this.selected = this.defaultSelected;
|
|
31
|
+
/**
|
|
32
|
+
* Track whether the value has been changed from the initial value
|
|
33
|
+
*/
|
|
34
|
+
this.dirtyValue = false;
|
|
24
35
|
this._highlighted = false;
|
|
25
36
|
this._displayCheckmark = false;
|
|
26
37
|
this._matchedRange = null;
|
|
38
|
+
if (text) {
|
|
39
|
+
this.text = text;
|
|
40
|
+
}
|
|
41
|
+
if (value) {
|
|
42
|
+
this.initialValue = value;
|
|
43
|
+
}
|
|
44
|
+
if (defaultSelected) {
|
|
45
|
+
this.defaultSelected = defaultSelected;
|
|
46
|
+
}
|
|
47
|
+
if (selected) {
|
|
48
|
+
this.selected = selected;
|
|
49
|
+
}
|
|
50
|
+
this.proxy = new Option(
|
|
51
|
+
this.text,
|
|
52
|
+
// @ts-expect-error Propery is used before it is assigned
|
|
53
|
+
this.initialValue,
|
|
54
|
+
this.defaultSelected,
|
|
55
|
+
this.selected
|
|
56
|
+
);
|
|
57
|
+
this.proxy.disabled = this.disabled;
|
|
27
58
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Updates the ariaChecked property when the checked property changes.
|
|
61
|
+
*
|
|
62
|
+
* @param _ - the previous checked value
|
|
63
|
+
* @param next - the current checked value
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
checkedChanged(_, next) {
|
|
68
|
+
if (typeof next === "boolean") {
|
|
69
|
+
this.ariaChecked = next ? "true" : "false";
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.ariaChecked = null;
|
|
31
73
|
}
|
|
32
|
-
|
|
33
|
-
|
|
74
|
+
defaultSelectedChanged() {
|
|
75
|
+
if (!this.dirtySelected) {
|
|
76
|
+
this.selected = this.defaultSelected;
|
|
77
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
78
|
+
this.proxy.selected = this.defaultSelected;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
disabledChanged() {
|
|
83
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
84
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
85
|
+
this.proxy.disabled = this.disabled;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
selectedAttributeChanged() {
|
|
89
|
+
this.defaultSelected = this.selectedAttribute;
|
|
90
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
91
|
+
this.proxy.defaultSelected = this.defaultSelected;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
selectedChanged() {
|
|
95
|
+
this.ariaSelected = this.selected ? "true" : "false";
|
|
96
|
+
if (!this.dirtySelected) {
|
|
97
|
+
this.dirtySelected = true;
|
|
98
|
+
}
|
|
99
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
100
|
+
this.proxy.selected = this.selected;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
initialValueChanged() {
|
|
104
|
+
if (!this.dirtyValue) {
|
|
105
|
+
this.value = this.initialValue;
|
|
106
|
+
this.dirtyValue = false;
|
|
107
|
+
}
|
|
34
108
|
}
|
|
35
109
|
get label() {
|
|
36
110
|
return this._label ?? this.text;
|
|
@@ -38,6 +112,28 @@ class ListboxOption extends listboxOption.ListboxOption {
|
|
|
38
112
|
set label(value) {
|
|
39
113
|
this._label = value;
|
|
40
114
|
}
|
|
115
|
+
set text(value) {
|
|
116
|
+
this._text = value;
|
|
117
|
+
}
|
|
118
|
+
get text() {
|
|
119
|
+
return this._text ?? "";
|
|
120
|
+
}
|
|
121
|
+
set value(next) {
|
|
122
|
+
const newValue = `${next ?? ""}`;
|
|
123
|
+
this._value = newValue;
|
|
124
|
+
this.dirtyValue = true;
|
|
125
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
126
|
+
this.proxy.value = newValue;
|
|
127
|
+
}
|
|
128
|
+
index.Observable.notify(this, "value");
|
|
129
|
+
}
|
|
130
|
+
get value() {
|
|
131
|
+
index.Observable.track(this, "value");
|
|
132
|
+
return this._value ?? this.text;
|
|
133
|
+
}
|
|
134
|
+
get form() {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
41
137
|
/**
|
|
42
138
|
* @internal
|
|
43
139
|
*/
|
|
@@ -46,15 +142,35 @@ class ListboxOption extends listboxOption.ListboxOption {
|
|
|
46
142
|
}
|
|
47
143
|
}
|
|
48
144
|
__decorateClass([
|
|
49
|
-
index.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
145
|
+
index.observable
|
|
146
|
+
], ListboxOption.prototype, "checked");
|
|
147
|
+
__decorateClass([
|
|
148
|
+
index.observable
|
|
149
|
+
], ListboxOption.prototype, "defaultSelected");
|
|
150
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
151
|
+
__decorateClass([
|
|
152
|
+
index.attr({ mode: "boolean" })
|
|
153
|
+
], ListboxOption.prototype, "disabled");
|
|
154
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
155
|
+
__decorateClass([
|
|
156
|
+
index.attr({ attribute: "selected", mode: "boolean" })
|
|
157
|
+
], ListboxOption.prototype, "selectedAttribute");
|
|
158
|
+
__decorateClass([
|
|
159
|
+
index.observable
|
|
160
|
+
], ListboxOption.prototype, "selected");
|
|
161
|
+
__decorateClass([
|
|
162
|
+
index.attr({ attribute: "value", mode: "fromView" })
|
|
163
|
+
], ListboxOption.prototype, "initialValue");
|
|
53
164
|
__decorateClass([
|
|
54
165
|
index.attr({
|
|
55
166
|
attribute: "label"
|
|
56
167
|
})
|
|
57
168
|
], ListboxOption.prototype, "_label");
|
|
169
|
+
__decorateClass([
|
|
170
|
+
index.attr({
|
|
171
|
+
attribute: "text"
|
|
172
|
+
})
|
|
173
|
+
], ListboxOption.prototype, "_text");
|
|
58
174
|
__decorateClass([
|
|
59
175
|
index.observable
|
|
60
176
|
], ListboxOption.prototype, "_highlighted");
|
|
@@ -64,7 +180,26 @@ __decorateClass([
|
|
|
64
180
|
__decorateClass([
|
|
65
181
|
index.observable
|
|
66
182
|
], ListboxOption.prototype, "_matchedRange");
|
|
67
|
-
|
|
183
|
+
class DelegatesARIAListboxOption {
|
|
184
|
+
}
|
|
185
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
186
|
+
__decorateClass([
|
|
187
|
+
index.observable
|
|
188
|
+
], DelegatesARIAListboxOption.prototype, "ariaChecked");
|
|
189
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
190
|
+
__decorateClass([
|
|
191
|
+
index.observable
|
|
192
|
+
], DelegatesARIAListboxOption.prototype, "ariaPosInSet");
|
|
193
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
194
|
+
__decorateClass([
|
|
195
|
+
index.observable
|
|
196
|
+
], DelegatesARIAListboxOption.prototype, "ariaSelected");
|
|
197
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
198
|
+
__decorateClass([
|
|
199
|
+
index.observable
|
|
200
|
+
], DelegatesARIAListboxOption.prototype, "ariaSetSize");
|
|
201
|
+
applyMixins.applyMixins(DelegatesARIAListboxOption, ariaGlobal.ARIAGlobalStatesAndProperties);
|
|
202
|
+
applyMixins.applyMixins(ListboxOption, affix.AffixIconWithTrailing, DelegatesARIAListboxOption);
|
|
68
203
|
|
|
69
204
|
const getClasses = (x) => classNames.classNames(
|
|
70
205
|
"base",
|
package/shared/definition36.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FoundationElement, O as Observable, o as observable, a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { a as iconRegistries } from './definition27.js';
|
|
3
3
|
import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
|
-
import {
|
|
4
|
+
import { A as ARIAGlobalStatesAndProperties } from './aria-global2.js';
|
|
5
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
6
6
|
import { I as Icon } from './icon.js';
|
|
7
7
|
import { w as when } from './when.js';
|
|
@@ -16,19 +16,93 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
16
|
if (result) __defProp(target, key, result);
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
-
class ListboxOption extends
|
|
20
|
-
constructor() {
|
|
21
|
-
super(
|
|
19
|
+
class ListboxOption extends FoundationElement {
|
|
20
|
+
constructor(text, value, defaultSelected, selected) {
|
|
21
|
+
super();
|
|
22
|
+
this.defaultSelected = false;
|
|
23
|
+
/**
|
|
24
|
+
* Tracks whether the "selected" property has been changed.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
this.dirtySelected = false;
|
|
28
|
+
this.selected = this.defaultSelected;
|
|
29
|
+
/**
|
|
30
|
+
* Track whether the value has been changed from the initial value
|
|
31
|
+
*/
|
|
32
|
+
this.dirtyValue = false;
|
|
22
33
|
this._highlighted = false;
|
|
23
34
|
this._displayCheckmark = false;
|
|
24
35
|
this._matchedRange = null;
|
|
36
|
+
if (text) {
|
|
37
|
+
this.text = text;
|
|
38
|
+
}
|
|
39
|
+
if (value) {
|
|
40
|
+
this.initialValue = value;
|
|
41
|
+
}
|
|
42
|
+
if (defaultSelected) {
|
|
43
|
+
this.defaultSelected = defaultSelected;
|
|
44
|
+
}
|
|
45
|
+
if (selected) {
|
|
46
|
+
this.selected = selected;
|
|
47
|
+
}
|
|
48
|
+
this.proxy = new Option(
|
|
49
|
+
this.text,
|
|
50
|
+
// @ts-expect-error Propery is used before it is assigned
|
|
51
|
+
this.initialValue,
|
|
52
|
+
this.defaultSelected,
|
|
53
|
+
this.selected
|
|
54
|
+
);
|
|
55
|
+
this.proxy.disabled = this.disabled;
|
|
25
56
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Updates the ariaChecked property when the checked property changes.
|
|
59
|
+
*
|
|
60
|
+
* @param _ - the previous checked value
|
|
61
|
+
* @param next - the current checked value
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
checkedChanged(_, next) {
|
|
66
|
+
if (typeof next === "boolean") {
|
|
67
|
+
this.ariaChecked = next ? "true" : "false";
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.ariaChecked = null;
|
|
29
71
|
}
|
|
30
|
-
|
|
31
|
-
|
|
72
|
+
defaultSelectedChanged() {
|
|
73
|
+
if (!this.dirtySelected) {
|
|
74
|
+
this.selected = this.defaultSelected;
|
|
75
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
76
|
+
this.proxy.selected = this.defaultSelected;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
disabledChanged() {
|
|
81
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
82
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
83
|
+
this.proxy.disabled = this.disabled;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
selectedAttributeChanged() {
|
|
87
|
+
this.defaultSelected = this.selectedAttribute;
|
|
88
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
89
|
+
this.proxy.defaultSelected = this.defaultSelected;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
selectedChanged() {
|
|
93
|
+
this.ariaSelected = this.selected ? "true" : "false";
|
|
94
|
+
if (!this.dirtySelected) {
|
|
95
|
+
this.dirtySelected = true;
|
|
96
|
+
}
|
|
97
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
98
|
+
this.proxy.selected = this.selected;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
initialValueChanged() {
|
|
102
|
+
if (!this.dirtyValue) {
|
|
103
|
+
this.value = this.initialValue;
|
|
104
|
+
this.dirtyValue = false;
|
|
105
|
+
}
|
|
32
106
|
}
|
|
33
107
|
get label() {
|
|
34
108
|
return this._label ?? this.text;
|
|
@@ -36,6 +110,28 @@ class ListboxOption extends ListboxOption$1 {
|
|
|
36
110
|
set label(value) {
|
|
37
111
|
this._label = value;
|
|
38
112
|
}
|
|
113
|
+
set text(value) {
|
|
114
|
+
this._text = value;
|
|
115
|
+
}
|
|
116
|
+
get text() {
|
|
117
|
+
return this._text ?? "";
|
|
118
|
+
}
|
|
119
|
+
set value(next) {
|
|
120
|
+
const newValue = `${next ?? ""}`;
|
|
121
|
+
this._value = newValue;
|
|
122
|
+
this.dirtyValue = true;
|
|
123
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
124
|
+
this.proxy.value = newValue;
|
|
125
|
+
}
|
|
126
|
+
Observable.notify(this, "value");
|
|
127
|
+
}
|
|
128
|
+
get value() {
|
|
129
|
+
Observable.track(this, "value");
|
|
130
|
+
return this._value ?? this.text;
|
|
131
|
+
}
|
|
132
|
+
get form() {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
39
135
|
/**
|
|
40
136
|
* @internal
|
|
41
137
|
*/
|
|
@@ -44,15 +140,35 @@ class ListboxOption extends ListboxOption$1 {
|
|
|
44
140
|
}
|
|
45
141
|
}
|
|
46
142
|
__decorateClass([
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
143
|
+
observable
|
|
144
|
+
], ListboxOption.prototype, "checked");
|
|
145
|
+
__decorateClass([
|
|
146
|
+
observable
|
|
147
|
+
], ListboxOption.prototype, "defaultSelected");
|
|
148
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
149
|
+
__decorateClass([
|
|
150
|
+
attr({ mode: "boolean" })
|
|
151
|
+
], ListboxOption.prototype, "disabled");
|
|
152
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
153
|
+
__decorateClass([
|
|
154
|
+
attr({ attribute: "selected", mode: "boolean" })
|
|
155
|
+
], ListboxOption.prototype, "selectedAttribute");
|
|
156
|
+
__decorateClass([
|
|
157
|
+
observable
|
|
158
|
+
], ListboxOption.prototype, "selected");
|
|
159
|
+
__decorateClass([
|
|
160
|
+
attr({ attribute: "value", mode: "fromView" })
|
|
161
|
+
], ListboxOption.prototype, "initialValue");
|
|
51
162
|
__decorateClass([
|
|
52
163
|
attr({
|
|
53
164
|
attribute: "label"
|
|
54
165
|
})
|
|
55
166
|
], ListboxOption.prototype, "_label");
|
|
167
|
+
__decorateClass([
|
|
168
|
+
attr({
|
|
169
|
+
attribute: "text"
|
|
170
|
+
})
|
|
171
|
+
], ListboxOption.prototype, "_text");
|
|
56
172
|
__decorateClass([
|
|
57
173
|
observable
|
|
58
174
|
], ListboxOption.prototype, "_highlighted");
|
|
@@ -62,7 +178,26 @@ __decorateClass([
|
|
|
62
178
|
__decorateClass([
|
|
63
179
|
observable
|
|
64
180
|
], ListboxOption.prototype, "_matchedRange");
|
|
65
|
-
|
|
181
|
+
class DelegatesARIAListboxOption {
|
|
182
|
+
}
|
|
183
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
184
|
+
__decorateClass([
|
|
185
|
+
observable
|
|
186
|
+
], DelegatesARIAListboxOption.prototype, "ariaChecked");
|
|
187
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
188
|
+
__decorateClass([
|
|
189
|
+
observable
|
|
190
|
+
], DelegatesARIAListboxOption.prototype, "ariaPosInSet");
|
|
191
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
192
|
+
__decorateClass([
|
|
193
|
+
observable
|
|
194
|
+
], DelegatesARIAListboxOption.prototype, "ariaSelected");
|
|
195
|
+
// @ts-expect-error Type is incorrectly non-optional
|
|
196
|
+
__decorateClass([
|
|
197
|
+
observable
|
|
198
|
+
], DelegatesARIAListboxOption.prototype, "ariaSetSize");
|
|
199
|
+
applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
|
|
200
|
+
applyMixins(ListboxOption, AffixIconWithTrailing, DelegatesARIAListboxOption);
|
|
66
201
|
|
|
67
202
|
const getClasses = (x) => classNames(
|
|
68
203
|
"base",
|
package/shared/definition46.cjs
CHANGED
|
@@ -80,7 +80,7 @@ __decorateClass([
|
|
|
80
80
|
})
|
|
81
81
|
], SideDrawer.prototype, "trailing");
|
|
82
82
|
|
|
83
|
-
const styles = ":host{display:block}.side-drawer-app-content{block-size:100%}.control{position:fixed;z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset, 280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset, 280px)}@media (prefers-reduced-motion: no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}";
|
|
83
|
+
const styles = ":host{display:block}.side-drawer-app-content{block-size:100%}.control{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.control{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.control ::-webkit-scrollbar{width:4px}.control ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-thumb-color)}.control{position:fixed;z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset, 280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset, 280px)}@media (prefers-reduced-motion: no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}";
|
|
84
84
|
|
|
85
85
|
const getClasses = ({ modal, open, trailing }) => classNames.classNames(
|
|
86
86
|
"control",
|
package/shared/definition46.js
CHANGED
|
@@ -78,7 +78,7 @@ __decorateClass([
|
|
|
78
78
|
})
|
|
79
79
|
], SideDrawer.prototype, "trailing");
|
|
80
80
|
|
|
81
|
-
const styles = ":host{display:block}.side-drawer-app-content{block-size:100%}.control{position:fixed;z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset, 280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset, 280px)}@media (prefers-reduced-motion: no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}";
|
|
81
|
+
const styles = ":host{display:block}.side-drawer-app-content{block-size:100%}.control{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.control{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.control ::-webkit-scrollbar{width:4px}.control ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-thumb-color)}.control{position:fixed;z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset, 280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset, 280px)}@media (prefers-reduced-motion: no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}";
|
|
82
82
|
|
|
83
83
|
const getClasses = ({ modal, open, trailing }) => classNames(
|
|
84
84
|
"control",
|
package/shared/definition47.cjs
CHANGED
|
@@ -5,21 +5,12 @@ const definition = require('./definition64.cjs');
|
|
|
5
5
|
const keyCodes = require('./key-codes.cjs');
|
|
6
6
|
const slider_template = require('./slider.template.cjs');
|
|
7
7
|
const formAssociated = require('./form-associated.cjs');
|
|
8
|
+
const localization = require('./localization.cjs');
|
|
8
9
|
const aria = require('./aria.cjs');
|
|
9
|
-
const direction = require('./direction.cjs');
|
|
10
10
|
const numbers = require('./numbers.cjs');
|
|
11
11
|
const applyMixins = require('./apply-mixins.cjs');
|
|
12
12
|
const localized = require('./localized.cjs');
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Expose ltr and rtl strings
|
|
16
|
-
*/
|
|
17
|
-
var Direction;
|
|
18
|
-
(function (Direction) {
|
|
19
|
-
Direction["ltr"] = "ltr";
|
|
20
|
-
Direction["rtl"] = "rtl";
|
|
21
|
-
})(Direction || (Direction = {}));
|
|
22
|
-
|
|
23
14
|
const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
24
15
|
|
|
25
16
|
class _Slider extends index.FoundationElement {
|
|
@@ -47,7 +38,7 @@ const SliderMode = {
|
|
|
47
38
|
class Slider extends FormAssociatedSlider {
|
|
48
39
|
constructor() {
|
|
49
40
|
super(...arguments);
|
|
50
|
-
this.direction = Direction.ltr;
|
|
41
|
+
this.direction = localization.Direction.ltr;
|
|
51
42
|
this.isDragging = false;
|
|
52
43
|
this.trackWidth = 0;
|
|
53
44
|
this.trackMinWidth = 0;
|
|
@@ -308,7 +299,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
308
299
|
connectedCallback() {
|
|
309
300
|
super.connectedCallback();
|
|
310
301
|
this.proxy.setAttribute("type", "range");
|
|
311
|
-
this.direction =
|
|
302
|
+
this.direction = localization.getDirection(this);
|
|
312
303
|
this.updateStepMultiplier();
|
|
313
304
|
this.setupTrackConstraints();
|
|
314
305
|
this.setupListeners();
|
|
@@ -329,7 +320,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
329
320
|
* @public
|
|
330
321
|
*/
|
|
331
322
|
increment() {
|
|
332
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== aria.Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step);
|
|
323
|
+
const newVal = this.direction !== localization.Direction.rtl && this.orientation !== aria.Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step);
|
|
333
324
|
this.value = this.#roundToNearestStep(newVal).toString();
|
|
334
325
|
}
|
|
335
326
|
/**
|
|
@@ -338,7 +329,7 @@ class Slider extends FormAssociatedSlider {
|
|
|
338
329
|
* @public
|
|
339
330
|
*/
|
|
340
331
|
decrement() {
|
|
341
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== aria.Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step);
|
|
332
|
+
const newVal = this.direction !== localization.Direction.rtl && this.orientation !== aria.Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step);
|
|
342
333
|
this.value = this.#roundToNearestStep(newVal).toString();
|
|
343
334
|
}
|
|
344
335
|
/**
|
package/shared/definition47.js
CHANGED
|
@@ -3,21 +3,12 @@ import { p as popupRegistries } from './definition64.js';
|
|
|
3
3
|
import { b as keyHome, a as keyEnd, c as keyArrowDown, e as keyArrowLeft, d as keyArrowUp, f as keyArrowRight } from './key-codes.js';
|
|
4
4
|
import { i as inverseLerp, l as lerp, r as roundToStepValue, S as SliderTemplate } from './slider.template.js';
|
|
5
5
|
import { F as FormAssociated } from './form-associated.js';
|
|
6
|
+
import { D as Direction, g as getDirection } from './localization.js';
|
|
6
7
|
import { O as Orientation } from './aria.js';
|
|
7
|
-
import { g as getDirection } from './direction.js';
|
|
8
8
|
import { l as limit } from './numbers.js';
|
|
9
9
|
import { a as applyMixins } from './apply-mixins.js';
|
|
10
10
|
import { L as Localized } from './localized.js';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Expose ltr and rtl strings
|
|
14
|
-
*/
|
|
15
|
-
var Direction;
|
|
16
|
-
(function (Direction) {
|
|
17
|
-
Direction["ltr"] = "ltr";
|
|
18
|
-
Direction["rtl"] = "rtl";
|
|
19
|
-
})(Direction || (Direction = {}));
|
|
20
|
-
|
|
21
12
|
const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
22
13
|
|
|
23
14
|
class _Slider extends FoundationElement {
|