@vonage/vivid 3.32.0 → 3.34.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 (218) 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 +246 -16
  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/calendar/calendar.d.ts +1 -1
  31. package/lib/date-picker/calendar/dateStr.d.ts +1 -0
  32. package/lib/date-picker/calendar/month.d.ts +1 -0
  33. package/lib/date-picker/calendar/year.d.ts +2 -0
  34. package/lib/date-picker/date-picker.d.ts +2 -0
  35. package/lib/icon/icon.d.ts +0 -1
  36. package/lib/listbox/listbox.d.ts +9 -1
  37. package/lib/text-field/text-field.d.ts +1 -0
  38. package/listbox/index.js +20 -16
  39. package/locales/en-GB.js +48 -14
  40. package/locales/en-US.js +48 -14
  41. package/locales/ja-JP.js +48 -14
  42. package/locales/zh-CN.js +48 -14
  43. package/menu/index.js +8 -8
  44. package/menu-item/index.js +4 -4
  45. package/nav/index.js +1 -1
  46. package/nav-disclosure/index.js +3 -3
  47. package/nav-item/index.js +3 -3
  48. package/note/index.js +2 -3
  49. package/number-field/index.js +6 -6
  50. package/option/index.js +3 -3
  51. package/package.json +2 -16
  52. package/pagination/index.js +5 -5
  53. package/popup/index.js +6 -6
  54. package/progress/index.js +1 -1
  55. package/progress-ring/index.js +1 -1
  56. package/radio/index.js +2 -2
  57. package/radio-group/index.js +1 -1
  58. package/select/index.js +8 -8
  59. package/shared/affix.js +25 -9
  60. package/shared/apply-mixins.js +1 -1
  61. package/shared/breadcrumb-item.js +5 -5
  62. package/shared/button.js +13 -13
  63. package/shared/calendar-event.js +36 -16
  64. package/shared/definition.js +133 -194
  65. package/shared/definition10.js +225 -40
  66. package/shared/definition11.js +36 -32
  67. package/shared/definition12.js +763 -98
  68. package/shared/definition13.js +125 -89
  69. package/shared/definition14.js +207 -27
  70. package/shared/definition15.js +710 -731
  71. package/shared/definition16.js +1289 -47
  72. package/shared/definition17.js +6113 -93
  73. package/shared/definition18.js +242 -164
  74. package/shared/definition19.js +47 -692
  75. package/shared/definition2.js +199 -117
  76. package/shared/definition20.js +59 -1671
  77. package/shared/definition21.js +95 -255
  78. package/shared/definition22.js +2218 -1167
  79. package/shared/definition23.js +61 -5784
  80. package/shared/definition24.js +28 -117
  81. package/shared/definition25.js +52 -66
  82. package/shared/definition26.js +391 -214
  83. package/shared/definition27.js +441 -34
  84. package/shared/definition28.js +85 -73
  85. package/shared/definition29.js +21 -2283
  86. package/shared/definition3.js +61 -24
  87. package/shared/definition30.js +13 -49
  88. package/shared/definition31.js +54 -39
  89. package/shared/definition32.js +413 -375
  90. package/shared/definition33.js +223 -304
  91. package/shared/definition34.js +197 -13
  92. package/shared/definition35.js +88 -73
  93. package/shared/definition36.js +75 -25
  94. package/shared/definition37.js +434 -34
  95. package/shared/definition38.js +32 -432
  96. package/shared/definition39.js +677 -187
  97. package/shared/definition4.js +157 -12
  98. package/shared/definition40.js +95 -48
  99. package/shared/definition41.js +577 -31
  100. package/shared/definition42.js +126 -424
  101. package/shared/definition43.js +114 -618
  102. package/shared/definition44.js +24 -80
  103. package/shared/definition45.js +71 -543
  104. package/shared/definition46.js +499 -92
  105. package/shared/definition47.js +19 -133
  106. package/shared/definition48.js +129 -52
  107. package/shared/definition49.js +281 -17
  108. package/shared/definition5.js +71 -36
  109. package/shared/definition50.js +153 -484
  110. package/shared/definition51.js +131 -98
  111. package/shared/definition52.js +131 -16
  112. package/shared/definition53.js +80 -264
  113. package/shared/definition54.js +293 -118
  114. package/shared/definition55.js +12 -117
  115. package/shared/definition56.js +39 -68
  116. package/shared/definition57.js +166 -288
  117. package/shared/definition6.js +56 -111
  118. package/shared/definition7.js +120 -195
  119. package/shared/definition8.js +58 -23
  120. package/shared/definition9.js +92 -66
  121. package/shared/focus.js +2 -1
  122. package/shared/focus2.js +1 -1
  123. package/shared/form-associated.js +2 -2
  124. package/shared/icon.js +48 -27
  125. package/shared/index.js +7 -27
  126. package/shared/index2.js +108 -80
  127. package/shared/key-codes.js +1 -1
  128. package/shared/listbox.js +88 -11
  129. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  130. package/shared/radio.js +23 -7
  131. package/shared/repeat.js +1 -1
  132. package/shared/text-anchor.js +21 -4
  133. package/shared/text-anchor.template.js +37 -40
  134. package/shared/text-field.js +2 -2
  135. package/shared/text-field2.js +15 -15
  136. package/shared/tree-item.js +12 -12
  137. package/side-drawer/index.js +1 -1
  138. package/slider/index.js +2 -2
  139. package/split-button/index.js +3 -3
  140. package/style.css +6097 -0
  141. package/styles/core/all.css +1 -1
  142. package/styles/core/theme.css +1 -1
  143. package/styles/core/typography.css +1 -1
  144. package/styles/tokens/theme-dark.css +4 -4
  145. package/styles/tokens/theme-light.css +4 -4
  146. package/styles/tokens/vivid-2-compat.css +1 -1
  147. package/switch/index.js +3 -3
  148. package/tab/index.js +3 -3
  149. package/tab-panel/index.js +1 -1
  150. package/tabs/index.js +5 -5
  151. package/tag/index.js +3 -3
  152. package/tag-group/index.js +1 -1
  153. package/text-anchor/index.js +1 -1
  154. package/text-area/index.js +3 -3
  155. package/text-field/index.js +3 -3
  156. package/toggletip/index.js +7 -7
  157. package/tooltip/index.js +7 -7
  158. package/tree-item/index.js +3 -3
  159. package/tree-view/index.js +1 -1
  160. package/lib/accordion/index.d.ts +0 -1
  161. package/lib/accordion-item/index.d.ts +0 -1
  162. package/lib/action-group/index.d.ts +0 -1
  163. package/lib/alert/index.d.ts +0 -1
  164. package/lib/avatar/index.d.ts +0 -1
  165. package/lib/badge/index.d.ts +0 -1
  166. package/lib/banner/index.d.ts +0 -1
  167. package/lib/breadcrumb/index.d.ts +0 -1
  168. package/lib/breadcrumb-item/index.d.ts +0 -1
  169. package/lib/button/index.d.ts +0 -1
  170. package/lib/calendar/index.d.ts +0 -1
  171. package/lib/calendar-event/index.d.ts +0 -1
  172. package/lib/card/index.d.ts +0 -1
  173. package/lib/checkbox/index.d.ts +0 -1
  174. package/lib/combobox/index.d.ts +0 -1
  175. package/lib/data-grid/index.d.ts +0 -1
  176. package/lib/date-picker/index.d.ts +0 -1
  177. package/lib/dialog/index.d.ts +0 -1
  178. package/lib/divider/index.d.ts +0 -1
  179. package/lib/elevation/index.d.ts +0 -1
  180. package/lib/empty-state/index.d.ts +0 -1
  181. package/lib/fab/index.d.ts +0 -1
  182. package/lib/file-picker/index.d.ts +0 -1
  183. package/lib/focus/index.d.ts +0 -1
  184. package/lib/header/index.d.ts +0 -1
  185. package/lib/icon/index.d.ts +0 -1
  186. package/lib/layout/index.d.ts +0 -1
  187. package/lib/listbox/index.d.ts +0 -1
  188. package/lib/menu/index.d.ts +0 -1
  189. package/lib/menu-item/index.d.ts +0 -1
  190. package/lib/nav/index.d.ts +0 -1
  191. package/lib/nav-disclosure/index.d.ts +0 -1
  192. package/lib/nav-item/index.d.ts +0 -1
  193. package/lib/note/index.d.ts +0 -1
  194. package/lib/number-field/index.d.ts +0 -1
  195. package/lib/option/index.d.ts +0 -1
  196. package/lib/pagination/index.d.ts +0 -1
  197. package/lib/popup/index.d.ts +0 -1
  198. package/lib/progress/index.d.ts +0 -1
  199. package/lib/progress-ring/index.d.ts +0 -1
  200. package/lib/radio/index.d.ts +0 -1
  201. package/lib/radio-group/index.d.ts +0 -1
  202. package/lib/select/index.d.ts +0 -1
  203. package/lib/side-drawer/index.d.ts +0 -1
  204. package/lib/slider/index.d.ts +0 -1
  205. package/lib/split-button/index.d.ts +0 -1
  206. package/lib/switch/index.d.ts +0 -1
  207. package/lib/tab/index.d.ts +0 -1
  208. package/lib/tab-panel/index.d.ts +0 -1
  209. package/lib/tabs/index.d.ts +0 -1
  210. package/lib/tag/index.d.ts +0 -1
  211. package/lib/tag-group/index.d.ts +0 -1
  212. package/lib/text-anchor/index.d.ts +0 -1
  213. package/lib/text-area/index.d.ts +0 -1
  214. package/lib/text-field/index.d.ts +0 -1
  215. package/lib/toggletip/index.d.ts +0 -1
  216. package/lib/tooltip/index.d.ts +0 -1
  217. package/lib/tree-item/index.d.ts +0 -1
  218. package/lib/tree-view/index.d.ts +0 -1
@@ -1,19 +1,39 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, n as nullableNumberConverter } from './index.js';
1
+ import { a as attr, F as FoundationElement, n as nullableNumberConverter } from './index.js';
2
2
 
3
- class CalendarEvent extends FoundationElement {}
4
- __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "heading", void 0);
5
- __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "description", void 0);
6
- __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "connotation", void 0);
7
- __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "appearance", void 0);
8
- __decorate([attr({
9
- converter: nullableNumberConverter,
10
- attribute: 'overlap-count'
11
- }), __metadata("design:type", Number)], CalendarEvent.prototype, "overlapCount", void 0);
12
- __decorate([attr({
13
- converter: nullableNumberConverter
14
- }), __metadata("design:type", Number)], CalendarEvent.prototype, "start", void 0);
15
- __decorate([attr({
16
- converter: nullableNumberConverter
17
- }), __metadata("design:type", Number)], CalendarEvent.prototype, "duration", void 0);
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __decorateClass = (decorators, target, key, kind) => {
6
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
7
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
+ if (decorator = decorators[i])
9
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10
+ if (kind && result)
11
+ __defProp(target, key, result);
12
+ return result;
13
+ };
14
+ class CalendarEvent extends FoundationElement {
15
+ // TODO should be converted to allowed range
16
+ }
17
+ __decorateClass([
18
+ attr
19
+ ], CalendarEvent.prototype, "heading", 2);
20
+ __decorateClass([
21
+ attr
22
+ ], CalendarEvent.prototype, "description", 2);
23
+ __decorateClass([
24
+ attr
25
+ ], CalendarEvent.prototype, "connotation", 2);
26
+ __decorateClass([
27
+ attr
28
+ ], CalendarEvent.prototype, "appearance", 2);
29
+ __decorateClass([
30
+ attr({ converter: nullableNumberConverter, attribute: "overlap-count" })
31
+ ], CalendarEvent.prototype, "overlapCount", 2);
32
+ __decorateClass([
33
+ attr({ converter: nullableNumberConverter })
34
+ ], CalendarEvent.prototype, "start", 2);
35
+ __decorateClass([
36
+ attr({ converter: nullableNumberConverter })
37
+ ], CalendarEvent.prototype, "duration", 2);
18
38
 
19
39
  export { CalendarEvent as C };
@@ -1,224 +1,163 @@
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, a as accordionItemRegistries } from './definition2.js';
3
- import { k as keyEnd, a as keyHome, b as keyArrowDown, c 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';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumberConverter, h as html, r as registerFactory } from './index.js';
2
+ import { a as iconRegistries } from './definition24.js';
3
+ import { f as focusRegistries } from './definition55.js';
4
+ import { b as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
5
+ import { a as applyMixins } from './apply-mixins.js';
6
+ import { S as StartEnd } from './start-end.js';
7
+ import { f as focusTemplateFactory } from './focus2.js';
8
+ import { r as ref } from './ref.js';
9
+ import { w as when } from './when.js';
8
10
 
9
11
  /**
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}.
12
+ * An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
26
13
  *
27
- * @fires change - Fires a custom 'change' event when the active item changes
28
- * @csspart item - The slot for the accordion items
29
- * @public
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
30
28
  *
31
- * @remarks
32
- * Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(AccordionItem:class)}.
29
+ * @public
33
30
  */
34
- class Accordion$1 extends FoundationElement {
31
+ let AccordionItem$1 = class AccordionItem extends FoundationElement {
35
32
  constructor() {
36
33
  super(...arguments);
37
34
  /**
38
- * Controls the expand mode of the Accordion, either allowing
39
- * single or multiple item expansion.
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
40
39
  * @public
40
+ * @remarks
41
+ * HTML attribute: heading-level
42
+ */
43
+ this.headinglevel = 2;
44
+ /**
45
+ * Expands or collapses the item.
41
46
  *
47
+ * @public
42
48
  * @remarks
43
- * HTML attribute: expand-mode
49
+ * HTML attribute: expanded
44
50
  */
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) {
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);
51
+ this.expanded = false;
52
+ /**
53
+ * @internal
54
+ */
55
+ this.clickHandler = (e) => {
56
+ this.expanded = !this.expanded;
101
57
  this.change();
102
58
  };
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
- }
59
+ this.change = () => {
60
+ this.$emit("change");
140
61
  };
141
62
  }
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) {
179
- element.expandbutton.focus();
180
- }
181
- }
182
- }
63
+ };
183
64
  __decorate([
184
- attr({ attribute: "expand-mode" })
185
- ], Accordion$1.prototype, "expandmode", void 0);
65
+ attr({
66
+ attribute: "heading-level",
67
+ mode: "fromView",
68
+ converter: nullableNumberConverter,
69
+ })
70
+ ], AccordionItem$1.prototype, "headinglevel", void 0);
186
71
  __decorate([
187
- observable
188
- ], Accordion$1.prototype, "accordionItems", void 0);
72
+ attr({ mode: "boolean" })
73
+ ], AccordionItem$1.prototype, "expanded", void 0);
74
+ __decorate([
75
+ attr
76
+ ], AccordionItem$1.prototype, "id", void 0);
77
+ applyMixins(AccordionItem$1, StartEnd);
189
78
 
190
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 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}";
79
+ const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 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}";
191
80
 
192
- class Accordion extends Accordion$1 {
81
+ var __defProp = Object.defineProperty;
82
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
83
+ var __decorateClass = (decorators, target, key, kind) => {
84
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
85
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
86
+ if (decorator = decorators[i])
87
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
88
+ if (kind && result)
89
+ __defProp(target, key, result);
90
+ return result;
91
+ };
92
+ class AccordionItem extends AccordionItem$1 {
193
93
  constructor() {
194
94
  super(...arguments);
195
- this.expandmode = AccordionExpandMode.single;
196
- }
197
- closeAll() {
198
- if (this.expandmode === AccordionExpandMode.multi) {
199
- this.accordionItems.forEach(item => {
200
- item.expanded = false;
201
- });
202
- }
95
+ this.noIndicator = false;
203
96
  }
204
97
  }
98
+ __decorateClass([
99
+ attr
100
+ ], AccordionItem.prototype, "heading", 2);
101
+ __decorateClass([
102
+ attr({ mode: "boolean", attribute: "no-indicator" })
103
+ ], AccordionItem.prototype, "noIndicator", 2);
104
+ __decorateClass([
105
+ attr
106
+ ], AccordionItem.prototype, "meta", 2);
107
+ __decorateClass([
108
+ attr
109
+ ], AccordionItem.prototype, "size", 2);
110
+ applyMixins(AccordionItem, AffixIconWithTrailing);
111
+
112
+ const header = (context, hTag) => {
113
+ const affixIconTemplate = affixIconTemplateFactory(context);
114
+ const focusTemplate = focusTemplateFactory(context);
115
+ return html`
116
+ <${hTag} class="heading-container">
117
+ <button
118
+ class="heading-button ${(x) => x.size ? `size-${x.size}` : ""}"
119
+ id="${(x) => x.id}"
120
+ aria-expanded="${(x) => x.expanded}"
121
+ aria-controls="${(x) => x.id}-panel"
122
+ @click="${(x, c) => x.clickHandler(c.event)}"
123
+ ${ref("expandbutton")}
124
+ >
125
+ ${() => focusTemplate}
126
+
127
+ ${(x) => x.icon && !x.iconTrailing ? affixIconTemplate(x.icon) : null}
128
+
129
+ <span class="heading-content">${(x) => x.heading}</span>
205
130
 
206
- const getClasses = _ => classNames('base');
207
- const AccordionTemplate = () => html`
208
- <div class="${getClasses}">
209
- <slot ${slotted({
210
- property: 'accordionItems',
211
- filter: elements()
212
- })}></slot>
131
+ ${when((x) => x.meta, html`<span class="meta">${(x) => x.meta}</span>`)}
132
+
133
+ ${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
134
+ ${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(x.expanded ? "chevron-up-solid" : "chevron-down-solid") : null}
135
+
136
+ </button>
137
+ </${hTag}>
138
+ `;
139
+ };
140
+ const AccordionItemTemplate = (context) => html`
141
+ ${(x) => header(context, "h" + x.headinglevel)}
142
+ <div
143
+ id="${(x) => x.id}-panel"
144
+ aria-labelledby="${(x) => x.id}"
145
+ role="region"
146
+ class="region ${(x) => x.icon && !x.iconTrailing ? "padded" : ""} ${(x) => x.size ? `size-${x.size}` : ""}"
147
+ >
148
+ <slot></slot>
213
149
  </div>
214
150
  `;
215
151
 
216
- const accordionDefinition = Accordion.compose({
217
- baseName: 'accordion',
218
- template: AccordionTemplate,
219
- styles: css_248z
152
+ const accordionItemDefinition = AccordionItem.compose({
153
+ baseName: "accordion-item",
154
+ template: AccordionItemTemplate,
155
+ styles,
156
+ shadowOptions: {
157
+ delegatesFocus: true
158
+ }
220
159
  });
221
- const accordionRegistries = [accordionDefinition(), ...accordionItemRegistries];
222
- const registerAccordion = registerFactory(accordionRegistries);
160
+ const accordionItemRegistries = [accordionItemDefinition(), ...iconRegistries, ...focusRegistries];
161
+ const registerAccordionItem = registerFactory(accordionItemRegistries);
223
162
 
224
- export { accordionDefinition as a, accordionRegistries as b, registerAccordion as r };
163
+ export { AccordionItem$1 as A, accordionItemDefinition as a, accordionItemRegistries as b, registerAccordionItem as r };