@vonage/vivid 3.32.0 → 3.35.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 (221) hide show
  1. package/accordion/index.js +5 -5
  2. package/accordion-item/index.js +4 -4
  3. package/action-group/index.js +1 -1
  4. package/alert/index.js +6 -6
  5. package/avatar/index.js +2 -2
  6. package/badge/index.js +2 -2
  7. package/banner/index.js +5 -5
  8. package/breadcrumb/index.js +1 -1
  9. package/breadcrumb-item/index.js +3 -3
  10. package/button/index.js +4 -4
  11. package/calendar/index.js +1 -1
  12. package/calendar-event/index.js +1 -1
  13. package/card/index.js +3 -3
  14. package/checkbox/index.js +5 -3
  15. package/combobox/index.js +8 -8
  16. package/custom-elements.json +256 -18
  17. package/data-grid/index.js +2 -2
  18. package/date-picker/index.js +9 -9
  19. package/dialog/index.js +6 -6
  20. package/divider/index.js +1 -1
  21. package/elevation/index.js +1 -1
  22. package/empty-state/index.js +2 -2
  23. package/fab/index.js +4 -4
  24. package/file-picker/index.js +5 -5
  25. package/focus/index.js +1 -1
  26. package/header/index.js +2 -2
  27. package/icon/index.js +1 -1
  28. package/index.js +59 -59
  29. package/layout/index.js +1 -1
  30. package/lib/avatar/avatar.d.ts +1 -1
  31. package/lib/calendar/calendar.d.ts +1 -1
  32. package/lib/date-picker/calendar/dateStr.d.ts +1 -0
  33. package/lib/date-picker/calendar/month.d.ts +1 -0
  34. package/lib/date-picker/calendar/year.d.ts +2 -0
  35. package/lib/date-picker/date-picker.d.ts +2 -0
  36. package/lib/icon/icon.d.ts +0 -1
  37. package/lib/listbox/listbox.d.ts +9 -1
  38. package/lib/progress-ring/progress-ring.d.ts +1 -1
  39. package/lib/text-field/text-field.d.ts +1 -0
  40. package/listbox/index.js +20 -16
  41. package/locales/en-GB.js +48 -14
  42. package/locales/en-US.js +48 -14
  43. package/locales/ja-JP.js +48 -14
  44. package/locales/zh-CN.js +48 -14
  45. package/menu/index.js +8 -8
  46. package/menu-item/index.js +4 -4
  47. package/nav/index.js +1 -1
  48. package/nav-disclosure/index.js +3 -3
  49. package/nav-item/index.js +3 -3
  50. package/note/index.js +2 -3
  51. package/number-field/index.js +6 -6
  52. package/option/index.js +3 -3
  53. package/package.json +2 -16
  54. package/pagination/index.js +5 -5
  55. package/popup/index.js +6 -6
  56. package/progress/index.js +1 -1
  57. package/progress-ring/index.js +1 -1
  58. package/radio/index.js +2 -2
  59. package/radio-group/index.js +1 -1
  60. package/select/index.js +8 -8
  61. package/shared/affix.js +25 -9
  62. package/shared/apply-mixins.js +1 -1
  63. package/shared/breadcrumb-item.js +5 -5
  64. package/shared/button.js +13 -13
  65. package/shared/calendar-event.js +36 -16
  66. package/shared/definition.js +133 -194
  67. package/shared/definition10.js +225 -40
  68. package/shared/definition11.js +36 -32
  69. package/shared/definition12.js +763 -98
  70. package/shared/definition13.js +125 -89
  71. package/shared/definition14.js +207 -27
  72. package/shared/definition15.js +710 -731
  73. package/shared/definition16.js +1289 -47
  74. package/shared/definition17.js +6113 -93
  75. package/shared/definition18.js +242 -164
  76. package/shared/definition19.js +47 -692
  77. package/shared/definition2.js +199 -117
  78. package/shared/definition20.js +59 -1671
  79. package/shared/definition21.js +95 -255
  80. package/shared/definition22.js +2218 -1167
  81. package/shared/definition23.js +61 -5784
  82. package/shared/definition24.js +28 -117
  83. package/shared/definition25.js +52 -66
  84. package/shared/definition26.js +391 -214
  85. package/shared/definition27.js +441 -34
  86. package/shared/definition28.js +85 -73
  87. package/shared/definition29.js +21 -2283
  88. package/shared/definition3.js +61 -24
  89. package/shared/definition30.js +13 -49
  90. package/shared/definition31.js +54 -39
  91. package/shared/definition32.js +413 -375
  92. package/shared/definition33.js +223 -304
  93. package/shared/definition34.js +197 -13
  94. package/shared/definition35.js +88 -73
  95. package/shared/definition36.js +75 -25
  96. package/shared/definition37.js +434 -34
  97. package/shared/definition38.js +32 -432
  98. package/shared/definition39.js +677 -187
  99. package/shared/definition4.js +157 -12
  100. package/shared/definition40.js +95 -48
  101. package/shared/definition41.js +577 -31
  102. package/shared/definition42.js +126 -424
  103. package/shared/definition43.js +114 -618
  104. package/shared/definition44.js +24 -80
  105. package/shared/definition45.js +71 -543
  106. package/shared/definition46.js +499 -92
  107. package/shared/definition47.js +19 -133
  108. package/shared/definition48.js +129 -52
  109. package/shared/definition49.js +281 -17
  110. package/shared/definition5.js +71 -36
  111. package/shared/definition50.js +153 -484
  112. package/shared/definition51.js +131 -98
  113. package/shared/definition52.js +131 -16
  114. package/shared/definition53.js +80 -264
  115. package/shared/definition54.js +293 -118
  116. package/shared/definition55.js +12 -117
  117. package/shared/definition56.js +39 -68
  118. package/shared/definition57.js +166 -288
  119. package/shared/definition6.js +56 -111
  120. package/shared/definition7.js +120 -195
  121. package/shared/definition8.js +58 -23
  122. package/shared/definition9.js +92 -66
  123. package/shared/focus.js +2 -1
  124. package/shared/focus2.js +1 -1
  125. package/shared/form-associated.js +2 -2
  126. package/shared/icon.js +48 -27
  127. package/shared/index.js +7 -27
  128. package/shared/index2.js +108 -80
  129. package/shared/key-codes.js +1 -1
  130. package/shared/listbox.js +88 -11
  131. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  132. package/shared/radio.js +23 -7
  133. package/shared/repeat.js +1 -1
  134. package/shared/text-anchor.js +21 -4
  135. package/shared/text-anchor.template.js +37 -40
  136. package/shared/text-field.js +2 -2
  137. package/shared/text-field2.js +15 -15
  138. package/shared/tree-item.js +12 -12
  139. package/side-drawer/index.js +1 -1
  140. package/slider/index.js +2 -2
  141. package/split-button/index.js +3 -3
  142. package/style.css +6106 -0
  143. package/styles/core/all.css +1 -1
  144. package/styles/core/theme.css +1 -1
  145. package/styles/core/typography.css +1 -1
  146. package/styles/tokens/theme-dark.css +4 -4
  147. package/styles/tokens/theme-light.css +4 -4
  148. package/styles/tokens/vivid-2-compat.css +1 -1
  149. package/switch/index.js +3 -3
  150. package/tab/index.js +3 -3
  151. package/tab-panel/index.js +1 -1
  152. package/tabs/index.js +5 -5
  153. package/tag/index.js +3 -3
  154. package/tag-group/index.js +1 -1
  155. package/text-anchor/index.js +1 -1
  156. package/text-area/index.js +3 -3
  157. package/text-field/index.js +3 -3
  158. package/toggletip/index.js +7 -7
  159. package/tooltip/index.js +7 -7
  160. package/tree-item/index.js +3 -3
  161. package/tree-view/index.js +1 -1
  162. package/vivid.api.json +10 -1
  163. package/lib/accordion/index.d.ts +0 -1
  164. package/lib/accordion-item/index.d.ts +0 -1
  165. package/lib/action-group/index.d.ts +0 -1
  166. package/lib/alert/index.d.ts +0 -1
  167. package/lib/avatar/index.d.ts +0 -1
  168. package/lib/badge/index.d.ts +0 -1
  169. package/lib/banner/index.d.ts +0 -1
  170. package/lib/breadcrumb/index.d.ts +0 -1
  171. package/lib/breadcrumb-item/index.d.ts +0 -1
  172. package/lib/button/index.d.ts +0 -1
  173. package/lib/calendar/index.d.ts +0 -1
  174. package/lib/calendar-event/index.d.ts +0 -1
  175. package/lib/card/index.d.ts +0 -1
  176. package/lib/checkbox/index.d.ts +0 -1
  177. package/lib/combobox/index.d.ts +0 -1
  178. package/lib/data-grid/index.d.ts +0 -1
  179. package/lib/date-picker/index.d.ts +0 -1
  180. package/lib/dialog/index.d.ts +0 -1
  181. package/lib/divider/index.d.ts +0 -1
  182. package/lib/elevation/index.d.ts +0 -1
  183. package/lib/empty-state/index.d.ts +0 -1
  184. package/lib/fab/index.d.ts +0 -1
  185. package/lib/file-picker/index.d.ts +0 -1
  186. package/lib/focus/index.d.ts +0 -1
  187. package/lib/header/index.d.ts +0 -1
  188. package/lib/icon/index.d.ts +0 -1
  189. package/lib/layout/index.d.ts +0 -1
  190. package/lib/listbox/index.d.ts +0 -1
  191. package/lib/menu/index.d.ts +0 -1
  192. package/lib/menu-item/index.d.ts +0 -1
  193. package/lib/nav/index.d.ts +0 -1
  194. package/lib/nav-disclosure/index.d.ts +0 -1
  195. package/lib/nav-item/index.d.ts +0 -1
  196. package/lib/note/index.d.ts +0 -1
  197. package/lib/number-field/index.d.ts +0 -1
  198. package/lib/option/index.d.ts +0 -1
  199. package/lib/pagination/index.d.ts +0 -1
  200. package/lib/popup/index.d.ts +0 -1
  201. package/lib/progress/index.d.ts +0 -1
  202. package/lib/progress-ring/index.d.ts +0 -1
  203. package/lib/radio/index.d.ts +0 -1
  204. package/lib/radio-group/index.d.ts +0 -1
  205. package/lib/select/index.d.ts +0 -1
  206. package/lib/side-drawer/index.d.ts +0 -1
  207. package/lib/slider/index.d.ts +0 -1
  208. package/lib/split-button/index.d.ts +0 -1
  209. package/lib/switch/index.d.ts +0 -1
  210. package/lib/tab/index.d.ts +0 -1
  211. package/lib/tab-panel/index.d.ts +0 -1
  212. package/lib/tabs/index.d.ts +0 -1
  213. package/lib/tag/index.d.ts +0 -1
  214. package/lib/tag-group/index.d.ts +0 -1
  215. package/lib/text-anchor/index.d.ts +0 -1
  216. package/lib/text-area/index.d.ts +0 -1
  217. package/lib/text-field/index.d.ts +0 -1
  218. package/lib/toggletip/index.d.ts +0 -1
  219. package/lib/tooltip/index.d.ts +0 -1
  220. package/lib/tree-item/index.d.ts +0 -1
  221. package/lib/tree-view/index.d.ts +0 -1
@@ -1,147 +1,229 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumberConverter, 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 { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
5
- import { S as StartEnd } from './start-end.js';
6
- import { a as applyMixins } from './apply-mixins.js';
7
- import { f as focusTemplateFactory } from './focus2.js';
8
- import { r as ref } from './ref.js';
9
- import { w as when } from './when.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
+ import { A as AccordionItem$1, b as accordionItemRegistries } from './definition.js';
3
+ import { b as keyEnd, c as keyHome, d as keyArrowDown, e as keyArrowUp } from './key-codes.js';
4
+ import { w as wrapInBounds } from './numbers.js';
5
+ import { e as elements } from './node-observation.js';
6
+ import { s as slotted } from './slotted.js';
7
+ import { c as classNames } from './class-names.js';
10
8
 
11
9
  /**
12
- * An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
13
- *
14
- * @slot start - Content which can be provided between the heading and the icon
15
- * @slot end - Content which can be provided between the start slot and icon
16
- * @slot heading - Content which serves as the accordion item heading and text of the expand button
17
- * @slot - The default slot for accordion item content
18
- * @slot expanded-icon - The expanded icon
19
- * @slot collapsed-icon - The collapsed icon
20
- * @fires change - Fires a custom 'change' event when the button is invoked
21
- * @csspart heading - Wraps the button
22
- * @csspart button - The button which serves to invoke the item
23
- * @csspart heading-content - Wraps the slot for the heading content within the button
24
- * @csspart icon - The icon container
25
- * @csspart expanded-icon - The expanded icon slot
26
- * @csspart collapsed-icon - The collapsed icon
27
- * @csspart region - The wrapper for the accordion item content
10
+ * Expand mode for {@link Accordion}
11
+ * @public
12
+ */
13
+ const AccordionExpandMode = {
14
+ /**
15
+ * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.
16
+ */
17
+ single: "single",
18
+ /**
19
+ * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously.
20
+ */
21
+ multi: "multi",
22
+ };
23
+ /**
24
+ * An Accordion Custom HTML Element
25
+ * Implements {@link https://www.w3.org/TR/wai-aria-practices-1.1/#accordion | ARIA Accordion}.
28
26
  *
27
+ * @fires change - Fires a custom 'change' event when the active item changes
28
+ * @csspart item - The slot for the accordion items
29
29
  * @public
30
+ *
31
+ * @remarks
32
+ * Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(AccordionItem:class)}.
30
33
  */
31
- class AccordionItem$1 extends FoundationElement {
34
+ let Accordion$1 = class Accordion extends FoundationElement {
32
35
  constructor() {
33
36
  super(...arguments);
34
37
  /**
35
- * Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
36
- * heading element.
37
- *
38
- * @defaultValue 2
38
+ * Controls the expand mode of the Accordion, either allowing
39
+ * single or multiple item expansion.
39
40
  * @public
40
- * @remarks
41
- * HTML attribute: heading-level
42
- */
43
- this.headinglevel = 2;
44
- /**
45
- * Expands or collapses the item.
46
41
  *
47
- * @public
48
42
  * @remarks
49
- * HTML attribute: expanded
50
- */
51
- this.expanded = false;
52
- /**
53
- * @internal
43
+ * HTML attribute: expand-mode
54
44
  */
55
- this.clickHandler = (e) => {
56
- this.expanded = !this.expanded;
45
+ this.expandmode = AccordionExpandMode.multi;
46
+ this.activeItemIndex = 0;
47
+ this.change = () => {
48
+ this.$emit("change", this.activeid);
49
+ };
50
+ this.setItems = () => {
51
+ var _a;
52
+ if (this.accordionItems.length === 0) {
53
+ return;
54
+ }
55
+ this.accordionIds = this.getItemIds();
56
+ this.accordionItems.forEach((item, index) => {
57
+ if (item instanceof AccordionItem$1) {
58
+ item.addEventListener("change", this.activeItemChange);
59
+ if (this.isSingleExpandMode()) {
60
+ this.activeItemIndex !== index
61
+ ? (item.expanded = false)
62
+ : (item.expanded = true);
63
+ }
64
+ }
65
+ const itemId = this.accordionIds[index];
66
+ item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId);
67
+ this.activeid = this.accordionIds[this.activeItemIndex];
68
+ item.addEventListener("keydown", this.handleItemKeyDown);
69
+ item.addEventListener("focus", this.handleItemFocus);
70
+ });
71
+ if (this.isSingleExpandMode()) {
72
+ const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0];
73
+ expandedItem.setAttribute("aria-disabled", "true");
74
+ }
75
+ };
76
+ this.removeItemListeners = (oldValue) => {
77
+ oldValue.forEach((item, index) => {
78
+ item.removeEventListener("change", this.activeItemChange);
79
+ item.removeEventListener("keydown", this.handleItemKeyDown);
80
+ item.removeEventListener("focus", this.handleItemFocus);
81
+ });
82
+ };
83
+ this.activeItemChange = (event) => {
84
+ if (event.defaultPrevented || event.target !== event.currentTarget) {
85
+ return;
86
+ }
87
+ event.preventDefault();
88
+ const selectedItem = event.target;
89
+ this.activeid = selectedItem.getAttribute("id");
90
+ if (this.isSingleExpandMode()) {
91
+ this.resetItems();
92
+ selectedItem.expanded = true;
93
+ selectedItem.setAttribute("aria-disabled", "true");
94
+ this.accordionItems.forEach((item) => {
95
+ if (!item.hasAttribute("disabled") && item.id !== this.activeid) {
96
+ item.removeAttribute("aria-disabled");
97
+ }
98
+ });
99
+ }
100
+ this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem);
57
101
  this.change();
58
102
  };
59
- this.change = () => {
60
- this.$emit("change");
103
+ this.handleItemKeyDown = (event) => {
104
+ // only handle the keydown if the event target is the accordion item
105
+ // prevents arrow keys from moving focus to accordion headers when focus is on accordion item panel content
106
+ if (event.target !== event.currentTarget) {
107
+ return;
108
+ }
109
+ this.accordionIds = this.getItemIds();
110
+ switch (event.key) {
111
+ case keyArrowUp:
112
+ event.preventDefault();
113
+ this.adjust(-1);
114
+ break;
115
+ case keyArrowDown:
116
+ event.preventDefault();
117
+ this.adjust(1);
118
+ break;
119
+ case keyHome:
120
+ this.activeItemIndex = 0;
121
+ this.focusItem();
122
+ break;
123
+ case keyEnd:
124
+ this.activeItemIndex = this.accordionItems.length - 1;
125
+ this.focusItem();
126
+ break;
127
+ }
128
+ };
129
+ this.handleItemFocus = (event) => {
130
+ // update the active item index if the focus moves to an accordion item via a different method other than the up and down arrow key actions
131
+ // only do so if the focus is actually on the accordion item and not on any of its children
132
+ if (event.target === event.currentTarget) {
133
+ const focusedItem = event.target;
134
+ const focusedIndex = (this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem));
135
+ if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) {
136
+ this.activeItemIndex = focusedIndex;
137
+ this.activeid = this.accordionIds[this.activeItemIndex];
138
+ }
139
+ }
61
140
  };
62
141
  }
63
- }
64
- __decorate([
65
- attr({
66
- attribute: "heading-level",
67
- mode: "fromView",
68
- converter: nullableNumberConverter,
69
- })
70
- ], AccordionItem$1.prototype, "headinglevel", void 0);
142
+ /**
143
+ * @internal
144
+ */
145
+ accordionItemsChanged(oldValue, newValue) {
146
+ if (this.$fastController.isConnected) {
147
+ this.removeItemListeners(oldValue);
148
+ this.setItems();
149
+ }
150
+ }
151
+ findExpandedItem() {
152
+ for (let item = 0; item < this.accordionItems.length; item++) {
153
+ if (this.accordionItems[item].getAttribute("expanded") === "true") {
154
+ return this.accordionItems[item];
155
+ }
156
+ }
157
+ return null;
158
+ }
159
+ resetItems() {
160
+ this.accordionItems.forEach((item, index) => {
161
+ item.expanded = false;
162
+ });
163
+ }
164
+ getItemIds() {
165
+ return this.accordionItems.map((accordionItem) => {
166
+ return accordionItem.getAttribute("id");
167
+ });
168
+ }
169
+ isSingleExpandMode() {
170
+ return this.expandmode === AccordionExpandMode.single;
171
+ }
172
+ adjust(adjustment) {
173
+ this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment);
174
+ this.focusItem();
175
+ }
176
+ focusItem() {
177
+ const element = this.accordionItems[this.activeItemIndex];
178
+ if (element instanceof AccordionItem$1) {
179
+ element.expandbutton.focus();
180
+ }
181
+ }
182
+ };
71
183
  __decorate([
72
- attr({ mode: "boolean" })
73
- ], AccordionItem$1.prototype, "expanded", void 0);
184
+ attr({ attribute: "expand-mode" })
185
+ ], Accordion$1.prototype, "expandmode", void 0);
74
186
  __decorate([
75
- attr
76
- ], AccordionItem$1.prototype, "id", void 0);
77
- applyMixins(AccordionItem$1, StartEnd);
187
+ observable
188
+ ], Accordion$1.prototype, "accordionItems", void 0);
78
189
 
79
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n:host {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n.heading-container {\n margin: 0;\n}\n\n.heading-button {\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 16px;\n border: none;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n cursor: pointer;\n text-align: left;\n}\n.heading-button {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.heading-button: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.heading-button: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.heading-button {\n /* @cssprop [--vvd-accordion-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-accordion-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-accordion-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-accordion-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports selector(:focus-visible) {\n .heading-button:focus-visible {\n outline: none;\n }\n}\n.heading-button.size-condensed {\n font: var(--vvd-typography-base-bold);\n gap: 12px;\n}\n.heading-button:not(.size-condensed) {\n font: var(--vvd-typography-heading-4);\n gap: 16px;\n}\n\n.heading-content {\n flex: auto;\n}\n\n.meta {\n overflow: hidden;\n max-width: 20%;\n flex-shrink: 0;\n color: var(--vvd-color-neutral-600);\n text-align: end;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.heading-button:not(.size-condensed) .meta {\n font: var(--vvd-typography-base-bold);\n}\n.heading-button.size-condensed .meta {\n font: var(--vvd-typography-base-condensed-bold);\n}\n\n.region {\n display: none;\n padding: 8px 32px 24px 16px;\n}\n.region:not(.size-condensed).padded {\n padding-inline-start: 52px;\n}\n:host([expanded]) .region {\n display: block;\n}\n.region.size-condensed.padded {\n padding-inline-start: 44px;\n}\n\n.icon {\n color: var(--vvd-color-neutral-600);\n}\n.heading-button:not(.size-condensed) .icon {\n font: inherit;\n}\n.heading-button.size-condensed .icon {\n font: var(--vvd-typography-base-extended);\n}\n:host(:not([icon-trailing])) .icon:last-of-type {\n color: var(--_appearance-color-text);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n}\nbutton:not(:focus-visible) > .focus-indicator {\n display: none;\n}";
190
+ const styles = "/**\n * Do not edit directly\n * Generated on Wed, 06 Sep 2023 09:40:36 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n::slotted(:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
80
191
 
81
- class AccordionItem extends AccordionItem$1 {
192
+ class Accordion extends Accordion$1 {
82
193
  constructor() {
83
194
  super(...arguments);
84
- this.noIndicator = false;
195
+ /**
196
+ * Controls the expand mode of the Accordion, either allowing
197
+ * single or multiple item expansion.
198
+ * @public
199
+ *
200
+ * @remarks
201
+ * HTML attribute: expand-mode
202
+ */
203
+ this.expandmode = AccordionExpandMode.single;
204
+ }
205
+ closeAll() {
206
+ if (this.expandmode === AccordionExpandMode.multi) {
207
+ this.accordionItems.forEach((item) => {
208
+ item.expanded = false;
209
+ });
210
+ }
85
211
  }
86
212
  }
87
- __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "heading", void 0);
88
- __decorate([attr({
89
- mode: 'boolean',
90
- attribute: 'no-indicator'
91
- }), __metadata("design:type", Object)], AccordionItem.prototype, "noIndicator", void 0);
92
- __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "meta", void 0);
93
- __decorate([attr, __metadata("design:type", String)], AccordionItem.prototype, "size", void 0);
94
- applyMixins(AccordionItem, AffixIconWithTrailing);
95
-
96
- const header = (context, hTag) => {
97
- const affixIconTemplate = affixIconTemplateFactory(context);
98
- const focusTemplate = focusTemplateFactory(context);
99
- return html`
100
- <${hTag} class="heading-container">
101
- <button
102
- class="heading-button ${x => x.size ? `size-${x.size}` : ''}"
103
- id="${x => x.id}"
104
- aria-expanded="${x => x.expanded}"
105
- aria-controls="${x => x.id}-panel"
106
- @click="${(x, c) => x.clickHandler(c.event)}"
107
- ${ref('expandbutton')}
108
- >
109
- ${() => focusTemplate}
110
-
111
- ${x => x.icon && !x.iconTrailing ? affixIconTemplate(x.icon) : null}
112
-
113
- <span class="heading-content">${x => x.heading}</span>
114
213
 
115
- ${when(x => x.meta, html`<span class="meta">${x => x.meta}</span>`)}
116
-
117
- ${x => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
118
- ${x => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(x.expanded ? 'chevron-up-solid' : 'chevron-down-solid') : null}
119
-
120
- </button>
121
- </${hTag}>
122
- `;
123
- };
124
- const AccordionItemTemplate = context => html`
125
- ${x => header(context, 'h' + x.headinglevel)}
126
- <div
127
- id="${x => x.id}-panel"
128
- aria-labelledby="${x => x.id}"
129
- role="region"
130
- class="region ${x => x.icon && !x.iconTrailing ? 'padded' : ''} ${x => x.size ? `size-${x.size}` : ''}"
131
- >
132
- <slot></slot>
214
+ const getClasses = (_) => classNames("base");
215
+ const AccordionTemplate = () => html`
216
+ <div class="${getClasses}">
217
+ <slot ${slotted({ property: "accordionItems", filter: elements() })}></slot>
133
218
  </div>
134
219
  `;
135
220
 
136
- const accordionItemDefinition = AccordionItem.compose({
137
- baseName: 'accordion-item',
138
- template: AccordionItemTemplate,
139
- styles: css_248z,
140
- shadowOptions: {
141
- delegatesFocus: true
142
- }
221
+ const accordionDefinition = Accordion.compose({
222
+ baseName: "accordion",
223
+ template: AccordionTemplate,
224
+ styles
143
225
  });
144
- const accordionItemRegistries = [accordionItemDefinition(), ...iconRegistries, ...focusRegistries];
145
- const registerAccordionItem = registerFactory(accordionItemRegistries);
226
+ const accordionRegistries = [accordionDefinition(), ...accordionItemRegistries];
227
+ const registerAccordion = registerFactory(accordionRegistries);
146
228
 
147
- export { AccordionItem$1 as A, accordionItemRegistries as a, accordionItemDefinition as b, registerAccordionItem as r };
229
+ export { accordionDefinition as a, accordionRegistries as b, registerAccordion as r };