@vonage/vivid 3.48.0 → 3.49.0-preview.1
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.cjs +21 -0
- package/accordion-item/index.cjs +18 -0
- package/action-group/index.cjs +7 -0
- package/alert/index.cjs +30 -0
- package/appearance-ui/index.cjs +96 -0
- package/audio-player/index.cjs +34 -0
- package/avatar/index.cjs +11 -0
- package/badge/index.cjs +14 -0
- package/banner/index.cjs +29 -0
- package/breadcrumb/index.cjs +13 -0
- package/breadcrumb-item/index.cjs +22 -0
- package/button/index.cjs +25 -0
- package/calendar/index.cjs +9 -0
- package/calendar-event/index.cjs +9 -0
- package/card/index.cjs +14 -0
- package/checkbox/index.cjs +21 -0
- package/combobox/index.cjs +39 -0
- package/data-grid/index.cjs +18 -0
- package/date-picker/index.cjs +40 -0
- package/date-range-picker/index.cjs +40 -0
- package/dialog/index.cjs +31 -0
- package/divider/index.cjs +8 -0
- package/elevation/index.cjs +7 -0
- package/empty-state/index.cjs +12 -0
- package/fab/index.cjs +22 -0
- package/file-picker/index.cjs +30 -0
- package/focus/index.cjs +7 -0
- package/header/index.cjs +8 -0
- package/icon/index.cjs +10 -0
- package/index.cjs +296 -0
- package/layout/index.cjs +7 -0
- package/listbox/index.cjs +77 -0
- package/locales/en-GB.cjs +106 -0
- package/locales/en-US.cjs +106 -0
- package/locales/ja-JP.cjs +106 -0
- package/locales/zh-CN.cjs +106 -0
- package/menu/index.cjs +32 -0
- package/menu-item/index.cjs +22 -0
- package/nav/index.cjs +6 -0
- package/nav-disclosure/index.cjs +17 -0
- package/nav-item/index.cjs +22 -0
- package/note/index.cjs +16 -0
- package/number-field/index.cjs +33 -0
- package/option/index.cjs +23 -0
- package/package.json +20 -2
- package/pagination/index.cjs +28 -0
- package/popup/index.cjs +27 -0
- package/progress/index.cjs +9 -0
- package/progress-ring/index.cjs +9 -0
- package/radio/index.cjs +14 -0
- package/radio-group/index.cjs +14 -0
- package/select/index.cjs +38 -0
- package/selectable-box/index.cjs +25 -0
- package/shared/Reflector.cjs +67 -0
- package/shared/_has.cjs +62 -0
- package/shared/affix.cjs +64 -0
- package/shared/affix.js +8 -4
- package/shared/anchor.cjs +90 -0
- package/shared/anchored.cjs +78 -0
- package/shared/apply-mixins.cjs +25 -0
- package/shared/aria-global.cjs +74 -0
- package/shared/aria.cjs +11 -0
- package/shared/aria2.cjs +11 -0
- package/shared/base-progress.cjs +72 -0
- package/shared/breadcrumb-item.cjs +27 -0
- package/shared/button.cjs +202 -0
- package/shared/calendar-event.cjs +41 -0
- package/shared/children.cjs +61 -0
- package/shared/class-names.cjs +17 -0
- package/shared/definition.cjs +165 -0
- package/shared/definition10.cjs +102 -0
- package/shared/definition11.cjs +164 -0
- package/shared/definition11.js +38 -36
- package/shared/definition12.cjs +50 -0
- package/shared/definition13.cjs +779 -0
- package/shared/definition14.cjs +157 -0
- package/shared/definition15.cjs +249 -0
- package/shared/definition16.cjs +746 -0
- package/shared/definition17.cjs +1372 -0
- package/shared/definition18.cjs +175 -0
- package/shared/definition19.cjs +416 -0
- package/shared/definition2.cjs +232 -0
- package/shared/definition20.cjs +278 -0
- package/shared/definition21.cjs +83 -0
- package/shared/definition22.cjs +74 -0
- package/shared/definition23.cjs +106 -0
- package/shared/definition24.cjs +2392 -0
- package/shared/definition25.cjs +75 -0
- package/shared/definition26.cjs +39 -0
- package/shared/definition27.cjs +66 -0
- package/shared/definition28.cjs +849 -0
- package/shared/definition29.cjs +72 -0
- package/shared/definition3.cjs +72 -0
- package/shared/definition30.cjs +98 -0
- package/shared/definition31.cjs +37 -0
- package/shared/definition32.cjs +24 -0
- package/shared/definition33.cjs +64 -0
- package/shared/definition34.cjs +533 -0
- package/shared/definition35.cjs +295 -0
- package/shared/definition36.cjs +219 -0
- package/shared/definition37.cjs +109 -0
- package/shared/definition38.cjs +92 -0
- package/shared/definition39.cjs +448 -0
- package/shared/definition4.cjs +198 -0
- package/shared/definition40.cjs +49 -0
- package/shared/definition41.cjs +694 -0
- package/shared/definition42.cjs +152 -0
- package/shared/definition43.cjs +113 -0
- package/shared/definition44.cjs +607 -0
- package/shared/definition45.cjs +152 -0
- package/shared/definition46.cjs +166 -0
- package/shared/definition47.cjs +35 -0
- package/shared/definition48.cjs +98 -0
- package/shared/definition49.cjs +543 -0
- package/shared/definition5.cjs +199 -0
- package/shared/definition50.cjs +52 -0
- package/shared/definition51.cjs +150 -0
- package/shared/definition52.cjs +304 -0
- package/shared/definition53.cjs +309 -0
- package/shared/definition54.cjs +146 -0
- package/shared/definition55.cjs +128 -0
- package/shared/definition56.cjs +99 -0
- package/shared/definition57.cjs +310 -0
- package/shared/definition58.cjs +20 -0
- package/shared/definition59.cjs +51 -0
- package/shared/definition6.cjs +83 -0
- package/shared/definition60.cjs +1810 -0
- package/shared/definition7.cjs +72 -0
- package/shared/definition8.cjs +152 -0
- package/shared/definition9.cjs +69 -0
- package/shared/dialog-polyfill.esm.cjs +862 -0
- package/shared/direction.cjs +22 -0
- package/shared/dom.cjs +23 -0
- package/shared/enums.cjs +87 -0
- package/shared/focus.cjs +8 -0
- package/shared/focus2.cjs +11 -0
- package/shared/form-associated.cjs +470 -0
- package/shared/icon.cjs +237 -0
- package/shared/index.cjs +5061 -0
- package/shared/index2.cjs +231 -0
- package/shared/key-codes.cjs +115 -0
- package/shared/key-codes2.cjs +14 -0
- package/shared/listbox.cjs +1072 -0
- package/shared/localized.cjs +11 -0
- package/shared/numbers.cjs +38 -0
- package/shared/patterns/affix.d.ts +5 -1
- package/shared/presentationDate.cjs +6192 -0
- package/shared/radio.cjs +153 -0
- package/shared/ref.cjs +43 -0
- package/shared/repeat.cjs +767 -0
- package/shared/select.options.cjs +12 -0
- package/shared/slotted.cjs +123 -0
- package/shared/start-end.cjs +52 -0
- package/shared/strings.cjs +11 -0
- package/shared/text-anchor.cjs +33 -0
- package/shared/text-anchor.template.cjs +48 -0
- package/shared/text-field.cjs +5 -0
- package/shared/text-field2.cjs +228 -0
- package/shared/tree-item.cjs +154 -0
- package/shared/when.cjs +31 -0
- package/side-drawer/index.cjs +8 -0
- package/slider/index.cjs +16 -0
- package/split-button/index.cjs +20 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +15 -0
- package/tab/index.cjs +17 -0
- package/tab-panel/index.cjs +6 -0
- package/tabs/index.cjs +24 -0
- package/tag/index.cjs +17 -0
- package/tag-group/index.cjs +7 -0
- package/text-anchor/index.cjs +24 -0
- package/text-area/index.cjs +25 -0
- package/text-field/index.cjs +27 -0
- package/toggletip/index.cjs +29 -0
- package/tooltip/index.cjs +29 -0
- package/tree-item/index.cjs +22 -0
- package/tree-view/index.cjs +14 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition60.cjs');
|
|
5
|
+
const definition$1 = require('./definition28.cjs');
|
|
6
|
+
const slotted = require('./slotted.cjs');
|
|
7
|
+
const classNames = require('./class-names.cjs');
|
|
8
|
+
|
|
9
|
+
const styles = ".base{display:flex;box-sizing:border-box;flex-direction:column;gap:8px;inline-size:max-content;max-block-size:var(--menu-block-size, 408px);max-inline-size:var(--menu-max-inline-size);min-inline-size:var(--menu-min-inline-size);overflow-x:hidden;overflow-y:auto;padding-block:8px}::slotted(a){color:var(--vvd-color-canvas-text);text-decoration:none}::slotted(a[role=menuitem]:focus-visible){box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;display:block;border-radius:8px}.header{padding-block-start:8px;padding-inline:16px}.hide-header .header,.hide-body .body{display:none}.action-items{display:flex;justify-content:flex-end;gap:8px;padding-inline:8px}.hide-actions .action-items{display:none}\n";
|
|
10
|
+
|
|
11
|
+
const getClasses = ({
|
|
12
|
+
headerSlottedContent,
|
|
13
|
+
actionItemsSlottedContent,
|
|
14
|
+
items
|
|
15
|
+
}) => classNames.classNames(
|
|
16
|
+
"base",
|
|
17
|
+
["hide-header", !headerSlottedContent?.length],
|
|
18
|
+
["hide-actions", !actionItemsSlottedContent?.length],
|
|
19
|
+
["hide-body", items && !items.length]
|
|
20
|
+
);
|
|
21
|
+
function handleEscapeKey(menu, event) {
|
|
22
|
+
if (event.key === "Escape" && menu.open) {
|
|
23
|
+
menu.open = false;
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
const MenuTemplate = (context) => {
|
|
28
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
29
|
+
function handlePopupEvents(x, e, state) {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
x.open = state;
|
|
32
|
+
}
|
|
33
|
+
return index.html`
|
|
34
|
+
<template role="presentation">
|
|
35
|
+
<${popupTag}
|
|
36
|
+
:placement=${(x) => x.placement}
|
|
37
|
+
:open=${(x) => x.open}
|
|
38
|
+
:anchor=${(x) => x._anchorEl}
|
|
39
|
+
@keydown="${(x, c) => handleEscapeKey(x, c.event)}"
|
|
40
|
+
@vwc-popup:open="${(x, c) => handlePopupEvents(x, c.event, true)}"
|
|
41
|
+
@vwc-popup:close="${(x, c) => handlePopupEvents(x, c.event, false)}"
|
|
42
|
+
>
|
|
43
|
+
<div class="${getClasses}">
|
|
44
|
+
<div class="header">
|
|
45
|
+
<slot name="header" ${slotted.slotted("headerSlottedContent")}></slot>
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
class="body"
|
|
49
|
+
role="menu"
|
|
50
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
51
|
+
@keydown="${(x, c) => x.handleMenuKeyDown(c.event)}"
|
|
52
|
+
@focusout="${(x, c) => x.handleFocusOut(c.event)}"
|
|
53
|
+
>
|
|
54
|
+
<slot ${slotted.slotted("items")}></slot>
|
|
55
|
+
</div>
|
|
56
|
+
<footer class="action-items"><slot name="action-items" ${slotted.slotted("actionItemsSlottedContent")}></slot></footer>
|
|
57
|
+
</div>
|
|
58
|
+
</${popupTag}>
|
|
59
|
+
</template>`;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const menuDefinition = definition$1.Menu.compose({
|
|
63
|
+
baseName: "menu",
|
|
64
|
+
template: MenuTemplate,
|
|
65
|
+
styles
|
|
66
|
+
});
|
|
67
|
+
const menuRegistries = [menuDefinition(), ...definition.popupRegistries, ...definition$1.menuItemRegistries];
|
|
68
|
+
const registerMenu = index.registerFactory(menuRegistries);
|
|
69
|
+
|
|
70
|
+
exports.menuDefinition = menuDefinition;
|
|
71
|
+
exports.menuRegistries = menuRegistries;
|
|
72
|
+
exports.registerMenu = registerMenu;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const classNames = require('./class-names.cjs');
|
|
5
|
+
|
|
6
|
+
const styles = ":host{display:inline-block}.base{position:relative;display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);inline-size:inherit;vertical-align:middle}.base{--_connotation-color-backdrop: var(--vvd-action-group-accent-backdrop, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-action-group-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-intermediate: var(--vvd-action-group-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-action-group-accent-faint, var(--vvd-color-neutral-50))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--_connotation-color-backdrop);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base.appearance-ghost{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:before{position:absolute;z-index:1;border-radius:inherit;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";inset:0;pointer-events:none}.base:not(.tight){padding:4px;column-gap:4px}.base:not(.shape-pill){border-radius:8px}.base.shape-pill{border-radius:24px}::slotted([role=separator]){align-self:stretch;margin-block:4px}\n";
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result)
|
|
16
|
+
__defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
class ActionGroup extends index.FoundationElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.tight = false;
|
|
23
|
+
this.role = null;
|
|
24
|
+
this.ariaLabel = null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
__decorateClass([
|
|
28
|
+
index.attr
|
|
29
|
+
], ActionGroup.prototype, "shape", 2);
|
|
30
|
+
__decorateClass([
|
|
31
|
+
index.attr
|
|
32
|
+
], ActionGroup.prototype, "appearance", 2);
|
|
33
|
+
__decorateClass([
|
|
34
|
+
index.attr({
|
|
35
|
+
mode: "boolean"
|
|
36
|
+
})
|
|
37
|
+
], ActionGroup.prototype, "tight", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
index.attr()
|
|
40
|
+
], ActionGroup.prototype, "role", 2);
|
|
41
|
+
__decorateClass([
|
|
42
|
+
index.attr({ attribute: "aria-label" })
|
|
43
|
+
], ActionGroup.prototype, "ariaLabel", 2);
|
|
44
|
+
|
|
45
|
+
const getClasses = ({
|
|
46
|
+
appearance,
|
|
47
|
+
shape,
|
|
48
|
+
tight
|
|
49
|
+
}) => classNames.classNames(
|
|
50
|
+
"base",
|
|
51
|
+
[`appearance-${appearance}`, Boolean(appearance)],
|
|
52
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
53
|
+
["tight", tight]
|
|
54
|
+
);
|
|
55
|
+
const ActionGroupTemplate = () => index.html`
|
|
56
|
+
<div class="${getClasses}"
|
|
57
|
+
role="${(x) => x.role ? x.role : "group"}"
|
|
58
|
+
aria-label="${(x) => x.ariaLabel}">
|
|
59
|
+
<slot></slot>
|
|
60
|
+
</div>`;
|
|
61
|
+
|
|
62
|
+
const actionGroupDefinition = ActionGroup.compose({
|
|
63
|
+
baseName: "action-group",
|
|
64
|
+
template: ActionGroupTemplate,
|
|
65
|
+
styles
|
|
66
|
+
});
|
|
67
|
+
const actionGroupRegistries = [actionGroupDefinition()];
|
|
68
|
+
const registerActionGroup = index.registerFactory(actionGroupRegistries);
|
|
69
|
+
|
|
70
|
+
exports.actionGroupDefinition = actionGroupDefinition;
|
|
71
|
+
exports.actionGroupRegistries = actionGroupRegistries;
|
|
72
|
+
exports.registerActionGroup = registerActionGroup;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition26.cjs');
|
|
5
|
+
const definition$1 = require('./definition58.cjs');
|
|
6
|
+
const affix = require('./affix.cjs');
|
|
7
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
8
|
+
const icon = require('./icon.cjs');
|
|
9
|
+
const ref = require('./ref.cjs');
|
|
10
|
+
const when = require('./when.cjs');
|
|
11
|
+
|
|
12
|
+
const styles = ".control{display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);border-radius:8px;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);cursor:pointer;font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:10px;padding-inline:16px;text-decoration:none;vertical-align:middle;--focus-stroke-gap-color: transparent}.control{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(:active,.active):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-nav-disclosure-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-nav-disclosure-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-nav-disclosure-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-nav-disclosure-accent-soft, var(--vvd-color-neutral-100))}.control:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}@supports (user-select: none){.control{user-select:none}}.control .toggleIcon{margin-inline-start:auto}slot[name=icon]{font-size:20px;line-height:1}.content{display:flex;flex-direction:column;border-inline-start:1px solid var(--vvd-color-neutral-200);gap:4px;margin-block:4px;margin-inline-start:20px;padding-inline-start:12px}details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}\n";
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
16
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
17
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
18
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
19
|
+
if (decorator = decorators[i])
|
|
20
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
21
|
+
if (kind && result)
|
|
22
|
+
__defProp(target, key, result);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
class NavDisclosure extends index.FoundationElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.open = false;
|
|
29
|
+
this.ariaCurrent = null;
|
|
30
|
+
this.#onToggle = () => {
|
|
31
|
+
this.open = this.details.open;
|
|
32
|
+
this.$emit("toggle", void 0, { bubbles: false });
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
this.details.addEventListener("toggle", this.#onToggle);
|
|
41
|
+
this.details.open = this.open;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
this.details.removeEventListener("toggle", this.#onToggle);
|
|
49
|
+
}
|
|
50
|
+
#onToggle;
|
|
51
|
+
}
|
|
52
|
+
__decorateClass([
|
|
53
|
+
index.attr
|
|
54
|
+
], NavDisclosure.prototype, "label", 2);
|
|
55
|
+
__decorateClass([
|
|
56
|
+
index.attr({ mode: "boolean" })
|
|
57
|
+
], NavDisclosure.prototype, "open", 2);
|
|
58
|
+
__decorateClass([
|
|
59
|
+
index.attr({ attribute: "aria-current" })
|
|
60
|
+
], NavDisclosure.prototype, "ariaCurrent", 2);
|
|
61
|
+
applyMixins.applyMixins(NavDisclosure, affix.AffixIcon);
|
|
62
|
+
|
|
63
|
+
function getAriaCurrent(ariaCurrent, open) {
|
|
64
|
+
return ariaCurrent && !open;
|
|
65
|
+
}
|
|
66
|
+
const NavDisclosureTemplate = (context) => {
|
|
67
|
+
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
68
|
+
const iconTag = context.tagFor(icon.Icon);
|
|
69
|
+
return index.html`<details class="base" ${ref.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, affix.IconWrapper.Slot)}
|
|
76
|
+
${(x) => x.label}
|
|
77
|
+
<slot name="meta"></slot>
|
|
78
|
+
${when.when((x) => x.open, index.html`<${iconTag} class="toggleIcon" name='chevron-up-solid'></${iconTag}>`)}
|
|
79
|
+
${when.when((x) => !x.open, index.html`<${iconTag} class="toggleIcon" name='chevron-down-solid'></${iconTag}>`)}
|
|
80
|
+
</summary>
|
|
81
|
+
<div class="content" id="disclosure-content">
|
|
82
|
+
<slot></slot>
|
|
83
|
+
</div>
|
|
84
|
+
</details>
|
|
85
|
+
`;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const navDisclosureDefinition = NavDisclosure.compose({
|
|
89
|
+
baseName: "nav-disclosure",
|
|
90
|
+
template: NavDisclosureTemplate,
|
|
91
|
+
styles
|
|
92
|
+
});
|
|
93
|
+
const navDisclosureRegistries = [navDisclosureDefinition(), ...definition.iconRegistries, ...definition$1.focusRegistries];
|
|
94
|
+
const registerNavDisclosure = index.registerFactory(navDisclosureRegistries);
|
|
95
|
+
|
|
96
|
+
exports.navDisclosureDefinition = navDisclosureDefinition;
|
|
97
|
+
exports.navDisclosureRegistries = navDisclosureRegistries;
|
|
98
|
+
exports.registerNavDisclosure = registerNavDisclosure;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition26.cjs');
|
|
5
|
+
const definition$1 = require('./definition58.cjs');
|
|
6
|
+
const affix = require('./affix.cjs');
|
|
7
|
+
const textAnchor = require('./text-anchor.cjs');
|
|
8
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
9
|
+
const textAnchor_template = require('./text-anchor.template.cjs');
|
|
10
|
+
|
|
11
|
+
const styles = ".control{display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);border-radius:8px;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));text-decoration:none;vertical-align:middle}.control{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(:active,.active):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-nav-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-nav-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-nav-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-nav-item-accent-soft, var(--vvd-color-neutral-100))}.control:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}.control.icon-only{display:flex;block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));inline-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));place-content:center}.control:not(.icon-only){padding-block:10px;padding-inline:16px}slot[name=icon]{font-size:20px;line-height:1}\n";
|
|
12
|
+
|
|
13
|
+
class NavItem extends textAnchor.TextAnchor {
|
|
14
|
+
getBodyTemplate() {
|
|
15
|
+
return index.html`<slot name="meta"></slot>`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
applyMixins.applyMixins(NavItem, affix.AffixIcon);
|
|
19
|
+
|
|
20
|
+
const NavItemTemplate = (context, definition) => index.html`
|
|
21
|
+
${textAnchor_template.textAnchorTemplate(context)}
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const navItemDefinition = NavItem.compose({
|
|
25
|
+
baseName: "nav-item",
|
|
26
|
+
template: NavItemTemplate,
|
|
27
|
+
styles,
|
|
28
|
+
shadowOptions: {
|
|
29
|
+
delegatesFocus: true
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const navItemRegistries = [navItemDefinition(), ...definition.iconRegistries, ...definition$1.focusRegistries];
|
|
33
|
+
const registerNavItem = index.registerFactory(navItemRegistries);
|
|
34
|
+
|
|
35
|
+
exports.navItemDefinition = navItemDefinition;
|
|
36
|
+
exports.navItemRegistries = navItemRegistries;
|
|
37
|
+
exports.registerNavItem = registerNavItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
const styles = "nav{display:flex;flex-direction:column;gap:4px}\n";
|
|
6
|
+
|
|
7
|
+
class Nav extends index.FoundationElement {
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const NavTemplate = () => index.html`
|
|
11
|
+
<nav><slot></slot></nav>
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
const navDefinition = Nav.compose({
|
|
15
|
+
baseName: "nav",
|
|
16
|
+
template: NavTemplate,
|
|
17
|
+
styles
|
|
18
|
+
});
|
|
19
|
+
const navRegistries = [navDefinition()];
|
|
20
|
+
const registerNav = index.registerFactory(navRegistries);
|
|
21
|
+
|
|
22
|
+
exports.navDefinition = navDefinition;
|
|
23
|
+
exports.navRegistries = navRegistries;
|
|
24
|
+
exports.registerNav = registerNav;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition26.cjs');
|
|
5
|
+
const affix = require('./affix.cjs');
|
|
6
|
+
require('./index2.cjs');
|
|
7
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
8
|
+
const when = require('./when.cjs');
|
|
9
|
+
const classNames = require('./class-names.cjs');
|
|
10
|
+
|
|
11
|
+
const styles = ".base{display:flex;align-items:flex-start;padding:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));background-color:var(--_appearance-color-fill);border-radius:8px;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--vvd-color-canvas-text);column-gap:16px}.base.connotation-success{--_connotation-color-intermediate: var(--vvd-note-success-intermediate, var(--vvd-color-success-500));--_connotation-color-faint: var(--vvd-note-success-faint, var(--vvd-color-success-50));--_connotation-color-fierce: var(--vvd-note-success-fierce, var(--vvd-color-success-700))}.base.connotation-information{--_connotation-color-intermediate: var(--vvd-note-information-intermediate, var(--vvd-color-information-500));--_connotation-color-faint: var(--vvd-note-information-faint, var(--vvd-color-information-50));--_connotation-color-fierce: var(--vvd-note-information-fierce, var(--vvd-color-information-700))}.base.connotation-alert{--_connotation-color-intermediate: var(--vvd-note-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-faint: var(--vvd-note-alert-faint, var(--vvd-color-alert-50));--_connotation-color-fierce: var(--vvd-note-alert-fierce, var(--vvd-color-alert-700))}.base.connotation-warning{--_connotation-color-intermediate: var(--vvd-note-warning-intermediate, var(--vvd-color-warning-300));--_connotation-color-faint: var(--vvd-note-warning-faint, var(--vvd-color-warning-50));--_connotation-color-fierce: var(--vvd-note-warning-fierce, var(--vvd-color-warning-700))}.base:not(.connotation-success,.connotation-information,.connotation-alert,.connotation-warning){--_connotation-color-intermediate: var(--vvd-note-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-note-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-fierce: var(--vvd-note-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--_connotation-color-fierce);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-intermediate)}@supports (contain: content){.base{contain:content}}@supports not (contain: content){.base{overflow:hidden}}slot[name=icon]{color:var(--_appearance-color-outline);font-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.text{display:flex;min-height:24px;flex-direction:column;flex-grow:1;align-items:flex-start;justify-content:center;gap:4px;text-align:start}.text .headline{font:var(--vvd-typography-base-bold)}.text .message{font:var(--vvd-typography-base)}\n";
|
|
12
|
+
|
|
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 Note extends index.FoundationElement {
|
|
25
|
+
}
|
|
26
|
+
__decorateClass([
|
|
27
|
+
index.attr
|
|
28
|
+
], Note.prototype, "headline", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
index.attr
|
|
31
|
+
], Note.prototype, "connotation", 2);
|
|
32
|
+
applyMixins.applyMixins(Note, affix.AffixIcon);
|
|
33
|
+
|
|
34
|
+
const getClasses = ({ connotation }) => classNames.classNames(
|
|
35
|
+
"base",
|
|
36
|
+
`connotation-${connotation}`
|
|
37
|
+
);
|
|
38
|
+
function getHeaderTemplate() {
|
|
39
|
+
return index.html`<div class="headline">${(x) => x.headline}</div>`;
|
|
40
|
+
}
|
|
41
|
+
const NoteTemplate = (context) => {
|
|
42
|
+
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
43
|
+
return index.html`
|
|
44
|
+
<div class="${getClasses}">
|
|
45
|
+
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
46
|
+
<div class="text">
|
|
47
|
+
${when.when((x) => x.headline, getHeaderTemplate())}
|
|
48
|
+
<slot class="message"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const noteDefinition = Note.compose({
|
|
55
|
+
baseName: "note",
|
|
56
|
+
template: NoteTemplate,
|
|
57
|
+
styles
|
|
58
|
+
});
|
|
59
|
+
const noteRegistries = [noteDefinition(), ...definition.iconRegistries];
|
|
60
|
+
const registerNote = index.registerFactory(noteRegistries);
|
|
61
|
+
|
|
62
|
+
exports.noteDefinition = noteDefinition;
|
|
63
|
+
exports.noteRegistries = noteRegistries;
|
|
64
|
+
exports.registerNote = registerNote;
|