@vonage/vivid 3.31.0 → 3.32.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/alert/index.js +2 -1
- package/checkbox/index.js +2 -1
- package/combobox/index.js +2 -1
- package/custom-elements.json +748 -11
- package/date-picker/index.js +35 -0
- package/dialog/index.js +1 -1
- package/divider/index.js +1 -1
- package/empty-state/index.js +1 -1
- package/fab/index.js +1 -1
- package/file-picker/index.js +3 -2
- package/header/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +48 -46
- package/layout/index.js +1 -1
- package/lib/button/button.d.ts +2 -0
- package/lib/components.d.ts +20 -19
- package/lib/date-picker/calendar/calendarGrid.d.ts +17 -0
- package/lib/date-picker/calendar/dateStr.d.ts +6 -0
- package/lib/date-picker/calendar/month.d.ts +11 -0
- package/lib/date-picker/calendar/monthPickerGrid.d.ts +10 -0
- package/lib/date-picker/calendar/presentationDate.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +16 -0
- package/lib/date-picker/date-picker.template.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +3 -0
- package/lib/date-picker/index.d.ts +1 -0
- package/lib/date-picker/locale.d.ts +21 -0
- package/lib/select/select.d.ts +4 -2
- package/listbox/index.js +3 -2
- package/locales/en-GB.d.ts +3 -0
- package/locales/en-GB.js +25 -0
- package/locales/en-US.d.ts +3 -0
- package/locales/en-US.js +25 -0
- package/locales/ja-JP.d.ts +3 -0
- package/locales/ja-JP.js +25 -0
- package/locales/zh-CN.d.ts +3 -0
- package/locales/zh-CN.js +25 -0
- package/menu/index.js +2 -2
- 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 +3 -2
- package/number-field/index.js +4 -3
- package/option/index.js +2 -1
- package/package.json +2 -1
- package/pagination/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +3 -2
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.js +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +2 -2
- package/shared/definition19.js +2 -2
- package/shared/definition2.js +1 -1
- package/shared/definition21.js +3 -3
- package/shared/definition22.js +2 -2
- package/shared/definition23.js +5750 -189
- package/shared/definition24.js +116 -68
- package/shared/definition25.js +68 -38
- package/shared/definition26.js +222 -74
- package/shared/definition27.js +33 -2282
- package/shared/definition28.js +76 -47
- package/shared/definition29.js +2287 -38
- package/shared/definition30.js +39 -417
- package/shared/definition31.js +38 -364
- package/shared/definition32.js +427 -12
- package/shared/definition33.js +350 -59
- package/shared/definition34.js +12 -26
- package/shared/definition35.js +67 -31
- package/shared/definition36.js +20 -431
- package/shared/definition37.js +34 -194
- package/shared/definition38.js +427 -45
- package/shared/definition39.js +195 -33
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +53 -425
- package/shared/definition41.js +29 -645
- package/shared/definition42.js +420 -73
- package/shared/definition43.js +549 -444
- package/shared/definition44.js +68 -90
- package/shared/definition45.js +501 -79
- package/shared/definition46.js +84 -45
- package/shared/definition47.js +131 -17
- package/shared/definition48.js +44 -471
- package/shared/definition49.js +21 -108
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +487 -15
- package/shared/definition51.js +92 -255
- package/shared/definition52.js +16 -115
- package/shared/definition53.js +264 -115
- package/shared/definition54.js +91 -82
- package/shared/definition55.js +111 -65
- package/shared/definition56.js +64 -291
- package/shared/definition57.js +303 -0
- package/shared/definition6.js +2 -2
- package/shared/definition7.js +10 -3
- package/shared/definition9.js +1 -1
- package/shared/{form-elements.js → index2.js} +14 -2
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/localization/index.d.ts +7 -0
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/patterns/index.d.ts +1 -0
- package/shared/patterns/localized.d.ts +4 -0
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +25 -3
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +25 -3
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +2 -2
- package/switch/index.js +3 -2
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +3 -2
- package/text-field/index.js +3 -2
- package/toggletip/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +137 -0
package/shared/definition33.js
CHANGED
|
@@ -1,81 +1,372 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
1
|
+
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { i as iconRegistries } from './definition3.js';
|
|
3
3
|
import { f as focusRegistries } from './definition4.js';
|
|
4
4
|
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
+
import { S as StartEnd } from './start-end.js';
|
|
6
|
+
import { D as Direction, g as getDirection } from './direction.js';
|
|
5
7
|
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
-
import {
|
|
8
|
+
import { i as keyArrowLeft, h as keyArrowRight, e as keySpace, d as keyEnter } from './key-codes.js';
|
|
7
9
|
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
-
import { r as ref } from './ref.js';
|
|
9
10
|
import { w as when } from './when.js';
|
|
11
|
+
import { s as slotted } from './slotted.js';
|
|
12
|
+
import { c as classNames } from './class-names.js';
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Menu items roles.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
const MenuItemRole$1 = {
|
|
19
|
+
/**
|
|
20
|
+
* The menu item has a "menuitem" role
|
|
21
|
+
*/
|
|
22
|
+
menuitem: "menuitem",
|
|
23
|
+
/**
|
|
24
|
+
* The menu item has a "menuitemcheckbox" role
|
|
25
|
+
*/
|
|
26
|
+
menuitemcheckbox: "menuitemcheckbox",
|
|
27
|
+
/**
|
|
28
|
+
* The menu item has a "menuitemradio" role
|
|
29
|
+
*/
|
|
30
|
+
menuitemradio: "menuitemradio",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
const roleForMenuItem = {
|
|
36
|
+
[MenuItemRole$1.menuitem]: "menuitem",
|
|
37
|
+
[MenuItemRole$1.menuitemcheckbox]: "menuitemcheckbox",
|
|
38
|
+
[MenuItemRole$1.menuitemradio]: "menuitemradio",
|
|
39
|
+
};
|
|
12
40
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
/**
|
|
42
|
+
* A Switch Custom HTML Element.
|
|
43
|
+
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
|
|
44
|
+
*
|
|
45
|
+
* @slot checked-indicator - The checked indicator
|
|
46
|
+
* @slot radio-indicator - The radio indicator
|
|
47
|
+
* @slot start - Content which can be provided before the menu item content
|
|
48
|
+
* @slot end - Content which can be provided after the menu item content
|
|
49
|
+
* @slot - The default slot for menu item content
|
|
50
|
+
* @slot expand-collapse-indicator - The expand/collapse indicator
|
|
51
|
+
* @slot submenu - Used to nest menu's within menu items
|
|
52
|
+
* @csspart input-container - The element representing the visual checked or radio indicator
|
|
53
|
+
* @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
|
|
54
|
+
* @csspart radio - The element wrapping the `menuitemradio` indicator
|
|
55
|
+
* @csspart content - The element wrapping the menu item content
|
|
56
|
+
* @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
|
|
57
|
+
* @csspart expand-collapse - The expand/collapse element
|
|
58
|
+
* @csspart submenu-region - The container for the submenu, used for positioning
|
|
59
|
+
* @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
|
|
60
|
+
* @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
class MenuItem$1 extends FoundationElement {
|
|
65
|
+
constructor() {
|
|
66
|
+
super(...arguments);
|
|
67
|
+
/**
|
|
68
|
+
* The role of the element.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
* @remarks
|
|
72
|
+
* HTML Attribute: role
|
|
73
|
+
*/
|
|
74
|
+
this.role = MenuItemRole$1.menuitem;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
this.hasSubmenu = false;
|
|
79
|
+
/**
|
|
80
|
+
* Track current direction to pass to the anchored region
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
this.currentDirection = Direction.ltr;
|
|
85
|
+
this.focusSubmenuOnLoad = false;
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
this.handleMenuItemKeyDown = (e) => {
|
|
90
|
+
if (e.defaultPrevented) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
switch (e.key) {
|
|
94
|
+
case keyEnter:
|
|
95
|
+
case keySpace:
|
|
96
|
+
this.invoke();
|
|
97
|
+
return false;
|
|
98
|
+
case keyArrowRight:
|
|
99
|
+
//open/focus on submenu
|
|
100
|
+
this.expandAndFocus();
|
|
101
|
+
return false;
|
|
102
|
+
case keyArrowLeft:
|
|
103
|
+
//close submenu
|
|
104
|
+
if (this.expanded) {
|
|
105
|
+
this.expanded = false;
|
|
106
|
+
this.focus();
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
this.handleMenuItemClick = (e) => {
|
|
116
|
+
if (e.defaultPrevented || this.disabled) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
this.invoke();
|
|
120
|
+
return false;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
this.submenuLoaded = () => {
|
|
126
|
+
if (!this.focusSubmenuOnLoad) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
this.focusSubmenuOnLoad = false;
|
|
130
|
+
if (this.hasSubmenu) {
|
|
131
|
+
this.submenu.focus();
|
|
132
|
+
this.setAttribute("tabindex", "-1");
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
this.handleMouseOver = (e) => {
|
|
139
|
+
if (this.disabled || !this.hasSubmenu || this.expanded) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
this.expanded = true;
|
|
143
|
+
return false;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
this.handleMouseOut = (e) => {
|
|
149
|
+
if (!this.expanded || this.contains(document.activeElement)) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
this.expanded = false;
|
|
153
|
+
return false;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
this.expandAndFocus = () => {
|
|
159
|
+
if (!this.hasSubmenu) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.focusSubmenuOnLoad = true;
|
|
163
|
+
this.expanded = true;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
this.invoke = () => {
|
|
169
|
+
if (this.disabled) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
switch (this.role) {
|
|
173
|
+
case MenuItemRole$1.menuitemcheckbox:
|
|
174
|
+
this.checked = !this.checked;
|
|
175
|
+
break;
|
|
176
|
+
case MenuItemRole$1.menuitem:
|
|
177
|
+
// update submenu
|
|
178
|
+
this.updateSubmenu();
|
|
179
|
+
if (this.hasSubmenu) {
|
|
180
|
+
this.expandAndFocus();
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.$emit("change");
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case MenuItemRole$1.menuitemradio:
|
|
187
|
+
if (!this.checked) {
|
|
188
|
+
this.checked = true;
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Gets the submenu element if any
|
|
195
|
+
*
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
this.updateSubmenu = () => {
|
|
199
|
+
this.submenu = this.domChildren().find((element) => {
|
|
200
|
+
return element.getAttribute("role") === "menu";
|
|
201
|
+
});
|
|
202
|
+
this.hasSubmenu = this.submenu === undefined ? false : true;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
expandedChanged(oldValue) {
|
|
206
|
+
if (this.$fastController.isConnected) {
|
|
207
|
+
if (this.submenu === undefined) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (this.expanded === false) {
|
|
211
|
+
this.submenu.collapseExpandedItem();
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
this.currentDirection = getDirection(this);
|
|
215
|
+
}
|
|
216
|
+
this.$emit("expanded-change", this, { bubbles: false });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
checkedChanged(oldValue, newValue) {
|
|
220
|
+
if (this.$fastController.isConnected) {
|
|
221
|
+
this.$emit("change");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
connectedCallback() {
|
|
228
|
+
super.connectedCallback();
|
|
229
|
+
DOM.queueUpdate(() => {
|
|
230
|
+
this.updateSubmenu();
|
|
231
|
+
});
|
|
232
|
+
if (!this.startColumnCount) {
|
|
233
|
+
this.startColumnCount = 1;
|
|
234
|
+
}
|
|
235
|
+
this.observer = new MutationObserver(this.updateSubmenu);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
disconnectedCallback() {
|
|
241
|
+
super.disconnectedCallback();
|
|
242
|
+
this.submenu = undefined;
|
|
243
|
+
if (this.observer !== undefined) {
|
|
244
|
+
this.observer.disconnect();
|
|
245
|
+
this.observer = undefined;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* get an array of valid DOM children
|
|
250
|
+
*/
|
|
251
|
+
domChildren() {
|
|
252
|
+
return Array.from(this.children).filter(child => !child.hasAttribute("hidden"));
|
|
253
|
+
}
|
|
35
254
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
255
|
+
__decorate([
|
|
256
|
+
attr({ mode: "boolean" })
|
|
257
|
+
], MenuItem$1.prototype, "disabled", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
attr({ mode: "boolean" })
|
|
260
|
+
], MenuItem$1.prototype, "expanded", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
observable
|
|
263
|
+
], MenuItem$1.prototype, "startColumnCount", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
attr
|
|
266
|
+
], MenuItem$1.prototype, "role", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
attr({ mode: "boolean" })
|
|
269
|
+
], MenuItem$1.prototype, "checked", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
observable
|
|
272
|
+
], MenuItem$1.prototype, "submenuRegion", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
observable
|
|
275
|
+
], MenuItem$1.prototype, "hasSubmenu", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
observable
|
|
278
|
+
], MenuItem$1.prototype, "currentDirection", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
observable
|
|
281
|
+
], MenuItem$1.prototype, "submenu", void 0);
|
|
282
|
+
applyMixins(MenuItem$1, StartEnd);
|
|
283
|
+
|
|
284
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus-visible) {\n outline: none;\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 box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n gap: 12px;\n inline-size: 100%;\n padding-block: 2px;\n padding-inline: 16px;\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-dim);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-pale);\n --_appearance-color-outline: transparent;\n}\n.base {\n /* @cssprop [--vvd-menu-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-menu-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-menu-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-menu-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-menu-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));\n /* @cssprop [--vvd-menu-item-accent-pale=var(--vvd-color-neutral-300)] */\n --_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));\n /* @cssprop [--vvd-menu-item-accent-dim=var(--vvd-color-neutral-200)] */\n --_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200));\n}\n.base:not(.two-lines) {\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base.two-lines {\n min-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}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.focus-indicator {\n border-radius: 6px;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n flex-shrink: 0;\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n line-height: 1;\n}\n\n.action,\n.decorative {\n display: flex;\n place-content: center;\n}\n\n.action {\n color: var(--_appearance-color-text);\n}\n.base.trailing .action {\n order: 1;\n margin-inline-start: auto;\n}\n.base.has-meta .action {\n order: 1;\n margin-inline-start: auto;\n}\n\n.base:not(.disabled) .decorative {\n color: var(--vvd-color-neutral-600);\n}\n.base.disabled .decorative {\n color: var(--vvd-color-neutral-200);\n}\n.base.has-meta .decorative {\n order: 1;\n margin-inline-start: auto;\n}\n\n.text {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n}\n\n.text-primary,\n.text-secondary {\n /* stylelint-disable value-no-vendor-prefix */\n display: -webkit-box;\n /* stylelint-enable value-no-vendor-prefix */\n overflow: hidden;\n -webkit-box-orient: vertical;\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n}\n\n.text-primary {\n -webkit-line-clamp: var(--text-primary-line-clamp, 1);\n}\n.base.two-lines .text-primary {\n font: var(--vvd-typography-base-bold);\n}\n\n.text-secondary {\n -webkit-line-clamp: var(--text-secondary-line-clamp, 1);\n}\n.base.two-lines .text-secondary {\n color: var(--vvd-color-neutral-600);\n}";
|
|
285
|
+
|
|
286
|
+
const MenuItemRole = Object.assign(Object.assign({}, MenuItemRole$1), {
|
|
287
|
+
presentation: 'presentation'
|
|
288
|
+
});
|
|
289
|
+
class MenuItem extends MenuItem$1 {}
|
|
290
|
+
__decorate([attr, __metadata("design:type", String)], MenuItem.prototype, "text", void 0);
|
|
41
291
|
__decorate([attr({
|
|
42
|
-
attribute: '
|
|
43
|
-
}), __metadata("design:type",
|
|
44
|
-
|
|
292
|
+
attribute: 'text-secondary'
|
|
293
|
+
}), __metadata("design:type", String)], MenuItem.prototype, "textSecondary", void 0);
|
|
294
|
+
__decorate([observable, __metadata("design:type", Array)], MenuItem.prototype, "metaSlottedContent", void 0);
|
|
295
|
+
applyMixins(MenuItem, AffixIcon);
|
|
45
296
|
|
|
46
|
-
|
|
47
|
-
|
|
297
|
+
const getCheckIcon = (affixIconTemplate, x, iconType) => {
|
|
298
|
+
const iconStatus = x.checked ? 'checked' : 'unchecked';
|
|
299
|
+
const icon = `${iconType}-${iconStatus}-line`;
|
|
300
|
+
return affixIconTemplate(icon);
|
|
301
|
+
};
|
|
302
|
+
const getClasses = ({
|
|
303
|
+
disabled,
|
|
304
|
+
checked,
|
|
305
|
+
expanded,
|
|
306
|
+
role,
|
|
307
|
+
text,
|
|
308
|
+
textSecondary,
|
|
309
|
+
icon,
|
|
310
|
+
metaSlottedContent
|
|
311
|
+
}) => classNames('base', ['disabled', Boolean(disabled)], ['selected', role !== MenuItemRole.menuitem && Boolean(checked)], ['trailing', role !== MenuItemRole.menuitem && Boolean(icon)], ['expanded', Boolean(expanded)], ['item-checkbox', role === MenuItemRole.menuitemcheckbox], ['item-radio', role === MenuItemRole.menuitemradio], ['two-lines', Boolean(text === null || text === void 0 ? void 0 : text.length) && Boolean(textSecondary === null || textSecondary === void 0 ? void 0 : textSecondary.length)], ['has-meta', Boolean(metaSlottedContent === null || metaSlottedContent === void 0 ? void 0 : metaSlottedContent.length)]);
|
|
312
|
+
function handleClick(x, {
|
|
313
|
+
event
|
|
314
|
+
}) {
|
|
315
|
+
x.handleMenuItemClick(event);
|
|
316
|
+
return x.role === MenuItemRole.presentation;
|
|
48
317
|
}
|
|
49
|
-
const
|
|
318
|
+
const MenuItemTemplate = (context, definition) => {
|
|
50
319
|
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
51
320
|
const focusTemplate = focusTemplateFactory(context);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
321
|
+
return html`
|
|
322
|
+
<template
|
|
323
|
+
aria-checked="${x => x.role !== MenuItemRole.menuitem ? x.checked : void 0}"
|
|
324
|
+
aria-disabled="${x => x.disabled}"
|
|
325
|
+
aria-expanded="${x => x.expanded}"
|
|
326
|
+
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
|
|
327
|
+
@click="${handleClick}"
|
|
328
|
+
@mouseover="${(x, c) => x.handleMouseOver(c.event)}"
|
|
329
|
+
@mouseout="${(x, c) => x.handleMouseOut(c.event)}"
|
|
330
|
+
>
|
|
331
|
+
<div class="${getClasses}">
|
|
332
|
+
|
|
333
|
+
${when(x => x.hasSubmenu, html`
|
|
334
|
+
<div
|
|
335
|
+
class="expand-collapse-glyph-container"
|
|
336
|
+
>
|
|
337
|
+
<span class="expand-collapse">
|
|
338
|
+
<slot name="expand-collapse-indicator">
|
|
339
|
+
${definition.expandCollapseGlyph || ''}
|
|
340
|
+
</slot>
|
|
341
|
+
</span>
|
|
342
|
+
</div>
|
|
343
|
+
`)}
|
|
64
344
|
${() => focusTemplate}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
345
|
+
<slot name="meta" ${slotted('metaSlottedContent')}></slot>
|
|
346
|
+
${when(x => x.role === MenuItemRole.menuitemcheckbox, html`<span class="action">${x => getCheckIcon(affixIconTemplate, x, 'checkbox')}</span>`)}
|
|
347
|
+
|
|
348
|
+
${when(x => x.role === MenuItemRole.menuitemradio, html`<span class="action">${x => getCheckIcon(affixIconTemplate, x, 'radio')}</span>`)}
|
|
349
|
+
|
|
350
|
+
${when(x => x.icon, html`<span class="decorative">${x => affixIconTemplate(x.icon)}</span>`)}
|
|
351
|
+
|
|
352
|
+
${when(x => x.text || x.textSecondary, html`<span class="text">
|
|
353
|
+
${when(x => x.text, html`<span class="text-primary">${x => x.text}</span>`)}
|
|
354
|
+
${when(x => x.textSecondary, html`<span class="text-secondary">${x => x.textSecondary}</span>`)}
|
|
355
|
+
</span>`)}
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
68
359
|
</div>
|
|
69
|
-
|
|
360
|
+
</template>
|
|
70
361
|
`;
|
|
71
362
|
};
|
|
72
363
|
|
|
73
|
-
const
|
|
74
|
-
baseName: '
|
|
75
|
-
template:
|
|
364
|
+
const menuItemDefinition = MenuItem.compose({
|
|
365
|
+
baseName: 'menu-item',
|
|
366
|
+
template: MenuItemTemplate,
|
|
76
367
|
styles: css_248z
|
|
77
368
|
});
|
|
78
|
-
const
|
|
79
|
-
const
|
|
369
|
+
const menuItemRegistries = [menuItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
370
|
+
const registerMenuItem = registerFactory(menuItemRegistries);
|
|
80
371
|
|
|
81
|
-
export {
|
|
372
|
+
export { MenuItem$1 as M, MenuItemRole$1 as a, registerMenuItem as b, menuItemDefinition as c, menuItemRegistries as m, roleForMenuItem as r };
|
package/shared/definition34.js
CHANGED
|
@@ -1,33 +1,19 @@
|
|
|
1
|
-
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { i as iconRegistries } from './definition3.js';
|
|
3
|
-
import { f as focusRegistries } from './definition4.js';
|
|
4
|
-
import { b as AffixIcon } from './affix.js';
|
|
5
|
-
import { T as TextAnchor } from './text-anchor.js';
|
|
6
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
-
import { t as textAnchorTemplate } from './text-anchor.template.js';
|
|
1
|
+
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
8
2
|
|
|
9
|
-
var css_248z = "
|
|
3
|
+
var css_248z = "nav {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}";
|
|
10
4
|
|
|
11
|
-
class
|
|
12
|
-
getBodyTemplate() {
|
|
13
|
-
return html`<slot name="meta"></slot>`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
applyMixins(NavItem, AffixIcon);
|
|
5
|
+
class Nav extends FoundationElement {}
|
|
17
6
|
|
|
18
|
-
const
|
|
19
|
-
|
|
7
|
+
const NavTemplate = () => html`
|
|
8
|
+
<nav><slot></slot></nav>
|
|
20
9
|
`;
|
|
21
10
|
|
|
22
|
-
const
|
|
23
|
-
baseName: 'nav
|
|
24
|
-
template:
|
|
25
|
-
styles: css_248z
|
|
26
|
-
shadowOptions: {
|
|
27
|
-
delegatesFocus: true
|
|
28
|
-
}
|
|
11
|
+
const navDefinition = Nav.compose({
|
|
12
|
+
baseName: 'nav',
|
|
13
|
+
template: NavTemplate,
|
|
14
|
+
styles: css_248z
|
|
29
15
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
16
|
+
const navRegistries = [navDefinition()];
|
|
17
|
+
const registerNav = registerFactory(navRegistries);
|
|
32
18
|
|
|
33
|
-
export {
|
|
19
|
+
export { navRegistries as a, navDefinition as n, registerNav as r };
|
package/shared/definition35.js
CHANGED
|
@@ -1,45 +1,81 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
1
|
+
import { F as FoundationElement, d as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { i as iconRegistries } from './definition3.js';
|
|
3
|
-
import {
|
|
4
|
-
import './
|
|
5
|
-
import './form-elements.js';
|
|
3
|
+
import { f as focusRegistries } from './definition4.js';
|
|
4
|
+
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
6
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
7
6
|
import { I as Icon } from './icon.js';
|
|
7
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
+
import { r as ref } from './ref.js';
|
|
8
9
|
import { w as when } from './when.js';
|
|
9
|
-
import { c as classNames } from './class-names.js';
|
|
10
10
|
|
|
11
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n.control {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n gap: 12px;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n padding-inline: 16px;\n text-decoration: none;\n vertical-align: middle;\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control {\n /* @cssprop [--vvd-nav-disclosure-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-nav-disclosure-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-nav-disclosure-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-nav-disclosure-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-nav-disclosure-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-nav-disclosure-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-nav-disclosure-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-nav-disclosure-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-nav-disclosure-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-nav-disclosure-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports selector(:focus-visible) {\n .control:focus-visible {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control .toggleIcon {\n margin-inline-start: auto;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n}\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n line-height: 1;\n}\n\n.content {\n display: flex;\n flex-direction: column;\n border-inline-start: 1px solid var(--vvd-color-neutral-200);\n gap: 4px;\n margin-block: 4px;\n margin-inline-start: 20px;\n padding-inline-start: 12px;\n}\n\ndetails > summary {\n list-style: none;\n}\n\ndetails > summary::-webkit-details-marker {\n display: none;\n}";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var _NavDisclosure_onToggle;
|
|
14
|
+
class NavDisclosure extends FoundationElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.open = false;
|
|
18
|
+
this.ariaCurrent = null;
|
|
19
|
+
_NavDisclosure_onToggle.set(this, () => {
|
|
20
|
+
this.open = this.details.open;
|
|
21
|
+
this.$emit('toggle', undefined, {
|
|
22
|
+
bubbles: false
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
super.connectedCallback();
|
|
28
|
+
this.details.addEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
29
|
+
this.details.open = this.open;
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
super.disconnectedCallback();
|
|
33
|
+
this.details.removeEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
_NavDisclosure_onToggle = new WeakMap();
|
|
37
|
+
__decorate([attr, __metadata("design:type", String)], NavDisclosure.prototype, "label", void 0);
|
|
38
|
+
__decorate([attr({
|
|
39
|
+
mode: 'boolean'
|
|
40
|
+
}), __metadata("design:type", Object)], NavDisclosure.prototype, "open", void 0);
|
|
41
|
+
__decorate([attr({
|
|
42
|
+
attribute: 'aria-current'
|
|
43
|
+
}), __metadata("design:type", Object)], NavDisclosure.prototype, "ariaCurrent", void 0);
|
|
44
|
+
applyMixins(NavDisclosure, AffixIcon);
|
|
17
45
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}) => classNames('base', `connotation-${connotation}`);
|
|
21
|
-
function getHeaderTemplate() {
|
|
22
|
-
return html`<div class="headline">${x => x.headline}</div>`;
|
|
46
|
+
function getAriaCurrent(ariaCurrent, open) {
|
|
47
|
+
return ariaCurrent && !open;
|
|
23
48
|
}
|
|
24
|
-
const
|
|
49
|
+
const NavDisclosureTemplate = context => {
|
|
50
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
51
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
25
52
|
const iconTag = context.tagFor(Icon);
|
|
26
|
-
return html
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
return html`<details class="base" ${ref('details')} ?open=${x => x.open}>
|
|
54
|
+
<summary class="control"
|
|
55
|
+
role="button"
|
|
56
|
+
aria-controls="disclosure-content"
|
|
57
|
+
aria-expanded="${x => x.open}"
|
|
58
|
+
?aria-current=${x => getAriaCurrent(x.ariaCurrent, x.open)}>
|
|
59
|
+
${x => affixIconTemplate(x.icon)}
|
|
60
|
+
${x => x.label}
|
|
61
|
+
<slot name="meta"></slot>
|
|
62
|
+
${when(x => x.open, html`<${iconTag} class="toggleIcon" name='chevron-up-solid'></${iconTag}>`)}
|
|
63
|
+
${when(x => !x.open, html`<${iconTag} class="toggleIcon" name='chevron-down-solid'></${iconTag}>`)}
|
|
64
|
+
${() => focusTemplate}
|
|
65
|
+
</summary>
|
|
66
|
+
<div class="content" id="disclosure-content">
|
|
67
|
+
<slot></slot>
|
|
68
|
+
</div>
|
|
69
|
+
</details>
|
|
70
|
+
`;
|
|
35
71
|
};
|
|
36
72
|
|
|
37
|
-
const
|
|
38
|
-
baseName: '
|
|
39
|
-
template:
|
|
73
|
+
const navDisclosureDefinition = NavDisclosure.compose({
|
|
74
|
+
baseName: 'nav-disclosure',
|
|
75
|
+
template: NavDisclosureTemplate,
|
|
40
76
|
styles: css_248z
|
|
41
77
|
});
|
|
42
|
-
const
|
|
43
|
-
const
|
|
78
|
+
const navDisclosureRegistries = [navDisclosureDefinition(), ...iconRegistries, ...focusRegistries];
|
|
79
|
+
const registerNavDisclosure = registerFactory(navDisclosureRegistries);
|
|
44
80
|
|
|
45
|
-
export {
|
|
81
|
+
export { navDisclosureRegistries as a, navDisclosureDefinition as n, registerNavDisclosure as r };
|