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