@vonage/vivid 3.40.0 → 3.42.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/accordion/index.js +2 -2
- package/accordion-item/index.js +2 -2
- package/alert/index.js +6 -5
- package/audio-player/index.js +33 -0
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +8 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +4 -3
- package/checkbox/index.js +3 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +438 -41
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- package/date-range-picker/index.js +8 -8
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +3 -3
- package/file-picker/index.js +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +57 -56
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +3 -1
- package/lib/alert/locale.d.ts +3 -0
- package/lib/audio-player/audio-player.d.ts +17 -0
- package/lib/audio-player/audio-player.template.d.ts +4 -0
- package/lib/audio-player/definition.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +5 -0
- package/lib/banner/banner.d.ts +3 -1
- package/lib/banner/locale.d.ts +3 -0
- package/lib/card/card.d.ts +3 -0
- package/lib/card/card.template.d.ts +1 -1
- package/lib/card/definition.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/enums.d.ts +2 -1
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/split-button/locale.d.ts +3 -0
- package/lib/split-button/split-button.d.ts +4 -2
- package/listbox/index.js +4 -4
- package/locales/en-GB.js +14 -0
- package/locales/en-US.js +14 -0
- package/locales/ja-JP.js +14 -0
- package/locales/zh-CN.js +14 -0
- package/menu/index.js +8 -8
- package/menu-item/index.js +3 -3
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -2
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +1 -1
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +2 -2
- package/select/index.js +8 -8
- package/selectable-box/index.js +5 -5
- package/shared/definition.js +3 -3
- package/shared/definition10.js +90 -159
- package/shared/definition11.js +151 -29
- package/shared/definition12.js +37 -766
- package/shared/definition13.js +747 -106
- package/shared/definition14.js +121 -198
- package/shared/definition15.js +167 -664
- package/shared/definition16.js +576 -1137
- package/shared/definition17.js +1278 -143
- package/shared/definition18.js +68 -306
- package/shared/definition19.js +359 -217
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +259 -67
- package/shared/definition21.js +66 -58
- package/shared/definition22.js +43 -84
- package/shared/definition23.js +76 -2353
- package/shared/definition24.js +2362 -45
- package/shared/definition25.js +63 -27
- package/shared/definition26.js +24 -51
- package/shared/definition27.js +36 -822
- package/shared/definition28.js +837 -49
- package/shared/definition29.js +52 -89
- package/shared/definition3.js +1 -1
- package/shared/definition30.js +88 -24
- package/shared/definition31.js +25 -12
- package/shared/definition32.js +12 -52
- package/shared/definition33.js +28 -502
- package/shared/definition34.js +442 -197
- package/shared/definition35.js +260 -186
- package/shared/definition36.js +186 -75
- package/shared/definition37.js +70 -54
- package/shared/definition38.js +65 -421
- package/shared/definition39.js +437 -38
- package/shared/definition4.js +43 -16
- package/shared/definition40.js +32 -680
- package/shared/definition41.js +654 -105
- package/shared/definition42.js +117 -78
- package/shared/definition43.js +74 -567
- package/shared/definition44.js +567 -98
- package/shared/definition45.js +110 -135
- package/shared/definition46.js +153 -17
- package/shared/definition47.js +16 -79
- package/shared/definition48.js +53 -475
- package/shared/definition49.js +502 -25
- package/shared/definition5.js +160 -44
- package/shared/definition50.js +22 -121
- package/shared/definition51.js +113 -271
- package/shared/definition52.js +249 -243
- package/shared/definition53.js +270 -109
- package/shared/definition54.js +84 -74
- package/shared/definition55.js +114 -69
- package/shared/definition56.js +81 -292
- package/shared/definition57.js +302 -13
- package/shared/definition58.js +11 -41
- package/shared/definition59.js +20 -154
- package/shared/definition6.js +43 -33
- package/shared/definition60.js +181 -0
- package/shared/definition7.js +39 -106
- package/shared/definition8.js +122 -38
- package/shared/definition9.js +56 -89
- package/shared/enums.js +1 -0
- package/shared/icon.js +2 -2
- package/shared/index.js +1 -1
- package/shared/index2.js +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +8 -0
- package/shared/patterns/form-elements/form-elements.d.ts +6 -6
- package/shared/presentationDate.js +10 -8
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +3 -3
- package/split-button/index.js +6 -3
- package/style.css +329 -242
- package/styles/core/all.css +31 -25
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +31 -25
- 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/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-area/index.js +3 -3
- package/text-field/index.js +3 -3
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +270 -1
package/shared/definition29.js
CHANGED
|
@@ -1,97 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { I as Icon } from './icon.js';
|
|
7
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
-
import { r as ref } from './ref.js';
|
|
9
|
-
import { w as when } from './when.js';
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { P as Popup, p as popupRegistries } from './definition60.js';
|
|
3
|
+
import { M as Menu, a as menuItemRegistries } from './definition28.js';
|
|
4
|
+
import { s as slotted } from './slotted.js';
|
|
5
|
+
import { c as classNames } from './class-names.js';
|
|
10
6
|
|
|
11
|
-
const styles = "/**\n * Do not edit directly\n * Generated on
|
|
7
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Thu, 30 Nov 2023 11:42:28 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n gap: 8px;\n inline-size: max-content;\n max-block-size: var(--menu-block-size, 408px);\n max-inline-size: var(--menu-max-inline-size);\n min-inline-size: var(--menu-min-inline-size);\n overflow-x: hidden;\n overflow-y: auto;\n padding-block: 8px;\n}\n\n::slotted(a) {\n color: var(--vvd-color-canvas-text);\n text-decoration: none;\n}\n\n::slotted(a[role=menuitem]:focus) {\n display: block;\n border-radius: 6px;\n box-shadow: inset 0 0 0 3px currentColor;\n outline: 2px solid currentColor;\n outline-offset: -2px;\n}\n\n.header {\n padding-block-start: 8px;\n padding-inline: 16px;\n}\n.hide-header .header {\n display: none;\n}\n\n.hide-body .body {\n display: none;\n}\n\n.action-items {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n padding-inline: 8px;\n}\n.hide-actions .action-items {\n display: none;\n}";
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.ariaCurrent = null;
|
|
29
|
-
this.#onToggle = () => {
|
|
30
|
-
this.open = this.details.open;
|
|
31
|
-
this.$emit("toggle", void 0, { bubbles: false });
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
connectedCallback() {
|
|
38
|
-
super.connectedCallback();
|
|
39
|
-
this.details.addEventListener("toggle", this.#onToggle);
|
|
40
|
-
this.details.open = this.open;
|
|
9
|
+
const getClasses = ({
|
|
10
|
+
headerSlottedContent,
|
|
11
|
+
actionItemsSlottedContent,
|
|
12
|
+
items
|
|
13
|
+
}) => classNames(
|
|
14
|
+
"base",
|
|
15
|
+
["hide-header", !headerSlottedContent?.length],
|
|
16
|
+
["hide-actions", !actionItemsSlottedContent?.length],
|
|
17
|
+
["hide-body", items && !items.length]
|
|
18
|
+
);
|
|
19
|
+
const MenuTemplate = (context) => {
|
|
20
|
+
const popupTag = context.tagFor(Popup);
|
|
21
|
+
function handlePopupEvents(x, e, state) {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
x.open = state;
|
|
41
24
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
68
|
-
const iconTag = context.tagFor(Icon);
|
|
69
|
-
return html`<details class="base" ${ref("details")} ?open=${(x) => x.open}>
|
|
70
|
-
<summary class="control"
|
|
71
|
-
role="button"
|
|
72
|
-
aria-controls="disclosure-content"
|
|
73
|
-
aria-expanded="${(x) => x.open}"
|
|
74
|
-
?aria-current=${(x) => getAriaCurrent(x.ariaCurrent, x.open)}>
|
|
75
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
76
|
-
${(x) => x.label}
|
|
77
|
-
<slot name="meta"></slot>
|
|
78
|
-
${when((x) => x.open, html`<${iconTag} class="toggleIcon" name='chevron-up-solid'></${iconTag}>`)}
|
|
79
|
-
${when((x) => !x.open, html`<${iconTag} class="toggleIcon" name='chevron-down-solid'></${iconTag}>`)}
|
|
80
|
-
${() => focusTemplate}
|
|
81
|
-
</summary>
|
|
82
|
-
<div class="content" id="disclosure-content">
|
|
83
|
-
<slot></slot>
|
|
84
|
-
</div>
|
|
85
|
-
</details>
|
|
86
|
-
`;
|
|
25
|
+
return html`
|
|
26
|
+
<template>
|
|
27
|
+
<${popupTag}
|
|
28
|
+
:placement=${(x) => x.placement}
|
|
29
|
+
:open=${(x) => x.open}
|
|
30
|
+
:anchor=${(x) => x.anchor}
|
|
31
|
+
@vwc-popup:open="${(x, c) => handlePopupEvents(x, c.event, true)}"
|
|
32
|
+
@vwc-popup:close="${(x, c) => handlePopupEvents(x, c.event, false)}"
|
|
33
|
+
>
|
|
34
|
+
<div class="${getClasses}">
|
|
35
|
+
<div class="header">
|
|
36
|
+
<slot name="header" ${slotted("headerSlottedContent")}></slot>
|
|
37
|
+
</div>
|
|
38
|
+
<div
|
|
39
|
+
class="body"
|
|
40
|
+
role="menu"
|
|
41
|
+
@keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
|
|
42
|
+
@focusout="${(x, c) => x.handleFocusOut(c.event)}"
|
|
43
|
+
>
|
|
44
|
+
<slot ${slotted("items")}></slot>
|
|
45
|
+
</div>
|
|
46
|
+
<footer class="action-items"><slot name="action-items" ${slotted("actionItemsSlottedContent")}></slot></footer>
|
|
47
|
+
</div>
|
|
48
|
+
</${popupTag}>
|
|
49
|
+
</template>`;
|
|
87
50
|
};
|
|
88
51
|
|
|
89
|
-
const
|
|
90
|
-
baseName: "
|
|
91
|
-
template:
|
|
52
|
+
const menuDefinition = Menu.compose({
|
|
53
|
+
baseName: "menu",
|
|
54
|
+
template: MenuTemplate,
|
|
92
55
|
styles
|
|
93
56
|
});
|
|
94
|
-
const
|
|
95
|
-
const
|
|
57
|
+
const menuRegistries = [menuDefinition(), ...popupRegistries, ...menuItemRegistries];
|
|
58
|
+
const registerMenu = registerFactory(menuRegistries);
|
|
96
59
|
|
|
97
|
-
export {
|
|
60
|
+
export { menuRegistries as a, menuDefinition as m, registerMenu as r };
|
package/shared/definition3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as attr, F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { c as classNames } from './class-names.js';
|
|
3
3
|
|
|
4
|
-
const styles = "/**\n * Do not edit directly\n * Generated on
|
|
4
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Thu, 30 Nov 2023 11:42:28 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n inline-size: inherit;\n vertical-align: middle;\n}\n.base {\n /* @cssprop [--vvd-action-group-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-action-group-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-action-group-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-action-group-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-action-group-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-action-group-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-action-group-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-action-group-accent-faint, var(--vvd-color-neutral-50));\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base::before {\n position: absolute;\n z-index: 1;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inset: 0;\n pointer-events: none;\n}\n.base:not(.tight) {\n padding: 4px;\n column-gap: 4px;\n}\n\n/* Shape */\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.base.shape-pill {\n border-radius: 24px;\n}\n\n/* Separator */\n::slotted([role=separator]) {\n align-self: stretch;\n margin-block: 4px;\n}";
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/shared/definition30.js
CHANGED
|
@@ -1,33 +1,97 @@
|
|
|
1
|
-
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { a as iconRegistries } from './
|
|
3
|
-
import { f as focusRegistries } from './
|
|
4
|
-
import { A as AffixIcon } from './affix.js';
|
|
5
|
-
import { T as TextAnchor } from './text-anchor.js';
|
|
1
|
+
import { a as attr, F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { f as focusRegistries } from './definition58.js';
|
|
4
|
+
import { A as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
6
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
-
import {
|
|
6
|
+
import { I as Icon } from './icon.js';
|
|
7
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
+
import { r as ref } from './ref.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
8
10
|
|
|
9
|
-
const styles = "/**\n * Do not edit directly\n * Generated on
|
|
11
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Thu, 30 Nov 2023 11:42:28 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)) {\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):where(:not(:disabled, .disabled, .readonly)) {\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\nslot[name=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}";
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
16
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
17
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
18
|
+
if (decorator = decorators[i])
|
|
19
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
20
|
+
if (kind && result)
|
|
21
|
+
__defProp(target, key, result);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
class NavDisclosure extends FoundationElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.open = false;
|
|
28
|
+
this.ariaCurrent = null;
|
|
29
|
+
this.#onToggle = () => {
|
|
30
|
+
this.open = this.details.open;
|
|
31
|
+
this.$emit("toggle", void 0, { bubbles: false });
|
|
32
|
+
};
|
|
14
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
super.connectedCallback();
|
|
39
|
+
this.details.addEventListener("toggle", this.#onToggle);
|
|
40
|
+
this.details.open = this.open;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
this.details.removeEventListener("toggle", this.#onToggle);
|
|
48
|
+
}
|
|
49
|
+
#onToggle;
|
|
15
50
|
}
|
|
16
|
-
|
|
51
|
+
__decorateClass([
|
|
52
|
+
attr
|
|
53
|
+
], NavDisclosure.prototype, "label", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
attr({ mode: "boolean" })
|
|
56
|
+
], NavDisclosure.prototype, "open", 2);
|
|
57
|
+
__decorateClass([
|
|
58
|
+
attr({ attribute: "aria-current" })
|
|
59
|
+
], NavDisclosure.prototype, "ariaCurrent", 2);
|
|
60
|
+
applyMixins(NavDisclosure, AffixIcon);
|
|
17
61
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
62
|
+
function getAriaCurrent(ariaCurrent, open) {
|
|
63
|
+
return ariaCurrent && !open;
|
|
64
|
+
}
|
|
65
|
+
const NavDisclosureTemplate = (context) => {
|
|
66
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
67
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
68
|
+
const iconTag = context.tagFor(Icon);
|
|
69
|
+
return html`<details class="base" ${ref("details")} ?open=${(x) => x.open}>
|
|
70
|
+
<summary class="control"
|
|
71
|
+
role="button"
|
|
72
|
+
aria-controls="disclosure-content"
|
|
73
|
+
aria-expanded="${(x) => x.open}"
|
|
74
|
+
?aria-current=${(x) => getAriaCurrent(x.ariaCurrent, x.open)}>
|
|
75
|
+
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
76
|
+
${(x) => x.label}
|
|
77
|
+
<slot name="meta"></slot>
|
|
78
|
+
${when((x) => x.open, html`<${iconTag} class="toggleIcon" name='chevron-up-solid'></${iconTag}>`)}
|
|
79
|
+
${when((x) => !x.open, html`<${iconTag} class="toggleIcon" name='chevron-down-solid'></${iconTag}>`)}
|
|
80
|
+
${() => focusTemplate}
|
|
81
|
+
</summary>
|
|
82
|
+
<div class="content" id="disclosure-content">
|
|
83
|
+
<slot></slot>
|
|
84
|
+
</div>
|
|
85
|
+
</details>
|
|
86
|
+
`;
|
|
87
|
+
};
|
|
21
88
|
|
|
22
|
-
const
|
|
23
|
-
baseName: "nav-
|
|
24
|
-
template:
|
|
25
|
-
styles
|
|
26
|
-
shadowOptions: {
|
|
27
|
-
delegatesFocus: true
|
|
28
|
-
}
|
|
89
|
+
const navDisclosureDefinition = NavDisclosure.compose({
|
|
90
|
+
baseName: "nav-disclosure",
|
|
91
|
+
template: NavDisclosureTemplate,
|
|
92
|
+
styles
|
|
29
93
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
94
|
+
const navDisclosureRegistries = [navDisclosureDefinition(), ...iconRegistries, ...focusRegistries];
|
|
95
|
+
const registerNavDisclosure = registerFactory(navDisclosureRegistries);
|
|
32
96
|
|
|
33
|
-
export {
|
|
97
|
+
export { navDisclosureRegistries as a, navDisclosureDefinition as n, registerNavDisclosure as r };
|
package/shared/definition31.js
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { f as focusRegistries } from './definition58.js';
|
|
4
|
+
import { A 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';
|
|
2
8
|
|
|
3
|
-
const styles = "nav {\n display: flex;\n
|
|
9
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Thu, 30 Nov 2023 11:42:28 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}\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)) {\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):where(:not(:disabled, .disabled, .readonly)) {\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-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-nav-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-nav-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-nav-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-nav-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-nav-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-nav-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-nav-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-nav-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-nav-item-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports selector(:focus-visible) {\n .control:focus-visible {\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.focus-indicator {\n --focus-stroke-gap-color: transparent;\n}\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}\n\nslot[name=icon] {\n font-size: 20px;\n line-height: 1;\n}";
|
|
4
10
|
|
|
5
|
-
class
|
|
11
|
+
class NavItem extends TextAnchor {
|
|
12
|
+
getBodyTemplate() {
|
|
13
|
+
return html`<slot name="meta"></slot>`;
|
|
14
|
+
}
|
|
6
15
|
}
|
|
16
|
+
applyMixins(NavItem, AffixIcon);
|
|
7
17
|
|
|
8
|
-
const
|
|
9
|
-
|
|
18
|
+
const NavItemTemplate = (context, definition) => html`
|
|
19
|
+
${textAnchorTemplate(context)}
|
|
10
20
|
`;
|
|
11
21
|
|
|
12
|
-
const
|
|
13
|
-
baseName: "nav",
|
|
14
|
-
template:
|
|
15
|
-
styles
|
|
22
|
+
const navItemDefinition = NavItem.compose({
|
|
23
|
+
baseName: "nav-item",
|
|
24
|
+
template: NavItemTemplate,
|
|
25
|
+
styles,
|
|
26
|
+
shadowOptions: {
|
|
27
|
+
delegatesFocus: true
|
|
28
|
+
}
|
|
16
29
|
});
|
|
17
|
-
const
|
|
18
|
-
const
|
|
30
|
+
const navItemRegistries = [navItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
31
|
+
const registerNavItem = registerFactory(navItemRegistries);
|
|
19
32
|
|
|
20
|
-
export {
|
|
33
|
+
export { navItemRegistries as a, navItemDefinition as n, registerNavItem as r };
|
package/shared/definition32.js
CHANGED
|
@@ -1,60 +1,20 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import { a as iconRegistries } from './definition25.js';
|
|
3
|
-
import { A as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
|
-
import './index2.js';
|
|
5
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
-
import { w as when } from './when.js';
|
|
7
|
-
import { c as classNames } from './class-names.js';
|
|
1
|
+
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
8
2
|
|
|
9
|
-
const styles = "
|
|
3
|
+
const styles = "nav {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}";
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
16
|
-
if (decorator = decorators[i])
|
|
17
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
18
|
-
if (kind && result)
|
|
19
|
-
__defProp(target, key, result);
|
|
20
|
-
return result;
|
|
21
|
-
};
|
|
22
|
-
class Note extends FoundationElement {
|
|
5
|
+
class Nav extends FoundationElement {
|
|
23
6
|
}
|
|
24
|
-
__decorateClass([
|
|
25
|
-
attr
|
|
26
|
-
], Note.prototype, "headline", 2);
|
|
27
|
-
__decorateClass([
|
|
28
|
-
attr
|
|
29
|
-
], Note.prototype, "connotation", 2);
|
|
30
|
-
applyMixins(Note, AffixIcon);
|
|
31
7
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
36
|
-
function getHeaderTemplate() {
|
|
37
|
-
return html`<div class="headline">${(x) => x.headline}</div>`;
|
|
38
|
-
}
|
|
39
|
-
const NoteTemplate = (context) => {
|
|
40
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
41
|
-
return html`
|
|
42
|
-
<div class="${getClasses}">
|
|
43
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
44
|
-
<div class="text">
|
|
45
|
-
${when((x) => x.headline, getHeaderTemplate())}
|
|
46
|
-
<slot class="message"></slot>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
`;
|
|
50
|
-
};
|
|
8
|
+
const NavTemplate = () => html`
|
|
9
|
+
<nav><slot></slot></nav>
|
|
10
|
+
`;
|
|
51
11
|
|
|
52
|
-
const
|
|
53
|
-
baseName: "
|
|
54
|
-
template:
|
|
12
|
+
const navDefinition = Nav.compose({
|
|
13
|
+
baseName: "nav",
|
|
14
|
+
template: NavTemplate,
|
|
55
15
|
styles
|
|
56
16
|
});
|
|
57
|
-
const
|
|
58
|
-
const
|
|
17
|
+
const navRegistries = [navDefinition()];
|
|
18
|
+
const registerNav = registerFactory(navRegistries);
|
|
59
19
|
|
|
60
|
-
export {
|
|
20
|
+
export { navRegistries as a, navDefinition as n, registerNav as r };
|