@vonage/vivid 3.24.0 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/accordion/index.js +0 -1
  2. package/accordion-item/index.js +0 -1
  3. package/alert/index.js +0 -1
  4. package/avatar/index.js +0 -1
  5. package/badge/index.js +0 -1
  6. package/banner/index.js +0 -1
  7. package/breadcrumb-item/index.js +0 -1
  8. package/button/index.js +0 -1
  9. package/card/index.js +0 -1
  10. package/checkbox/index.js +0 -1
  11. package/combobox/index.js +0 -1
  12. package/custom-elements.json +82 -10
  13. package/data-grid/index.js +7 -2
  14. package/dialog/index.js +0 -1
  15. package/empty-state/index.js +0 -1
  16. package/fab/index.js +0 -1
  17. package/icon/index.js +0 -1
  18. package/index.js +27 -29
  19. package/lib/action-group/action-group.d.ts +1 -1
  20. package/lib/avatar/avatar.d.ts +1 -1
  21. package/lib/checkbox/checkbox.d.ts +0 -1
  22. package/lib/components.d.ts +0 -2
  23. package/lib/data-grid/data-grid-cell.d.ts +14 -1
  24. package/lib/data-grid/data-grid.d.ts +4 -0
  25. package/lib/data-grid/data-grid.options.d.ts +7 -0
  26. package/lib/dialog/dialog.d.ts +1 -0
  27. package/lib/listbox/listbox.d.ts +1 -1
  28. package/lib/menu/menu.d.ts +0 -1
  29. package/lib/menu-item/menu-item.d.ts +6 -0
  30. package/lib/menu-item/menu-item.template.d.ts +2 -3
  31. package/lib/number-field/number-field.d.ts +1 -1
  32. package/lib/select/select.d.ts +1 -1
  33. package/lib/text-field/text-field.d.ts +1 -1
  34. package/listbox/index.js +56 -11
  35. package/menu/index.js +2 -3
  36. package/menu-item/index.js +2 -2
  37. package/nav/index.js +1 -1
  38. package/nav-disclosure/index.js +1 -2
  39. package/nav-item/index.js +1 -2
  40. package/note/index.js +1 -2
  41. package/number-field/index.js +1 -2
  42. package/option/index.js +0 -1
  43. package/package.json +1 -1
  44. package/pagination/index.js +1 -2
  45. package/popup/index.js +0 -1
  46. package/progress/index.js +1 -1
  47. package/radio/index.js +1 -1
  48. package/radio-group/index.js +1 -1
  49. package/select/index.js +1 -2
  50. package/shared/definition.js +1 -1
  51. package/shared/definition10.js +1 -1
  52. package/shared/definition11.js +1 -1
  53. package/shared/definition12.js +1 -1
  54. package/shared/definition14.js +1 -1
  55. package/shared/definition15.js +1 -1
  56. package/shared/definition16.js +2 -2
  57. package/shared/definition17.js +1 -1
  58. package/shared/definition18.js +1 -1
  59. package/shared/definition19.js +1 -1
  60. package/shared/definition2.js +1 -1
  61. package/shared/definition21.js +1 -1
  62. package/shared/definition22.js +76 -21
  63. package/shared/definition23.js +5 -4
  64. package/shared/definition24.js +1 -1
  65. package/shared/definition25.js +1 -1
  66. package/shared/definition26.js +1 -1
  67. package/shared/definition27.js +1 -1
  68. package/shared/definition29.js +368 -48
  69. package/shared/definition30.js +301 -298
  70. package/shared/definition31.js +14 -366
  71. package/shared/definition32.js +70 -13
  72. package/shared/definition33.js +25 -64
  73. package/shared/definition34.js +39 -27
  74. package/shared/definition35.js +431 -31
  75. package/shared/definition36.js +214 -430
  76. package/shared/definition37.js +70 -209
  77. package/shared/definition38.js +33 -81
  78. package/shared/definition39.js +423 -32
  79. package/shared/definition4.js +1 -1
  80. package/shared/definition40.js +586 -358
  81. package/shared/definition41.js +73 -648
  82. package/shared/definition42.js +584 -70
  83. package/shared/definition43.js +81 -538
  84. package/shared/definition44.js +52 -127
  85. package/shared/definition45.js +16 -56
  86. package/shared/definition46.js +485 -17
  87. package/shared/definition47.js +99 -477
  88. package/shared/definition48.js +19 -114
  89. package/shared/definition49.js +276 -19
  90. package/shared/definition5.js +1 -1
  91. package/shared/definition50.js +89 -245
  92. package/shared/definition51.js +629 -109
  93. package/shared/definition52.js +86 -601
  94. package/shared/definition53.js +68 -112
  95. package/shared/definition54.js +294 -69
  96. package/shared/definition6.js +1 -1
  97. package/shared/definition7.js +1 -1
  98. package/shared/definition8.js +2 -2
  99. package/shared/definition9.js +1 -1
  100. package/shared/es.object.assign.js +1 -1
  101. package/shared/es.regexp.to-string.js +1 -1
  102. package/shared/es.string.includes.js +1 -1
  103. package/shared/form-elements.js +1 -1
  104. package/shared/icon.js +17 -13
  105. package/shared/index.js +1 -1
  106. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  107. package/shared/string-trim.js +1 -1
  108. package/shared/text-field.js +1 -1
  109. package/shared/to-string.js +1 -1
  110. package/side-drawer/index.js +1 -1
  111. package/slider/index.js +1 -1
  112. package/styles/core/all.css +1 -1
  113. package/styles/core/theme.css +1 -1
  114. package/styles/core/typography.css +1 -1
  115. package/styles/tokens/theme-dark.css +4 -4
  116. package/styles/tokens/theme-light.css +4 -4
  117. package/switch/index.js +1 -2
  118. package/tab/index.js +1 -2
  119. package/tab-panel/index.js +1 -1
  120. package/tabs/index.js +3 -4
  121. package/tag/index.js +1 -2
  122. package/tag-group/index.js +1 -1
  123. package/text-anchor/index.js +0 -1
  124. package/text-area/index.js +1 -2
  125. package/text-field/index.js +3 -2
  126. package/toggletip/index.js +1 -2
  127. package/tooltip/index.js +1 -2
  128. package/tree-item/index.js +1 -2
  129. package/tree-view/index.js +1 -1
  130. package/vivid.api.json +19 -210
  131. package/shared/definition55.js +0 -305
  132. package/shared/engine-is-node.js +0 -8
@@ -1,124 +1,80 @@
1
- import { F as FoundationElement, W as __classPrivateFieldSet, V as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { P as Popup, p as popupRegistries } from './definition20.js';
1
+ import { _ 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 { T as TreeItem$1 } from './tree-item.js';
6
+ import { a as applyMixins } from './apply-mixins.js';
7
+ import { I as Icon } from './icon.js';
8
+ import { f as focusTemplateFactory } from './focus2.js';
9
+ import { e as elements } from './node-observation.js';
10
+ import { w as when } from './when.js';
11
+ import { s as slotted } from './slotted.js';
12
+ import { c as children } from './children.js';
3
13
  import { c as classNames } from './class-names.js';
14
+ import { r as ref } from './ref.js';
4
15
 
5
- var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 13 Jul 2023 12:46:24 GMT\n */\n.control {\n pointer-events: none;\n}\n\n.tooltip {\n width: var(--tooltip-inline-size, auto);\n}\n.tooltip-text {\n padding: 8px 12px;\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base-bold);\n}";
16
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\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 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(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control {\n /* @cssprop [--vvd-tree-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-tree-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-tree-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-tree-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-tree-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-tree-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-tree-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-tree-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-tree-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-tree-item-accent-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:not(.disabled) {\n cursor: pointer;\n}\n.control.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n.control .text {\n font: var(--vvd-typography-base);\n}\n\n.expandCollapseButton {\n display: flex;\n align-items: center;\n border-radius: 6px;\n font-size: 20px;\n}\n.expandCollapseButton .expandCollapseIcon {\n margin: 4px;\n}\n.expandCollapseButton:hover {\n background-color: var(--vvd-color-neutral-100);\n}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-block: 4px;\n padding-inline-start: 48px;\n}\n\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n line-height: 1;\n}\n.control:not(.disabled, .selected) .icon {\n color: var(--vvd-color-neutral-600);\n}";
6
17
 
7
- var _Tooltip_instances, _Tooltip_anchorEl, _Tooltip_observer, _Tooltip_observeMissingAnchor, _Tooltip_anchorUpdated, _Tooltip_addEventListener, _Tooltip_removeEventListener, _Tooltip_show, _Tooltip_hide, _Tooltip_closeOnEscape;
8
- class Tooltip extends FoundationElement {
9
- constructor() {
10
- super(...arguments);
11
- _Tooltip_instances.add(this);
12
- _Tooltip_anchorEl.set(this, null);
13
- this.open = false;
14
- _Tooltip_observer.set(this, void 0);
15
- _Tooltip_observeMissingAnchor.set(this, anchorId => {
16
- __classPrivateFieldSet(this, _Tooltip_observer, new MutationObserver(() => {
17
- const anchor = document.getElementById(anchorId);
18
- if (anchor) {
19
- __classPrivateFieldSet(this, _Tooltip_anchorEl, anchor, "f");
20
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_anchorUpdated).call(this);
21
- __classPrivateFieldGet(this, _Tooltip_observer, "f").disconnect();
22
- __classPrivateFieldSet(this, _Tooltip_observer, undefined, "f");
23
- }
24
- }), "f");
25
- __classPrivateFieldGet(this, _Tooltip_observer, "f").observe(document.body, {
26
- childList: true,
27
- subtree: true
28
- });
29
- });
30
- _Tooltip_show.set(this, () => {
31
- this.open = true;
32
- });
33
- _Tooltip_hide.set(this, () => {
34
- this.open = false;
35
- });
36
- _Tooltip_closeOnEscape.set(this, e => {
37
- if (e.key === 'Escape') __classPrivateFieldGet(this, _Tooltip_hide, "f").call(this);
38
- });
39
- }
40
- anchorChanged(_, newValue) {
41
- var _a;
42
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
43
- (_a = __classPrivateFieldGet(this, _Tooltip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
44
- __classPrivateFieldSet(this, _Tooltip_anchorEl, newValue instanceof HTMLElement ? newValue : document.getElementById(newValue), "f");
45
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) {
46
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_anchorUpdated).call(this);
47
- } else {
48
- __classPrivateFieldGet(this, _Tooltip_observeMissingAnchor, "f").call(this, newValue);
49
- }
50
- }
51
- disconnectedCallback() {
52
- var _a;
53
- super.disconnectedCallback();
54
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
55
- (_a = __classPrivateFieldGet(this, _Tooltip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
56
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
57
- }
58
- openChanged(_, newValue) {
59
- if (_ === undefined) return;
60
- if (newValue) {
61
- document.addEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
62
- } else {
63
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
64
- }
65
- }
66
- }
67
- _Tooltip_anchorEl = new WeakMap(), _Tooltip_observer = new WeakMap(), _Tooltip_observeMissingAnchor = new WeakMap(), _Tooltip_show = new WeakMap(), _Tooltip_hide = new WeakMap(), _Tooltip_closeOnEscape = new WeakMap(), _Tooltip_instances = new WeakSet(), _Tooltip_anchorUpdated = function _Tooltip_anchorUpdated() {
68
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
69
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_addEventListener).call(this);
70
- }, _Tooltip_addEventListener = function _Tooltip_addEventListener() {
71
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) {
72
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
73
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
74
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
75
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
76
- }
77
- }, _Tooltip_removeEventListener = function _Tooltip_removeEventListener() {
78
- var _a, _b, _c, _d;
79
- (_a = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
80
- (_b = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
81
- (_c = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _c === void 0 ? void 0 : _c.removeEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
82
- (_d = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
83
- };
84
- __decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "text", void 0);
85
- __decorate([attr({
86
- mode: 'fromView'
87
- }), __metadata("design:type", String)], Tooltip.prototype, "placement", void 0);
88
- __decorate([attr({
89
- mode: 'boolean'
90
- }), __metadata("design:type", Object)], Tooltip.prototype, "open", void 0);
91
- __decorate([attr({
92
- mode: 'fromView'
93
- }), __metadata("design:type", Object)], Tooltip.prototype, "anchor", void 0);
18
+ class TreeItem extends TreeItem$1 {}
19
+ __decorate([attr, __metadata("design:type", String)], TreeItem.prototype, "text", void 0);
20
+ applyMixins(TreeItem, AffixIcon);
94
21
 
95
22
  let _ = t => t,
96
- _t;
23
+ _t,
24
+ _t2,
25
+ _t3;
97
26
  const getClasses = ({
98
- open
99
- }) => classNames('control', ['open', Boolean(open)]);
100
- const TooltipTemplate = context => {
101
- const popupTag = context.tagFor(Popup);
27
+ disabled,
28
+ selected
29
+ }) => classNames('control', ['disabled', disabled], ['selected', Boolean(selected)]);
30
+ const expandCollapseButton = context => {
31
+ const iconTag = context.tagFor(Icon);
102
32
  return html(_t || (_t = _`
103
- <${0} class="${0}" arrow alternate
104
- :placement=${0}
105
- :anchor="${0}"
106
- :open=${0}
107
- exportparts="vvd-theme-alternate">
108
- <div class="tooltip" role="tooltip">
109
- <header part="vvd-theme-alternate" class="tooltip-header">
110
- <div class="tooltip-text">${0}</div>
111
- </header>
112
- </div>
113
- </${0}>`), popupTag, getClasses, x => x.placement, x => x.anchor, x => x.open, x => x.text, popupTag);
33
+ <div aria-hidden="true"
34
+ class="expandCollapseButton"
35
+ @click="${0}"
36
+ ${0}
37
+ >
38
+ <${0} class="expandCollapseIcon" name="${0}"></${0}>
39
+ </div>`), (x, c) => x.handleExpandCollapseButtonClick(c.event), ref('expandCollapseButton'), iconTag, x => x.expanded ? 'chevron-down-line' : 'chevron-right-line', iconTag);
40
+ };
41
+ const TreeItemTemplate = context => {
42
+ const affixIconTemplate = affixIconTemplateFactory(context);
43
+ const focusTemplate = focusTemplateFactory(context);
44
+ return html(_t2 || (_t2 = _`
45
+ <template
46
+ role="treeitem"
47
+ slot="${0}"
48
+ tabindex="-1"
49
+ aria-expanded="${0}"
50
+ aria-selected="${0}"
51
+ aria-disabled="${0}"
52
+ @focusin="${0}"
53
+ @focusout="${0}"
54
+ ${0}
55
+ >
56
+ <div class="${0}">
57
+ ${0}
58
+ ${0}
59
+ ${0}
60
+ ${0}
61
+ </div>
62
+ ${0}
63
+ </template>`), x => x.isNestedItem() ? 'item' : void 0, x => x.childItems && x.childItems.length > 0 ? x.expanded : void 0, x => x.selected, x => x.disabled, (x, c) => x.handleFocus(c.event), (x, c) => x.handleBlur(c.event), children({
64
+ property: 'childItems',
65
+ filter: elements()
66
+ }), getClasses, () => focusTemplate, when(x => x.childItems && x.childItems.length > 0, expandCollapseButton(context)), x => affixIconTemplate(x.icon), x => x.text, when(x => x.childItems && x.childItems.length > 0 && x.expanded, html(_t3 || (_t3 = _`
67
+ <div role="group" class="items">
68
+ <slot name="item" ${0}></slot>
69
+ </div>`), slotted('items'))));
114
70
  };
115
71
 
116
- const tooltipDefinition = Tooltip.compose({
117
- baseName: 'tooltip',
118
- template: TooltipTemplate,
72
+ const treeItemDefinition = TreeItem.compose({
73
+ baseName: 'tree-item',
74
+ template: TreeItemTemplate,
119
75
  styles: css_248z
120
76
  });
121
- const tooltipRegistries = [tooltipDefinition(), ...popupRegistries];
122
- const registerTooltip = registerFactory(tooltipRegistries);
77
+ const treeItemRegistries = [treeItemDefinition(), ...iconRegistries, ...focusRegistries];
78
+ const registerTreeItem = registerFactory(treeItemRegistries);
123
79
 
124
- export { tooltipRegistries as a, registerTooltip as r, tooltipDefinition as t };
80
+ export { treeItemRegistries as a, registerTreeItem as r, treeItemDefinition as t };
@@ -1,80 +1,305 @@
1
- import { _ 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 { T as TreeItem$1 } from './tree-item.js';
6
- import { a as applyMixins } from './apply-mixins.js';
7
- import { I as Icon } from './icon.js';
8
- import { f as focusTemplateFactory } from './focus2.js';
9
- import { e as elements } from './node-observation.js';
10
- import { w as when } from './when.js';
1
+ import { F as FoundationElement, Y as DOM, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { T as TreeItem, i as isTreeItemElement } from './tree-item.js';
3
+ import { i as isHTMLElement, g as getDisplayedNodes } from './dom.js';
4
+ import { d as keyEnter, c as keyArrowUp, b as keyArrowDown, h as keyArrowRight, i as keyArrowLeft, k as keyEnd, a as keyHome } from './key-codes.js';
11
5
  import { s as slotted } from './slotted.js';
12
- import { c as children } from './children.js';
13
- import { c as classNames } from './class-names.js';
14
6
  import { r as ref } from './ref.js';
7
+ import { c as classNames } from './class-names.js';
15
8
 
16
- var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 13 Jul 2023 12:46:24 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\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 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(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control {\n /* @cssprop [--vvd-tree-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-tree-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-tree-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-tree-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-tree-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-tree-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-tree-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-tree-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-tree-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-tree-item-accent-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:not(.disabled) {\n cursor: pointer;\n}\n.control.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n.control .text {\n font: var(--vvd-typography-base);\n}\n\n.expandCollapseButton {\n display: flex;\n align-items: center;\n border-radius: 6px;\n font-size: 20px;\n}\n.expandCollapseButton .expandCollapseIcon {\n margin: 4px;\n}\n.expandCollapseButton:hover {\n background-color: var(--vvd-color-neutral-100);\n}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-block: 4px;\n padding-inline-start: 48px;\n}\n\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n line-height: 1;\n}\n.control:not(.disabled, .selected) .icon {\n color: var(--vvd-color-neutral-600);\n}";
9
+ /**
10
+ * A Tree view Custom HTML Element.
11
+ * Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.
12
+ *
13
+ * @slot - The default slot for tree items
14
+ *
15
+ * @public
16
+ */
17
+ class TreeView$1 extends FoundationElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ /**
21
+ * The tree item that is designated to be in the tab queue.
22
+ *
23
+ * @internal
24
+ */
25
+ this.currentFocused = null;
26
+ /**
27
+ * Handle focus events
28
+ *
29
+ * @internal
30
+ */
31
+ this.handleFocus = (e) => {
32
+ if (this.slottedTreeItems.length < 1) {
33
+ // no child items, nothing to do
34
+ return;
35
+ }
36
+ if (e.target === this) {
37
+ if (this.currentFocused === null) {
38
+ this.currentFocused = this.getValidFocusableItem();
39
+ }
40
+ if (this.currentFocused !== null) {
41
+ TreeItem.focusItem(this.currentFocused);
42
+ }
43
+ return;
44
+ }
45
+ if (this.contains(e.target)) {
46
+ this.setAttribute("tabindex", "-1");
47
+ this.currentFocused = e.target;
48
+ }
49
+ };
50
+ /**
51
+ * Handle blur events
52
+ *
53
+ * @internal
54
+ */
55
+ this.handleBlur = (e) => {
56
+ if (e.target instanceof HTMLElement &&
57
+ (e.relatedTarget === null || !this.contains(e.relatedTarget))) {
58
+ this.setAttribute("tabindex", "0");
59
+ }
60
+ };
61
+ /**
62
+ * KeyDown handler
63
+ *
64
+ * @internal
65
+ */
66
+ this.handleKeyDown = (e) => {
67
+ if (e.defaultPrevented) {
68
+ return;
69
+ }
70
+ if (this.slottedTreeItems.length < 1) {
71
+ return true;
72
+ }
73
+ const treeItems = this.getVisibleNodes();
74
+ switch (e.key) {
75
+ case keyHome:
76
+ if (treeItems.length) {
77
+ TreeItem.focusItem(treeItems[0]);
78
+ }
79
+ return;
80
+ case keyEnd:
81
+ if (treeItems.length) {
82
+ TreeItem.focusItem(treeItems[treeItems.length - 1]);
83
+ }
84
+ return;
85
+ case keyArrowLeft:
86
+ if (e.target && this.isFocusableElement(e.target)) {
87
+ const item = e.target;
88
+ if (item instanceof TreeItem &&
89
+ item.childItemLength() > 0 &&
90
+ item.expanded) {
91
+ item.expanded = false;
92
+ }
93
+ else if (item instanceof TreeItem &&
94
+ item.parentElement instanceof TreeItem) {
95
+ TreeItem.focusItem(item.parentElement);
96
+ }
97
+ }
98
+ return false;
99
+ case keyArrowRight:
100
+ if (e.target && this.isFocusableElement(e.target)) {
101
+ const item = e.target;
102
+ if (item instanceof TreeItem &&
103
+ item.childItemLength() > 0 &&
104
+ !item.expanded) {
105
+ item.expanded = true;
106
+ }
107
+ else if (item instanceof TreeItem && item.childItemLength() > 0) {
108
+ this.focusNextNode(1, e.target);
109
+ }
110
+ }
111
+ return;
112
+ case keyArrowDown:
113
+ if (e.target && this.isFocusableElement(e.target)) {
114
+ this.focusNextNode(1, e.target);
115
+ }
116
+ return;
117
+ case keyArrowUp:
118
+ if (e.target && this.isFocusableElement(e.target)) {
119
+ this.focusNextNode(-1, e.target);
120
+ }
121
+ return;
122
+ case keyEnter:
123
+ // In single-select trees where selection does not follow focus (see note below),
124
+ // the default action is typically to select the focused node.
125
+ this.handleClick(e);
126
+ return;
127
+ }
128
+ // don't prevent default if we took no action
129
+ return true;
130
+ };
131
+ /**
132
+ * Handles the selected-changed events bubbling up
133
+ * from child tree items
134
+ *
135
+ * @internal
136
+ */
137
+ this.handleSelectedChange = (e) => {
138
+ if (e.defaultPrevented) {
139
+ return;
140
+ }
141
+ if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {
142
+ return true;
143
+ }
144
+ const item = e.target;
145
+ if (item.selected) {
146
+ if (this.currentSelected && this.currentSelected !== item) {
147
+ this.currentSelected.selected = false;
148
+ }
149
+ // new selected item
150
+ this.currentSelected = item;
151
+ }
152
+ else if (!item.selected && this.currentSelected === item) {
153
+ // selected item deselected
154
+ this.currentSelected = null;
155
+ }
156
+ return;
157
+ };
158
+ /**
159
+ * Updates the tree view when slottedTreeItems changes
160
+ */
161
+ this.setItems = () => {
162
+ // force single selection
163
+ // defaults to first one found
164
+ const selectedItem = this.treeView.querySelector("[aria-selected='true']");
165
+ this.currentSelected = selectedItem;
166
+ // invalidate the current focused item if it is no longer valid
167
+ if (this.currentFocused === null || !this.contains(this.currentFocused)) {
168
+ this.currentFocused = this.getValidFocusableItem();
169
+ }
170
+ // toggle properties on child elements
171
+ this.nested = this.checkForNestedItems();
172
+ const treeItems = this.getVisibleNodes();
173
+ treeItems.forEach(node => {
174
+ if (isTreeItemElement(node)) {
175
+ node.nested = this.nested;
176
+ }
177
+ });
178
+ };
179
+ /**
180
+ * check if the item is focusable
181
+ */
182
+ this.isFocusableElement = (el) => {
183
+ return isTreeItemElement(el);
184
+ };
185
+ this.isSelectedElement = (el) => {
186
+ return el.selected;
187
+ };
188
+ }
189
+ slottedTreeItemsChanged() {
190
+ if (this.$fastController.isConnected) {
191
+ // update for slotted children change
192
+ this.setItems();
193
+ }
194
+ }
195
+ connectedCallback() {
196
+ super.connectedCallback();
197
+ this.setAttribute("tabindex", "0");
198
+ DOM.queueUpdate(() => {
199
+ this.setItems();
200
+ });
201
+ }
202
+ /**
203
+ * Handles click events bubbling up
204
+ *
205
+ * @internal
206
+ */
207
+ handleClick(e) {
208
+ if (e.defaultPrevented) {
209
+ // handled, do nothing
210
+ return;
211
+ }
212
+ if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) {
213
+ // not a tree item, ignore
214
+ return true;
215
+ }
216
+ const item = e.target;
217
+ if (!item.disabled) {
218
+ item.selected = !item.selected;
219
+ }
220
+ return;
221
+ }
222
+ /**
223
+ * Move focus to a tree item based on its offset from the provided item
224
+ */
225
+ focusNextNode(delta, item) {
226
+ const visibleNodes = this.getVisibleNodes();
227
+ if (!visibleNodes) {
228
+ return;
229
+ }
230
+ const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];
231
+ if (isHTMLElement(focusItem)) {
232
+ TreeItem.focusItem(focusItem);
233
+ }
234
+ }
235
+ /**
236
+ * checks if there are any nested tree items
237
+ */
238
+ getValidFocusableItem() {
239
+ const treeItems = this.getVisibleNodes();
240
+ // default to selected element if there is one
241
+ let focusIndex = treeItems.findIndex(this.isSelectedElement);
242
+ if (focusIndex === -1) {
243
+ // otherwise first focusable tree item
244
+ focusIndex = treeItems.findIndex(this.isFocusableElement);
245
+ }
246
+ if (focusIndex !== -1) {
247
+ return treeItems[focusIndex];
248
+ }
249
+ return null;
250
+ }
251
+ /**
252
+ * checks if there are any nested tree items
253
+ */
254
+ checkForNestedItems() {
255
+ return this.slottedTreeItems.some((node) => {
256
+ return isTreeItemElement(node) && node.querySelector("[role='treeitem']");
257
+ });
258
+ }
259
+ getVisibleNodes() {
260
+ return getDisplayedNodes(this, "[role='treeitem']") || [];
261
+ }
262
+ }
263
+ __decorate([
264
+ attr({ attribute: "render-collapsed-nodes" })
265
+ ], TreeView$1.prototype, "renderCollapsedNodes", void 0);
266
+ __decorate([
267
+ observable
268
+ ], TreeView$1.prototype, "currentSelected", void 0);
269
+ __decorate([
270
+ observable
271
+ ], TreeView$1.prototype, "slottedTreeItems", void 0);
17
272
 
18
- class TreeItem extends TreeItem$1 {}
19
- __decorate([attr, __metadata("design:type", String)], TreeItem.prototype, "text", void 0);
20
- applyMixins(TreeItem, AffixIcon);
273
+ var css_248z = ".control {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}";
21
274
 
22
- let _ = t => t,
23
- _t,
24
- _t2,
25
- _t3;
26
- const getClasses = ({
27
- disabled,
28
- selected
29
- }) => classNames('control', ['disabled', disabled], ['selected', Boolean(selected)]);
30
- const expandCollapseButton = context => {
31
- const iconTag = context.tagFor(Icon);
32
- return html(_t || (_t = _`
33
- <div aria-hidden="true"
34
- class="expandCollapseButton"
35
- @click="${0}"
36
- ${0}
37
- >
38
- <${0} class="expandCollapseIcon" name="${0}"></${0}>
39
- </div>`), (x, c) => x.handleExpandCollapseButtonClick(c.event), ref('expandCollapseButton'), iconTag, x => x.expanded ? 'chevron-down-line' : 'chevron-right-line', iconTag);
40
- };
41
- const TreeItemTemplate = context => {
42
- const affixIconTemplate = affixIconTemplateFactory(context);
43
- const focusTemplate = focusTemplateFactory(context);
44
- return html(_t2 || (_t2 = _`
275
+ class TreeView extends TreeView$1 {}
276
+
277
+ let _2 = t => t,
278
+ _t;
279
+ const getClasses = _ => classNames('control');
280
+ const TreeViewTemplate = () => {
281
+ return html(_t || (_t = _2`
45
282
  <template
46
- role="treeitem"
47
- slot="${0}"
48
- tabindex="-1"
49
- aria-expanded="${0}"
50
- aria-selected="${0}"
51
- aria-disabled="${0}"
52
- @focusin="${0}"
53
- @focusout="${0}"
54
- ${0}
55
- >
56
- <div class="${0}">
57
- ${0}
58
- ${0}
59
- ${0}
60
- ${0}
61
- </div>
62
- ${0}
63
- </template>`), x => x.isNestedItem() ? 'item' : void 0, x => x.childItems && x.childItems.length > 0 ? x.expanded : void 0, x => x.selected, x => x.disabled, (x, c) => x.handleFocus(c.event), (x, c) => x.handleBlur(c.event), children({
64
- property: 'childItems',
65
- filter: elements()
66
- }), getClasses, () => focusTemplate, when(x => x.childItems && x.childItems.length > 0, expandCollapseButton(context)), x => affixIconTemplate(x.icon), x => x.text, when(x => x.childItems && x.childItems.length > 0 && x.expanded, html(_t3 || (_t3 = _`
67
- <div role="group" class="items">
68
- <slot name="item" ${0}></slot>
69
- </div>`), slotted('items'))));
283
+ role="tree"
284
+ ${0}
285
+ @keydown="${0}"
286
+ @focusin="${0}"
287
+ @focusout="${0}"
288
+ @click="${0}"
289
+ @selected-change="${0}"
290
+ >
291
+ <div class="${0}">
292
+ <slot ${0}></slot>
293
+ </div>
294
+ </template>`), ref('treeView'), (x, c) => x.handleKeyDown(c.event), (x, c) => x.handleFocus(c.event), (x, c) => x.handleBlur(c.event), (x, c) => x.handleClick(c.event), (x, c) => x.handleSelectedChange(c.event), getClasses, slotted('slottedTreeItems'));
70
295
  };
71
296
 
72
- const treeItemDefinition = TreeItem.compose({
73
- baseName: 'tree-item',
74
- template: TreeItemTemplate,
297
+ const treeViewDefinition = TreeView.compose({
298
+ baseName: 'tree-view',
299
+ template: TreeViewTemplate,
75
300
  styles: css_248z
76
301
  });
77
- const treeItemRegistries = [treeItemDefinition(), ...iconRegistries, ...focusRegistries];
78
- const registerTreeItem = registerFactory(treeItemRegistries);
302
+ const treeViewRegistries = [treeViewDefinition()];
303
+ const registerTreeView = registerFactory(treeViewRegistries);
79
304
 
80
- export { treeItemRegistries as a, registerTreeItem as r, treeItemDefinition as t };
305
+ export { treeViewRegistries as a, registerTreeView as r, treeViewDefinition as t };
@@ -10,7 +10,7 @@ import { B as Button } from './button.js';
10
10
  import { w as when } from './when.js';
11
11
  import { c as classNames } from './class-names.js';
12
12
 
13
- var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 13 Jul 2023 12:46:24 GMT\n */\n.control {\n position: fixed;\n z-index: 10;\n border-radius: 6px;\n inline-size: max-content;\n inset-block-end: 0;\n inset-inline-end: 0;\n inset-inline-start: 0;\n margin-block: 16px;\n margin-inline: auto;\n max-inline-size: var(--alert-max-inline-size, fit-content);\n min-inline-size: var(--alert-min-inline-size, 420px);\n transition: opacity 150ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n}\n.control.placement-top, .control.placement-top-start, .control.placement-top-end {\n inset-block-end: auto;\n inset-block-start: 0;\n}\n.control.placement-top-start, .control.placement-bottom-start {\n right: auto;\n inset-inline-end: auto;\n margin-inline: 16px;\n}\n.control.placement-top-end, .control.placement-bottom-end {\n inset-inline-start: auto;\n margin-inline: 16px;\n}\n.control:not(.open) {\n opacity: 0;\n transform: scale(0.8);\n}\n.control.open {\n opacity: 1;\n transform: scale(1);\n}\n\n.base {\n display: flex;\n align-items: center;\n padding: 16px;\n background-color: var(--vvd-color-neutral-50);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n column-gap: 16px;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-alert-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-alert-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-alert-success-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-success-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-information {\n /* @cssprop [--vvd-alert-information-primary=var(--vvd-color-information-500)] */\n --_connotation-color-primary: var(--vvd-alert-information-primary, var(--vvd-color-information-500));\n /* @cssprop [--vvd-alert-information-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-information-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-alert-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-alert-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-alert-alert-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-alert-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-warning {\n /* @cssprop [--vvd-alert-warning-primary=var(--vvd-color-warning-300)] */\n --_connotation-color-primary: var(--vvd-alert-warning-primary, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-alert-warning-primary-text=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary-text: var(--vvd-alert-warning-primary-text, var(--vvd-color-canvas-text));\n}\n.base:not(.connotation-success, .connotation-information, .connotation-alert, .connotation-warning) {\n /* @cssprop [--vvd-alert-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-alert-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-alert-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-accent-primary-text, var(--vvd-color-canvas));\n}\n.base {\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 .alert-text {\n margin-inline-end: auto;\n}\n.base .alert-text .headline {\n font: var(--vvd-typography-base-bold);\n margin-block-end: 4px;\n}\n.base .alert-text .main-text {\n font: var(--vvd-typography-base);\n}\n.base .icon {\n flex-shrink: 0;\n color: var(--_appearance-color-fill);\n font-size: 24px;\n line-height: 1;\n}\n.base .dismiss-button {\n border-left: 1px solid var(--vvd-color-neutral-200);\n padding-inline-start: 8px;\n}";
13
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n.control {\n position: fixed;\n z-index: 10;\n border-radius: 6px;\n inline-size: max-content;\n inset-block-end: 0;\n inset-inline-end: 0;\n inset-inline-start: 0;\n margin-block: 16px;\n margin-inline: auto;\n max-inline-size: var(--alert-max-inline-size, fit-content);\n min-inline-size: var(--alert-min-inline-size, 420px);\n transition: opacity 150ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 150ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n}\n.control.placement-top, .control.placement-top-start, .control.placement-top-end {\n inset-block-end: auto;\n inset-block-start: 0;\n}\n.control.placement-top-start, .control.placement-bottom-start {\n right: auto;\n inset-inline-end: auto;\n margin-inline: 16px;\n}\n.control.placement-top-end, .control.placement-bottom-end {\n inset-inline-start: auto;\n margin-inline: 16px;\n}\n.control:not(.open) {\n opacity: 0;\n transform: scale(0.8);\n}\n.control.open {\n opacity: 1;\n transform: scale(1);\n}\n\n.base {\n display: flex;\n align-items: center;\n padding: 16px;\n background-color: var(--vvd-color-neutral-50);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n column-gap: 16px;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-alert-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-alert-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-alert-success-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-success-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-information {\n /* @cssprop [--vvd-alert-information-primary=var(--vvd-color-information-500)] */\n --_connotation-color-primary: var(--vvd-alert-information-primary, var(--vvd-color-information-500));\n /* @cssprop [--vvd-alert-information-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-information-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-alert-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-alert-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-alert-alert-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-alert-primary-text, var(--vvd-color-canvas));\n}\n.base.connotation-warning {\n /* @cssprop [--vvd-alert-warning-primary=var(--vvd-color-warning-300)] */\n --_connotation-color-primary: var(--vvd-alert-warning-primary, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-alert-warning-primary-text=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary-text: var(--vvd-alert-warning-primary-text, var(--vvd-color-canvas-text));\n}\n.base:not(.connotation-success, .connotation-information, .connotation-alert, .connotation-warning) {\n /* @cssprop [--vvd-alert-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-alert-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-alert-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-alert-accent-primary-text, var(--vvd-color-canvas));\n}\n.base {\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 .alert-text {\n margin-inline-end: auto;\n}\n.base .alert-text .headline {\n font: var(--vvd-typography-base-bold);\n margin-block-end: 4px;\n}\n.base .alert-text .main-text {\n font: var(--vvd-typography-base);\n}\n.base .icon {\n flex-shrink: 0;\n color: var(--_appearance-color-fill);\n font-size: 24px;\n line-height: 1;\n}\n.base .dismiss-button {\n border-left: 1px solid var(--vvd-color-neutral-200);\n padding-inline-start: 8px;\n}";
14
14
 
15
15
  var _Alert_instances, _Alert_timeoutID, _Alert_setupTimeout, _Alert_closeOnEscape;
16
16
  const connotationIconMap = new Map([[Connotation.Accent, 'megaphone-line'], [Connotation.Information, 'info-line'], [Connotation.Success, 'check-circle-line'], [Connotation.Warning, 'warning-line'], [Connotation.Alert, 'error-line']]);