@vonage/vivid 3.0.0 → 3.0.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/README.md +176 -4
- package/accordion/index.js +22 -61
- package/accordion-item/index.js +16 -118
- package/action-group/index.js +5 -0
- package/avatar/index.js +11 -0
- package/badge/index.js +9 -53
- package/banner/index.js +20 -210
- package/breadcrumb/index.js +7 -96
- package/breadcrumb-item/index.js +15 -46
- package/button/index.js +19 -751
- package/calendar/index.js +5 -1520
- package/calendar-event/index.js +9 -0
- package/card/index.js +10 -133
- package/checkbox/index.js +16 -0
- package/combobox/index.js +35 -0
- package/dialog/index.js +24 -0
- package/divider/index.js +6 -0
- package/elevation/index.js +4 -30
- package/fab/index.js +22 -0
- package/focus/index.js +4 -2
- package/header/index.js +6 -0
- package/icon/index.js +8 -36
- package/index.js +76 -26
- package/layout/index.js +4 -52
- package/lib/accordion/accordion.d.ts +3 -7
- package/lib/accordion/accordion.template.d.ts +1 -2
- package/lib/accordion/definition.d.ts +1 -0
- package/lib/accordion/index.d.ts +1 -2
- package/lib/accordion-item/accordion-item.d.ts +2 -6
- package/lib/accordion-item/accordion-item.template.d.ts +4 -4
- package/lib/accordion-item/definition.d.ts +1 -0
- package/lib/accordion-item/index.d.ts +1 -3
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/action-group/definition.d.ts +1 -0
- package/lib/action-group/index.d.ts +1 -0
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/definition.d.ts +1 -0
- package/lib/avatar/index.d.ts +1 -0
- package/lib/badge/badge.d.ts +2 -4
- package/lib/badge/definition.d.ts +3 -0
- package/lib/badge/index.d.ts +1 -3
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/definition.d.ts +1 -0
- package/lib/banner/index.d.ts +1 -2
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb/definition.d.ts +1 -0
- package/lib/breadcrumb/index.d.ts +1 -2
- package/lib/breadcrumb-item/definition.d.ts +1 -0
- package/lib/breadcrumb-item/index.d.ts +1 -3
- package/lib/button/button.d.ts +3 -2
- package/lib/button/definition.d.ts +1 -0
- package/lib/button/index.d.ts +1 -21
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/definition.d.ts +1 -0
- package/lib/calendar/index.d.ts +1 -3
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/definition.d.ts +1 -0
- package/lib/calendar-event/index.d.ts +1 -0
- package/lib/card/card.d.ts +2 -2
- package/lib/card/definition.d.ts +1 -0
- package/lib/card/index.d.ts +1 -5
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/definition.d.ts +1 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/combobox/combobox.d.ts +14 -0
- package/lib/combobox/combobox.template.d.ts +4 -0
- package/lib/combobox/definition.d.ts +3 -0
- package/lib/combobox/index.d.ts +1 -0
- package/lib/components.d.ts +44 -16
- package/lib/dialog/definition.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +23 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/divider/definition.d.ts +1 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +1 -0
- package/lib/elevation/definition.d.ts +1 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -2
- package/lib/enums.d.ts +19 -6
- package/lib/fab/definition.d.ts +3 -0
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +1 -0
- package/lib/focus/definition.d.ts +3 -0
- package/lib/focus/index.d.ts +1 -2
- package/lib/{sidenav-item/index.d.ts → header/definition.d.ts} +2 -2
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +1 -0
- package/lib/icon/definition.d.ts +3 -0
- package/lib/icon/icon.d.ts +5 -6
- package/lib/icon/index.d.ts +1 -2
- package/lib/layout/definition.d.ts +3 -0
- package/lib/layout/index.d.ts +1 -2
- package/lib/layout/layout.d.ts +4 -4
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +6 -0
- package/lib/listbox/listbox.template.d.ts +4 -0
- package/lib/menu/definition.d.ts +11 -0
- package/lib/menu/index.d.ts +1 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/definition.d.ts +3 -0
- package/lib/menu-item/index.d.ts +1 -0
- package/lib/menu-item/menu-item.d.ts +8 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/definition.d.ts +3 -0
- package/lib/nav/index.d.ts +1 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/definition.d.ts +3 -0
- package/lib/nav-disclosure/index.d.ts +1 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/definition.d.ts +3 -0
- package/lib/nav-item/index.d.ts +1 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/note/definition.d.ts +3 -0
- package/lib/note/index.d.ts +1 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/{text/text.template.d.ts → note/note.template.d.ts} +2 -2
- package/lib/number-field/definition.d.ts +4 -0
- package/lib/number-field/index.d.ts +1 -0
- package/lib/number-field/number-field.d.ts +14 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/option/definition.d.ts +3 -0
- package/lib/option/index.d.ts +1 -0
- package/lib/option/option.d.ts +9 -0
- package/lib/option/option.template.d.ts +4 -0
- package/lib/popup/definition.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -4
- package/lib/popup/popup.d.ts +8 -4
- package/lib/progress/definition.d.ts +3 -0
- package/lib/progress/index.d.ts +1 -2
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/definition.d.ts +3 -0
- package/lib/progress-ring/index.d.ts +1 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/definition.d.ts +3 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/radio-group/definition.d.ts +11 -0
- package/lib/radio-group/index.d.ts +1 -0
- package/lib/radio-group/radio-group.d.ts +4 -0
- package/lib/radio-group/radio-group.template.d.ts +4 -0
- package/lib/select/definition.d.ts +3 -0
- package/lib/select/index.d.ts +1 -0
- package/lib/select/select.d.ts +17 -0
- package/lib/select/select.template.d.ts +4 -0
- package/lib/side-drawer/definition.d.ts +3 -0
- package/lib/side-drawer/index.d.ts +1 -2
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/slider/definition.d.ts +3 -0
- package/lib/slider/index.d.ts +1 -0
- package/lib/slider/slider.d.ts +4 -0
- package/lib/slider/slider.template.d.ts +4 -0
- package/lib/switch/definition.d.ts +3 -0
- package/lib/switch/index.d.ts +1 -0
- package/lib/switch/switch.d.ts +7 -0
- package/lib/switch/switch.template.d.ts +4 -0
- package/lib/tab/definition.d.ts +3 -0
- package/lib/tab/index.d.ts +1 -0
- package/lib/tab/tab.d.ts +9 -0
- package/lib/tab/tab.template.d.ts +3 -0
- package/lib/tab-panel/definition.d.ts +3 -0
- package/lib/tab-panel/index.d.ts +1 -0
- package/lib/tab-panel/tab-panel.d.ts +3 -0
- package/lib/tab-panel/tab-panel.template.d.ts +2 -0
- package/lib/tabs/definition.d.ts +3 -0
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +10 -0
- package/lib/tabs/tabs.template.d.ts +2 -0
- package/lib/text-anchor/definition.d.ts +3 -0
- package/lib/text-anchor/index.d.ts +1 -2
- package/lib/text-area/definition.d.ts +3 -0
- package/lib/text-area/index.d.ts +1 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/definition.d.ts +3 -0
- package/lib/text-field/index.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +14 -0
- package/lib/text-field/text-field.template.d.ts +4 -0
- package/lib/tooltip/definition.d.ts +3 -0
- package/lib/tooltip/index.d.ts +1 -3
- package/lib/tooltip/tooltip.d.ts +6 -6
- package/listbox/index.js +27 -0
- package/menu/index.js +30 -0
- package/menu-item/index.js +20 -0
- package/nav/index.js +4 -0
- package/nav-disclosure/index.js +17 -0
- package/nav-item/index.js +22 -0
- package/note/index.js +15 -0
- package/number-field/index.js +459 -0
- package/option/index.js +21 -0
- package/package.json +29 -18
- package/popup/index.js +21 -2062
- package/progress/index.js +6 -98
- package/progress-ring/index.js +6 -75
- package/radio/index.js +12 -0
- package/radio-group/index.js +11 -0
- package/select/index.js +34 -0
- package/shared/affix.js +2 -8
- package/shared/anchor.js +10 -2
- package/shared/apply-mixins.js +5 -4
- package/shared/aria-global.js +2 -86
- package/shared/aria.js +9 -0
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/definition.js +225 -0
- package/shared/definition10.js +99 -0
- package/shared/definition11.js +48 -0
- package/shared/definition12.js +1523 -0
- package/shared/definition13.js +111 -0
- package/shared/definition14.js +114 -0
- package/shared/definition15.js +32 -0
- package/shared/definition16.js +172 -0
- package/shared/definition17.js +727 -0
- package/shared/definition18.js +1842 -0
- package/shared/definition19.js +261 -0
- package/shared/definition2.js +150 -0
- package/shared/definition20.js +221 -0
- package/shared/definition21.js +78 -0
- package/shared/definition22.js +87 -0
- package/shared/definition23.js +58 -0
- package/shared/definition24.js +44 -0
- package/shared/definition25.js +58 -0
- package/shared/definition26.js +348 -0
- package/shared/definition27.js +363 -0
- package/shared/definition28.js +21 -0
- package/shared/definition29.js +75 -0
- package/shared/definition3.js +29 -0
- package/shared/definition30.js +31 -0
- package/shared/definition31.js +49 -0
- package/shared/definition32.js +94 -0
- package/shared/definition33.js +77 -0
- package/shared/definition34.js +45 -0
- package/shared/definition35.js +435 -0
- package/shared/definition36.js +634 -0
- package/shared/definition37.js +86 -0
- package/shared/definition38.js +592 -0
- package/shared/definition39.js +147 -0
- package/shared/definition4.js +19 -0
- package/shared/definition40.js +67 -0
- package/shared/definition41.js +32 -0
- package/shared/definition42.js +440 -0
- package/shared/definition43.js +282 -0
- package/shared/definition44.js +119 -0
- package/shared/definition45.js +77 -0
- package/shared/definition5.js +38 -0
- package/shared/definition6.js +60 -0
- package/shared/definition7.js +45 -0
- package/shared/definition8.js +113 -0
- package/shared/definition9.js +107 -0
- package/shared/design-system/index.d.ts +1 -1
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/direction.js +20 -0
- package/shared/dom.js +8 -0
- package/shared/enums.js +70 -0
- package/shared/es.object.assign.js +2 -3
- package/shared/es.regexp.to-string.js +59 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +127 -0
- package/shared/icon.js +538 -567
- package/shared/index.js +1664 -83
- package/shared/key-codes.js +97 -0
- package/shared/listbox.js +995 -0
- package/shared/numbers.js +34 -0
- package/shared/patterns/affix.d.ts +1 -1
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +43 -0
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/radio.js +127 -0
- package/shared/ref.js +41 -0
- package/shared/select.options.js +10 -0
- package/shared/start-end.js +50 -0
- package/shared/string-trim.js +40 -0
- package/shared/strings.js +9 -0
- package/shared/text-anchor.js +0 -2
- package/shared/text-anchor.template.js +6 -5
- package/shared/text-field.js +3 -0
- package/shared/text-field2.js +225 -0
- package/shared/to-string.js +51 -0
- package/side-drawer/index.js +5 -81
- package/slider/index.js +17 -0
- package/styles/core/all.css +83 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +77 -0
- package/styles/tokens/theme-dark.css +228 -0
- package/styles/tokens/theme-light.css +228 -0
- package/switch/index.js +18 -0
- package/tab/index.js +16 -0
- package/tab-panel/index.js +4 -0
- package/tabs/index.js +24 -0
- package/text-anchor/index.js +11 -6
- package/text-area/index.js +23 -0
- package/text-field/index.js +24 -0
- package/tooltip/index.js +18 -55
- package/lib/text/index.d.ts +0 -2
- package/lib/text/text.d.ts +0 -10
- package/shared/index2.js +0 -21
- package/shared/object-set-prototype-of.js +0 -1009
- package/shared/style-inject.es.js +0 -28
- package/shared/web.dom-collections.iterator.js +0 -473
- package/sidenav-item/index.js +0 -39
- package/styles/fonts/spezia.css +0 -23
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -46
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { F as FoundationElement, W 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 { h as keyArrowLeft, i 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';
|
|
12
|
+
|
|
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
|
+
};
|
|
39
|
+
|
|
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, 30 Jan 2023 11:28:31 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-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base: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.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}\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);
|
|
291
|
+
|
|
292
|
+
let _ = t => t,
|
|
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,
|
|
358
|
+
styles: css_248z
|
|
359
|
+
});
|
|
360
|
+
const menuItemRegistries = [menuItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
361
|
+
const registerMenuItem = registerFactory(menuItemRegistries);
|
|
362
|
+
|
|
363
|
+
export { MenuItem$1 as M, MenuItemRole as a, registerMenuItem as b, menuItemDefinition as c, menuItemRegistries as m, roleForMenuItem as r };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "nav {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}";
|
|
4
|
+
|
|
5
|
+
class Nav extends FoundationElement {}
|
|
6
|
+
|
|
7
|
+
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,
|
|
16
|
+
styles: css_248z
|
|
17
|
+
});
|
|
18
|
+
const navRegistries = [navDefinition()];
|
|
19
|
+
const registerNav = registerFactory(navRegistries);
|
|
20
|
+
|
|
21
|
+
export { navRegistries as a, navDefinition as n, registerNav as r };
|
|
@@ -0,0 +1,75 @@
|
|
|
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';
|
|
10
|
+
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 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}";
|
|
12
|
+
|
|
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);
|
|
39
|
+
|
|
40
|
+
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
|
+
};
|
|
66
|
+
|
|
67
|
+
const navDisclosureDefinition = NavDisclosure.compose({
|
|
68
|
+
baseName: 'nav-disclosure',
|
|
69
|
+
template: NavDisclosureTemplate,
|
|
70
|
+
styles: css_248z
|
|
71
|
+
});
|
|
72
|
+
const navDisclosureRegistries = [navDisclosureDefinition(), ...iconRegistries, ...focusRegistries];
|
|
73
|
+
const registerNavDisclosure = registerFactory(navDisclosureRegistries);
|
|
74
|
+
|
|
75
|
+
export { navDisclosureRegistries as a, navDisclosureDefinition as n, registerNavDisclosure as r };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { I as Icon } from './icon.js';
|
|
3
|
+
import { c as classNames } from './class-names.js';
|
|
4
|
+
import { w as when } from './when.js';
|
|
5
|
+
|
|
6
|
+
var css_248z = ":host {\n display: inline-block;\n vertical-align: sub;\n}\n\n.control {\n display: flex;\n margin: unset;\n block-size: var(--_icon-block-size);\n color: currentColor;\n contain: strict;\n inline-size: var(--_icon-block-size);\n}\n.control.connotation-accent {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.control.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.control.connotation-information {\n --_connotation-color-primary: var(--vvd-color-information-500);\n}\n.control.size--6 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)) - 1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.control.size--5 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.control.size--4 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.control.size--3 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.control.size--2 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.control.size--1 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.control.size-0 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.control.size-1 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.control.size-2 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.control.size-3 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.control.size-4 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.control.size-5 {\n --_icon-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.control:not(.size--6, .size--5, .size--4, .size--3, .size--2, .size--1, .size-0, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_icon-block-size: 1em;\n}\n\n.control[class*=connotation] {\n color: var(--_connotation-color-primary);\n}\n\nslot, svg, ::slotted(:where(svg, img)) {\n margin: auto;\n block-size: inherit;\n inline-size: inherit;\n}";
|
|
7
|
+
|
|
8
|
+
let _ = t => t,
|
|
9
|
+
_t,
|
|
10
|
+
_t2;
|
|
11
|
+
const getClasses = ({
|
|
12
|
+
connotation,
|
|
13
|
+
size
|
|
14
|
+
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)]);
|
|
15
|
+
const iconTemplate = () => html(_t || (_t = _`
|
|
16
|
+
<figure class="${0}">
|
|
17
|
+
<slot>${0}</slot>
|
|
18
|
+
</figure>
|
|
19
|
+
`), getClasses, when(x => x._svg, x => html(_t2 || (_t2 = _`${0}`), x._svg)));
|
|
20
|
+
|
|
21
|
+
const iconDefinition = Icon.compose({
|
|
22
|
+
baseName: 'icon',
|
|
23
|
+
template: iconTemplate,
|
|
24
|
+
styles: css_248z
|
|
25
|
+
});
|
|
26
|
+
const iconRegistries = [iconDefinition()];
|
|
27
|
+
const registerIcon = registerFactory(iconRegistries);
|
|
28
|
+
|
|
29
|
+
export { iconDefinition as a, iconRegistries as i, registerIcon as r };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { i as iconRegistries } from './definition3.js';
|
|
3
|
+
import { f as focusRegistries } from './definition4.js';
|
|
4
|
+
import { b as AffixIcon } from './affix.js';
|
|
5
|
+
import { T as TextAnchor } from './text-anchor.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
+
import { t as textAnchorTemplate } from './text-anchor.template.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 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}";
|
|
10
|
+
|
|
11
|
+
class NavItem extends TextAnchor {}
|
|
12
|
+
applyMixins(NavItem, AffixIcon);
|
|
13
|
+
|
|
14
|
+
let _ = t => t,
|
|
15
|
+
_t;
|
|
16
|
+
const NavItemTemplate = (context, definition) => html(_t || (_t = _`
|
|
17
|
+
${0}
|
|
18
|
+
`), textAnchorTemplate(context));
|
|
19
|
+
|
|
20
|
+
const navItemDefinition = NavItem.compose({
|
|
21
|
+
baseName: 'nav-item',
|
|
22
|
+
template: NavItemTemplate,
|
|
23
|
+
styles: css_248z,
|
|
24
|
+
shadowOptions: {
|
|
25
|
+
delegatesFocus: true
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const navItemRegistries = [navItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
29
|
+
const registerNavItem = registerFactory(navItemRegistries);
|
|
30
|
+
|
|
31
|
+
export { navItemRegistries as a, navItemDefinition as n, registerNavItem as r };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { F as FoundationElement, _ 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 { b as AffixIcon } from './affix.js';
|
|
4
|
+
import './focus.js';
|
|
5
|
+
import './form-elements.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
+
import { I as Icon } from './icon.js';
|
|
8
|
+
import { w as when } from './when.js';
|
|
9
|
+
import { c as classNames } from './class-names.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n.base {\n display: flex;\n align-items: stretch;\n padding: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\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}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n --_connotation-color-backdrop: var(--vvd-color-success-50);\n}\n.base.connotation-information {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-intermediate: var(--vvd-color-information-500);\n --_connotation-color-backdrop: var(--vvd-color-information-50);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n --_connotation-color-backdrop: var(--vvd-color-alert-50);\n}\n.base.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-300);\n --_connotation-color-intermediate: var(--vvd-color-warning-300);\n --_connotation-color-backdrop: var(--vvd-color-warning-50);\n}\n.base:not(.connotation-success, .connotation-information, .connotation-alert, .connotation-warning) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\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@supports (contain: content) {\n .base {\n contain: content;\n }\n}\n@supports not (contain: content) {\n .base {\n overflow: hidden;\n }\n}\n\n.icon {\n align-self: flex-start;\n color: var(--_appearance-color-outline);\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n margin-inline-end: 16px;\n}\n\n.text {\n display: flex;\n min-height: 24px;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n gap: 4px;\n text-align: start;\n}\n.text .headline {\n font: var(--vvd-typography-base-bold);\n}\n.text .message {\n font: var(--vvd-typography-base);\n}";
|
|
12
|
+
|
|
13
|
+
class Note extends FoundationElement {}
|
|
14
|
+
__decorate([attr, __metadata("design:type", String)], Note.prototype, "headline", void 0);
|
|
15
|
+
__decorate([attr, __metadata("design:type", String)], Note.prototype, "connotation", void 0);
|
|
16
|
+
applyMixins(Note, AffixIcon);
|
|
17
|
+
|
|
18
|
+
let _ = t => t,
|
|
19
|
+
_t,
|
|
20
|
+
_t2,
|
|
21
|
+
_t3;
|
|
22
|
+
const getClasses = ({
|
|
23
|
+
connotation
|
|
24
|
+
}) => classNames('base', `connotation-${connotation}`);
|
|
25
|
+
function getHeaderTemplate() {
|
|
26
|
+
return html(_t || (_t = _`<div class="headline">${0}</div>`), x => x.headline);
|
|
27
|
+
}
|
|
28
|
+
const NoteTemplate = context => {
|
|
29
|
+
const iconTag = context.tagFor(Icon);
|
|
30
|
+
return html(_t2 || (_t2 = _`
|
|
31
|
+
<div class="${0}">
|
|
32
|
+
${0}
|
|
33
|
+
<div class="text">
|
|
34
|
+
${0}
|
|
35
|
+
<slot class="message"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
`), getClasses, when(x => x.icon, html(_t3 || (_t3 = _`<${0} class="icon" name="${0}"></${0}>`), iconTag, x => x.icon, iconTag)), when(x => x.headline, getHeaderTemplate()));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const noteDefinition = Note.compose({
|
|
42
|
+
baseName: 'note',
|
|
43
|
+
template: NoteTemplate,
|
|
44
|
+
styles: css_248z
|
|
45
|
+
});
|
|
46
|
+
const noteRegistries = [noteDefinition(), ...iconRegistries];
|
|
47
|
+
const registerNote = registerFactory(noteRegistries);
|
|
48
|
+
|
|
49
|
+
export { noteRegistries as a, noteDefinition as n, registerNote as r };
|