@swisspost/design-system-components 10.0.0-next.47 → 10.0.0-next.48

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 (255) hide show
  1. package/dist/cjs/{event-from-AKK8RQrn.js → event-from-C6kpQwhw.js} +2 -2
  2. package/dist/cjs/index-CpDyH7Ww.js +4 -4
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-wsZ6ig4j.js → package-CZyXYkIN.js} +1 -1
  5. package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
  6. package/dist/cjs/post-avatar.cjs.entry.js +91 -54
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
  8. package/dist/cjs/post-banner.cjs.entry.js +3 -3
  9. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +1 -1
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/post-card-control.cjs.entry.js +1 -1
  12. package/dist/cjs/post-closebutton_15.cjs.entry.js +4 -5
  13. package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
  14. package/dist/cjs/post-components.cjs.js +1 -1
  15. package/dist/cjs/post-footer.cjs.entry.js +1 -1
  16. package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
  17. package/dist/cjs/post-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/post-rating.cjs.entry.js +1 -1
  19. package/dist/cjs/post-tab-header.cjs.entry.js +1 -1
  20. package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
  21. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  22. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +1 -1
  23. package/dist/cjs/post-tooltip.cjs.entry.js +1 -1
  24. package/dist/collection/components/post-accordion-item/post-accordion-item.js +5 -5
  25. package/dist/collection/components/post-avatar/avatar-utils.js +16 -0
  26. package/dist/collection/components/post-avatar/post-avatar.js +90 -57
  27. package/dist/collection/components/post-banner/post-banner.js +2 -2
  28. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -19
  29. package/dist/collection/components/post-menu/post-menu.js +4 -1
  30. package/dist/collection/components/post-tabs/post-tabs.js +3 -3
  31. package/dist/collection/utils/event-from.js +2 -2
  32. package/dist/{esm/event-from-8U5GFtQP.js → components/event-from.js} +2 -2
  33. package/dist/components/get-root.js +15 -0
  34. package/dist/components/index.d.ts +73 -0
  35. package/dist/components/index.js +36 -2315
  36. package/dist/components/package.js +3 -0
  37. package/dist/components/post-accordion-item.js +1 -1
  38. package/dist/components/post-accordion-item2.js +113 -0
  39. package/dist/components/post-accordion.js +1 -1
  40. package/dist/components/post-accordion2.js +138 -0
  41. package/dist/components/post-avatar.js +99 -62
  42. package/dist/components/post-back-to-top.js +6 -7
  43. package/dist/components/post-banner.js +10 -11
  44. package/dist/components/post-breadcrumb-item.js +1 -1
  45. package/dist/components/post-breadcrumb-item2.js +79 -0
  46. package/dist/components/post-breadcrumbs.js +13 -14
  47. package/dist/components/post-card-control.js +8 -9
  48. package/dist/components/post-closebutton.js +5 -7
  49. package/dist/components/post-collapsible-trigger.js +1 -1
  50. package/dist/components/post-collapsible-trigger2.js +135 -0
  51. package/dist/components/post-collapsible.js +1 -1
  52. package/dist/components/post-collapsible2.js +110 -0
  53. package/dist/components/post-footer.js +10 -11
  54. package/dist/components/post-header.js +6 -7
  55. package/dist/components/post-icon.js +1 -1
  56. package/dist/components/post-icon2.js +153 -0
  57. package/dist/components/post-language-option.js +8 -9
  58. package/dist/components/post-language-switch.js +12 -13
  59. package/dist/components/post-linkarea.js +3 -4
  60. package/dist/components/post-list-item.js +3 -4
  61. package/dist/components/post-list.js +4 -5
  62. package/dist/components/post-logo.js +5 -6
  63. package/dist/components/post-mainnavigation.js +4 -5
  64. package/dist/components/post-megadropdown-trigger.js +6 -7
  65. package/dist/components/post-megadropdown.js +7 -8
  66. package/dist/components/post-menu-item.js +1 -1
  67. package/dist/components/post-menu-item2.js +30 -0
  68. package/dist/components/post-menu-trigger.js +1 -1
  69. package/dist/components/post-menu-trigger2.js +110 -0
  70. package/dist/components/post-menu.js +1 -1
  71. package/dist/components/post-menu2.js +222 -0
  72. package/dist/components/post-popover.js +6 -7
  73. package/dist/components/post-popovercontainer.js +1 -1
  74. package/dist/components/post-popovercontainer2.js +3018 -0
  75. package/dist/components/post-rating.js +8 -9
  76. package/dist/components/post-tab-header.js +6 -7
  77. package/dist/components/post-tab-panel.js +6 -7
  78. package/dist/components/post-tabs.js +7 -8
  79. package/dist/components/post-togglebutton.js +3 -4
  80. package/dist/components/post-tooltip-trigger.js +6 -7
  81. package/dist/components/post-tooltip.js +6 -7
  82. package/dist/components/react/index.d.ts +33 -0
  83. package/dist/components/react/index.js +2315 -0
  84. package/dist/components/react/p-0Ltezq5O.js +3 -0
  85. package/dist/components/{p-i0-mizzM.js → react/p-38PqL5iD.js} +1 -1
  86. package/dist/components/react/p-BLchVpF6.js +14 -0
  87. package/dist/components/react/p-C35MCWIp.js +35 -0
  88. package/dist/components/{p-336Lbkey.js → react/p-CGsAj6ij.js} +1 -1
  89. package/dist/components/react/p-CJ80BZ06.js +178 -0
  90. package/dist/{esm/index-BWC0gtGU.js → components/react/p-CV7fm1rW.js} +1 -1
  91. package/dist/components/react/p-C_2k3G1c.js +264 -0
  92. package/dist/components/{p-DP5pj8mq.js → react/p-Ce7jgYmK.js} +1 -1
  93. package/dist/components/{p-BSvy4uym.js → react/p-CiYSngKM.js} +7 -7
  94. package/dist/components/{p-Cxrx7SXz.js → react/p-Da5wbVP8.js} +1 -1
  95. package/dist/components/{p-DVGX_JCp.js → react/p-Dq9F2i7n.js} +2 -2
  96. package/dist/components/{p-DEi5TIMq.js → react/p-DzYquz3e.js} +2 -2
  97. package/dist/components/{p-pHxypsHK.js → react/p-JHuJA2Lv.js} +4 -4
  98. package/dist/components/react/p-SbIC4aZX.js +11 -0
  99. package/dist/components/{p-C0H2ohSv.js → react/p-Tg0GNTZM.js} +2 -2
  100. package/dist/components/{p-8U5GFtQP.js → react/p-kraHE1r3.js} +2 -2
  101. package/dist/components/{p-BM8mtEfS.js → react/p-q8Fvf8A0.js} +1 -1
  102. package/dist/components/react/p-r4txK0AC.js +3 -0
  103. package/dist/components/react/post-accordion-item.d.ts +11 -0
  104. package/dist/components/react/post-accordion-item.js +6 -0
  105. package/dist/components/react/post-accordion.d.ts +11 -0
  106. package/dist/components/react/post-accordion.js +6 -0
  107. package/dist/components/react/post-avatar.d.ts +11 -0
  108. package/dist/components/react/post-avatar.js +226 -0
  109. package/dist/components/react/post-back-to-top.d.ts +11 -0
  110. package/dist/components/react/post-back-to-top.js +145 -0
  111. package/dist/components/react/post-banner.d.ts +11 -0
  112. package/dist/components/react/post-banner.js +99 -0
  113. package/dist/components/react/post-breadcrumb-item.d.ts +11 -0
  114. package/dist/components/react/post-breadcrumb-item.js +6 -0
  115. package/dist/components/react/post-breadcrumbs.d.ts +11 -0
  116. package/dist/components/react/post-breadcrumbs.js +187 -0
  117. package/dist/components/react/post-card-control.d.ts +11 -0
  118. package/dist/components/react/post-card-control.js +327 -0
  119. package/dist/components/react/post-closebutton.d.ts +11 -0
  120. package/dist/components/react/post-closebutton.js +50 -0
  121. package/dist/components/react/post-collapsible-trigger.d.ts +11 -0
  122. package/dist/components/react/post-collapsible-trigger.js +6 -0
  123. package/dist/components/react/post-collapsible.d.ts +11 -0
  124. package/dist/components/react/post-collapsible.js +6 -0
  125. package/dist/components/react/post-footer.d.ts +11 -0
  126. package/dist/components/react/post-footer.js +117 -0
  127. package/dist/components/react/post-header.d.ts +11 -0
  128. package/dist/components/react/post-header.js +333 -0
  129. package/dist/components/react/post-icon.d.ts +11 -0
  130. package/dist/components/react/post-icon.js +6 -0
  131. package/dist/components/react/post-language-option.d.ts +11 -0
  132. package/dist/components/react/post-language-option.js +101 -0
  133. package/dist/components/react/post-language-switch.d.ts +11 -0
  134. package/dist/components/react/post-language-switch.js +159 -0
  135. package/dist/components/react/post-linkarea.d.ts +11 -0
  136. package/dist/components/react/post-linkarea.js +46 -0
  137. package/dist/components/react/post-list-item.d.ts +11 -0
  138. package/dist/components/react/post-list-item.js +39 -0
  139. package/dist/components/react/post-list.d.ts +11 -0
  140. package/dist/components/react/post-list.js +62 -0
  141. package/dist/components/react/post-logo.d.ts +11 -0
  142. package/dist/components/react/post-logo.js +59 -0
  143. package/dist/components/react/post-mainnavigation.d.ts +11 -0
  144. package/dist/components/react/post-mainnavigation.js +181 -0
  145. package/dist/components/react/post-megadropdown-trigger.d.ts +11 -0
  146. package/dist/components/react/post-megadropdown-trigger.js +137 -0
  147. package/dist/components/react/post-megadropdown.d.ts +11 -0
  148. package/dist/components/react/post-megadropdown.js +197 -0
  149. package/dist/components/react/post-menu-item.d.ts +11 -0
  150. package/dist/components/react/post-menu-item.js +6 -0
  151. package/dist/components/react/post-menu-trigger.d.ts +11 -0
  152. package/dist/components/react/post-menu-trigger.js +6 -0
  153. package/dist/components/react/post-menu.d.ts +11 -0
  154. package/dist/components/react/post-menu.js +6 -0
  155. package/dist/components/react/post-popover.d.ts +11 -0
  156. package/dist/components/react/post-popover.js +189 -0
  157. package/dist/components/react/post-popovercontainer.d.ts +11 -0
  158. package/dist/components/react/post-popovercontainer.js +6 -0
  159. package/dist/components/react/post-rating.d.ts +11 -0
  160. package/dist/components/react/post-rating.js +153 -0
  161. package/dist/components/react/post-tab-header.d.ts +11 -0
  162. package/dist/components/react/post-tab-header.js +53 -0
  163. package/dist/components/react/post-tab-panel.d.ts +11 -0
  164. package/dist/components/react/post-tab-panel.js +55 -0
  165. package/dist/components/react/post-tabs.d.ts +11 -0
  166. package/dist/components/react/post-tabs.js +197 -0
  167. package/dist/components/react/post-togglebutton.d.ts +11 -0
  168. package/dist/components/react/post-togglebutton.js +57 -0
  169. package/dist/components/react/post-tooltip-trigger.d.ts +11 -0
  170. package/dist/components/react/post-tooltip-trigger.js +5223 -0
  171. package/dist/components/react/post-tooltip.d.ts +11 -0
  172. package/dist/components/react/post-tooltip.js +115 -0
  173. package/dist/components/switch-variants.js +3 -0
  174. package/dist/docs.json +20 -30
  175. package/dist/esm/event-from-kraHE1r3.js +105 -0
  176. package/dist/esm/index-C8a0ddDa.js +4 -4
  177. package/dist/esm/index-VmK3ABCB.js +88 -0
  178. package/dist/esm/loader.js +1 -1
  179. package/dist/esm/package-0Ltezq5O.js +3 -0
  180. package/dist/esm/post-accordion_2.entry.js +5 -5
  181. package/dist/esm/post-avatar.entry.js +92 -55
  182. package/dist/esm/post-back-to-top.entry.js +2 -2
  183. package/dist/esm/post-banner.entry.js +4 -4
  184. package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
  185. package/dist/esm/post-breadcrumbs.entry.js +2 -2
  186. package/dist/esm/post-card-control.entry.js +2 -2
  187. package/dist/esm/post-closebutton_15.entry.js +6 -7
  188. package/dist/esm/post-collapsible_2.entry.js +3 -3
  189. package/dist/esm/post-components.js +1 -1
  190. package/dist/esm/post-footer.entry.js +2 -2
  191. package/dist/esm/post-linkarea.entry.js +1 -1
  192. package/dist/esm/post-popover.entry.js +2 -2
  193. package/dist/esm/post-rating.entry.js +2 -2
  194. package/dist/esm/post-tab-header.entry.js +2 -2
  195. package/dist/esm/post-tab-panel.entry.js +2 -2
  196. package/dist/esm/post-tabs.entry.js +2 -2
  197. package/dist/esm/post-tooltip-trigger.entry.js +2 -2
  198. package/dist/esm/post-tooltip.entry.js +2 -2
  199. package/dist/loader/cdn.js +1 -0
  200. package/dist/loader/index.cjs.js +1 -0
  201. package/{loader → dist/loader}/index.d.ts +1 -1
  202. package/dist/loader/index.es2017.js +1 -0
  203. package/{loader → dist/loader}/index.js +1 -1
  204. package/dist/post-components/p-0Ltezq5O.js +1 -0
  205. package/dist/post-components/{p-bbe02ba3.entry.js → p-16772417.entry.js} +1 -1
  206. package/dist/post-components/{p-45007aac.entry.js → p-38d3d441.entry.js} +1 -1
  207. package/dist/post-components/{p-f67b616a.entry.js → p-3c71f590.entry.js} +1 -1
  208. package/dist/post-components/{p-a2fa5ce4.entry.js → p-40f21542.entry.js} +1 -1
  209. package/dist/post-components/{p-031f7489.entry.js → p-4243cdd1.entry.js} +1 -1
  210. package/dist/post-components/p-4c18cb8c.entry.js +1 -0
  211. package/dist/post-components/{p-c1cf39cb.entry.js → p-51dc7647.entry.js} +1 -1
  212. package/dist/post-components/{p-e9802b56.entry.js → p-6777e505.entry.js} +1 -1
  213. package/dist/post-components/{p-2f698af4.entry.js → p-6add880f.entry.js} +1 -1
  214. package/dist/post-components/{p-2ca196d6.entry.js → p-8363fedb.entry.js} +1 -1
  215. package/dist/post-components/p-83998038.entry.js +1 -0
  216. package/dist/post-components/{p-d0d92071.entry.js → p-85bb1b5e.entry.js} +1 -1
  217. package/dist/post-components/{p-3adbdda7.entry.js → p-8f4d8685.entry.js} +1 -1
  218. package/dist/post-components/{p-1e6a068a.entry.js → p-95ad536d.entry.js} +1 -1
  219. package/dist/post-components/{p-9428231b.entry.js → p-9d806e89.entry.js} +1 -1
  220. package/dist/post-components/{p-BWC0gtGU.js → p-VmK3ABCB.js} +1 -1
  221. package/dist/post-components/{p-57703aee.entry.js → p-aad86320.entry.js} +1 -1
  222. package/dist/post-components/p-c3e38acf.entry.js +1 -0
  223. package/dist/post-components/{p-ab8017bb.entry.js → p-d61bb2ff.entry.js} +1 -1
  224. package/dist/post-components/p-kraHE1r3.js +1 -0
  225. package/dist/post-components/post-components.esm.js +1 -1
  226. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +3 -3
  227. package/dist/types/components/post-avatar/avatar-utils.d.ts +3 -0
  228. package/dist/types/components/post-avatar/post-avatar.d.ts +13 -10
  229. package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -6
  230. package/dist/types/components/post-menu/post-menu.d.ts +3 -0
  231. package/dist/types/components/post-tabs/post-tabs.d.ts +2 -2
  232. package/dist/types/components.d.ts +0 -19
  233. package/dist/types/utils/component-on-ready.d.ts +2 -2
  234. package/hydrate/index.js +110 -70
  235. package/hydrate/index.mjs +110 -70
  236. package/package.json +19 -9
  237. package/dist/components/p-Z01QMrov.js +0 -3
  238. package/dist/esm/package-Z01QMrov.js +0 -3
  239. package/dist/post-components/p-7b8ab026.entry.js +0 -1
  240. package/dist/post-components/p-8U5GFtQP.js +0 -1
  241. package/dist/post-components/p-Z01QMrov.js +0 -1
  242. package/dist/post-components/p-ac73ab00.entry.js +0 -1
  243. package/dist/post-components/p-e96239c4.entry.js +0 -1
  244. package/loader/cdn.js +0 -1
  245. package/loader/index.cjs.js +0 -1
  246. package/loader/index.es2017.js +0 -1
  247. /package/dist/components/{p-CJ80BZ06.js → breakpoints.js} +0 -0
  248. /package/dist/components/{p-SbIC4aZX.js → fade.js} +0 -0
  249. /package/dist/components/{p-C35MCWIp.js → get-focusable-children.js} +0 -0
  250. /package/dist/components/{p-r4txK0AC.js → heading-levels.js} +0 -0
  251. /package/dist/components/{p-BLchVpF6.js → index.browser.js} +0 -0
  252. /package/dist/components/{p-CV7fm1rW.js → index2.js} +0 -0
  253. /package/dist/components/{p-C_2k3G1c.js → long-press-event.js} +0 -0
  254. /package/dist/components/{p-CBFgkSgY.js → react/p-CBFgkSgY.js} +0 -0
  255. /package/dist/components/{p-DjIHLduJ.js → react/p-DjIHLduJ.js} +0 -0
package/hydrate/index.js CHANGED
@@ -3229,7 +3229,7 @@ var registerHost = (elm, cmpMeta) => {
3229
3229
  };
3230
3230
  var styles = /* @__PURE__ */ new Map();
3231
3231
 
3232
- const version$1 = "10.0.0-next.47";
3232
+ const version$1 = "10.0.0-next.48";
3233
3233
 
3234
3234
  const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
3235
3235
 
@@ -3610,7 +3610,7 @@ function debounce(callback, timeout = 200) {
3610
3610
  * @returns true if the event should be processed, false otherwise
3611
3611
  */
3612
3612
  function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
3613
- if (!(event instanceof CustomEvent && event.target instanceof HTMLElement))
3613
+ if (!(event instanceof Event && event.target instanceof HTMLElement))
3614
3614
  return false;
3615
3615
  const eventTarget = event.target;
3616
3616
  if (eventTarget.localName !== tag)
@@ -3641,7 +3641,7 @@ function EventFrom(tag, option = { ignoreNestedComponents: true }) {
3641
3641
  };
3642
3642
  }
3643
3643
  else {
3644
- // Creates a hidden storage property for the original method using a
3644
+ // Creates a hidden storage property for the original method using a
3645
3645
  // modified key format (__[property]_original) to avoid naming conflicts
3646
3646
  const privateKey = `__${propertyKey}_original`;
3647
3647
  // Create hidden storage for original method
@@ -3883,9 +3883,9 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
3883
3883
  return c > 3 && r && Object.defineProperty(target, key, r), r;
3884
3884
  };
3885
3885
  /**
3886
- * @part button - The pseudo-element, used to override styles on the components internal header `button` element.
3887
- * @part body - The pseudo-element, used to override styles on the components internal `body` element.
3888
- * @slot logo - Slot for the placing a logo before the header.
3886
+ * @part button - The element that toggles the accordion item (header button).
3887
+ * @part body - The container element that holds the accordion item's content.
3888
+ * @slot logo - Slot for placing a logo in the accordion item’s header, before the content.
3889
3889
  * @slot header - Slot for placing custom content within the accordion item's header.
3890
3890
  * @slot default - Slot for placing content within the accordion item's body.
3891
3891
  */
@@ -3925,10 +3925,10 @@ class PostAccordionItem {
3925
3925
  render() {
3926
3926
  const headingLevel = this.host.closest('post-accordion')?.getAttribute('heading-level');
3927
3927
  const HeadingTag = `h${headingLevel ?? this.headingLevel ?? 2}`;
3928
- return (hAsync(Host, { key: 'd7176f314fa0f907bd5b69555a2f25561f3875cf', id: this.id, "data-version": version$1 }, hAsync("div", { key: '978c451798e5bafe38ef57be29818f02ccf49dab', part: "accordion-item", class: "accordion-item" }, hAsync("post-collapsible-trigger", { key: '615da8a2ad5fb3c3fd1e5e0c2c8ee9a260a34263', for: `${this.id}--collapse` }, hAsync(HeadingTag, { key: '9c270ded36f1e1b1b466ba8c4ca529ab26368d5c', class: "accordion-header", id: `${this.id}--header` }, hAsync("button", { key: 'ddf278d1ccf6d78932ae4c6a9617d5852fb73064', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, hAsync("span", { key: '3989145bdbe0a313c6ed10220d2089c89688d613', class: {
3928
+ return (hAsync(Host, { key: 'b98847d19894430b6f65130aebf8673a45afd1e6', id: this.id, "data-version": version$1 }, hAsync("div", { key: 'f26f9d3a4a1f59db23b4698b321e28e112c3eed0', part: "accordion-item", class: "accordion-item" }, hAsync("post-collapsible-trigger", { key: '14bdacce04d67a03655f600feeaeec065e0fc198', for: `${this.id}--collapse` }, hAsync(HeadingTag, { key: '7a07a70d172306ce37f8bd0143b21ed7ec0cab8a', class: "accordion-header", id: `${this.id}--header` }, hAsync("button", { key: '5ad0698a62df5c4b2c0a77ff622090b20f348e9c', type: "button", class: `accordion-button${this.collapsed ? ' collapsed' : ''}`, part: "button" }, hAsync("span", { key: '6e5fcb0c9efa8a57e05fd162c72b9c170a8210c6', class: {
3929
3929
  'logo-container': true,
3930
3930
  'has-image': !!this.slottedLogo,
3931
- } }, hAsync("slot", { key: 'dd053bf73234db3bac772bf730003b4f2cc030cb', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), hAsync("slot", { key: '9ac06513d55828a9d7a3552aa66c9946fde7c793', name: "header" }), hAsync("post-icon", { key: 'fb46c528581e1a149706fd9e124857cc288747f8', name: "2051" })))), hAsync("post-collapsible", { key: '996887d6a0098a37dbac8d5edb950900f57d15f7', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, hAsync("div", { key: '21fa64a007cf0da4e0c0cf56f5862641d016517a', class: "accordion-body", part: "body" }, hAsync("slot", { key: '2a9f7731183e35c37523e079d437612dbda1a01b' }))))));
3931
+ } }, hAsync("slot", { key: '41a1409f723bf52de893324ce45d4e7f31eb8908', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), hAsync("slot", { key: '7186adfe4a4fe67f4dbaeb7569820d0d06c18428', name: "header" }), hAsync("post-icon", { key: 'fbfcbdc9947a8c7cf80d861aba3a77be0dff91d1', name: "2051" })))), hAsync("post-collapsible", { key: '5de19aab5eb0134b7c3e7f43e5c2da0cb8413908', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, hAsync("div", { key: '5112ba8604ea177af4d88033f682c2a4cc6c4ffd', class: "accordion-body", part: "body" }, hAsync("slot", { key: 'd70ab76842fced3f7dec812471685071e377bc61' }))))));
3932
3932
  }
3933
3933
  get host() { return getElement(this); }
3934
3934
  static get watchers() { return {
@@ -3954,13 +3954,14 @@ __decorate$6([
3954
3954
  EventFrom('post-accordion-item')
3955
3955
  ], PostAccordionItem.prototype, "onCollapseToggle", null);
3956
3956
 
3957
- const postAvatarCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
3958
-
3959
3957
  // https://docs.gravatar.com/api/avatars/images/
3960
3958
  const GRAVATAR_DEFAULT = '404';
3961
3959
  const GRAVATAR_RATING = 'g';
3962
3960
  const GRAVATAR_SIZE = 80;
3963
3961
  const GRAVATAR_BASE_URL = `https://www.gravatar.com/avatar/{email}?s=${GRAVATAR_SIZE}&d=${GRAVATAR_DEFAULT}&r=${GRAVATAR_RATING}`;
3962
+
3963
+ const postAvatarCss = "@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
3964
+
3964
3965
  const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
3965
3966
  var AvatarType;
3966
3967
  (function (AvatarType) {
@@ -3979,6 +3980,8 @@ class PostAvatar {
3979
3980
  this.imageUrl = '';
3980
3981
  this.imageAlt = '';
3981
3982
  this.initials = '';
3983
+ // To handle email or userid updates and reset the storage item
3984
+ this.storageKey = '';
3982
3985
  }
3983
3986
  validateFirstname() {
3984
3987
  checkRequiredAndType(this, 'firstname', 'string');
@@ -3986,47 +3989,67 @@ class PostAvatar {
3986
3989
  validateLastname() {
3987
3990
  checkEmptyOrType(this, 'lastname', 'string');
3988
3991
  }
3989
- validateUserid() {
3992
+ updateUserid() {
3993
+ this.validateUserId();
3994
+ this.getAvatarImage();
3995
+ }
3996
+ updateEmail() {
3997
+ this.validateEmail();
3998
+ this.getAvatarImage();
3999
+ }
4000
+ validateUserId() {
3990
4001
  checkEmptyOrType(this, 'userid', 'string');
3991
4002
  }
3992
4003
  validateEmail() {
3993
4004
  if (this.email)
3994
4005
  checkEmptyOrPattern(this, 'email', emailPattern);
3995
4006
  }
3996
- async getAvatar() {
3997
- if (this.slottedImage !== null) {
3998
- this.avatarType = AvatarType.Slotted;
3999
- }
4000
- else {
4001
- let imageLoaded = false;
4002
- if (!imageLoaded && this.userid)
4007
+ async getAvatarImage() {
4008
+ let imageLoaded = false;
4009
+ this.slottedImage = this.host.querySelector('img');
4010
+ const imageUrl = this.slottedImage?.getAttribute('src');
4011
+ if (!imageUrl) {
4012
+ if (this.userid) {
4003
4013
  imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
4004
- if (!imageLoaded && this.email)
4014
+ }
4015
+ if (!imageLoaded && this.email?.match(emailPattern)) {
4005
4016
  imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
4006
- if (!imageLoaded)
4007
- this.getAvatarByInitials();
4017
+ }
4018
+ if (!imageLoaded) {
4019
+ this.getAvatarInitials();
4020
+ }
4021
+ }
4022
+ else {
4023
+ const slottedImageLoaded = await this.getImageByProp(imageUrl, this.fetchSlottedImage.bind(this));
4024
+ if (!slottedImageLoaded) {
4025
+ this.slottedImage.style.display = 'none';
4026
+ this.getAvatarInitials();
4027
+ }
4028
+ else {
4029
+ this.slottedImage.style.display = 'block';
4030
+ }
4008
4031
  }
4009
4032
  }
4010
4033
  async getImageByProp(prop, fetchImage) {
4011
4034
  if (!prop)
4012
4035
  return false;
4013
- const imageResponse = (await this.getStorageItem(prop)) ?? { ok: false, url: '' };
4014
- if (!imageResponse.ok) {
4015
- try {
4016
- const r = await fetchImage();
4017
- imageResponse.ok = r.ok;
4018
- imageResponse.url = r.url;
4019
- this.imageUrl = imageResponse.url;
4020
- this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
4021
- this.avatarType = AvatarType.Image;
4022
- this.setStorageItem(this.userid, JSON.stringify(imageResponse));
4023
- }
4024
- catch (error) {
4025
- this.removeStorageItem(prop);
4026
- console.info(`Loading avatar by type "${AvatarType.Image}" failed.`);
4027
- }
4036
+ let imageResponse;
4037
+ try {
4038
+ imageResponse = await fetchImage(prop);
4039
+ }
4040
+ catch (error) {
4041
+ console.info('Loading avatar image failed.', error);
4042
+ return false;
4043
+ }
4044
+ if (!imageResponse?.ok) {
4045
+ return false;
4046
+ }
4047
+ else {
4048
+ this.imageUrl = imageResponse.url;
4049
+ this.imageAlt = `${this.firstname} ${this.lastname} avatar`;
4050
+ this.avatarType = AvatarType.Image;
4051
+ return true;
4028
4052
  }
4029
- return imageResponse.ok;
4030
4053
  }
4031
4054
  async fetchImageByUserId() {
4032
4055
  return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
@@ -4036,7 +4059,10 @@ class PostAvatar {
4036
4059
  const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
4037
4060
  return await fetch(imageUrl);
4038
4061
  }
4039
- getAvatarByInitials() {
4062
+ async fetchSlottedImage(imageUrl) {
4063
+ return await fetch(imageUrl, { method: 'HEAD' });
4064
+ }
4065
+ getAvatarInitials() {
4040
4066
  this.initials = this.getInitials();
4041
4067
  this.avatarType = AvatarType.Initials;
4042
4068
  }
@@ -4049,19 +4075,6 @@ class PostAvatar {
4049
4075
  .join('')
4050
4076
  .trim();
4051
4077
  }
4052
- async getStorageItem(keyToken) {
4053
- const key = await this.cryptify(keyToken);
4054
- const value = window?.sessionStorage?.getItem(key);
4055
- return value ? JSON.parse(value) : null;
4056
- }
4057
- async setStorageItem(keyToken, value) {
4058
- const key = await this.cryptify(keyToken);
4059
- window?.sessionStorage?.setItem(key, value);
4060
- }
4061
- async removeStorageItem(keyToken) {
4062
- const key = await this.cryptify(keyToken);
4063
- window?.sessionStorage?.removeItem(key);
4064
- }
4065
4078
  async cryptify(key) {
4066
4079
  return await crypto.subtle.digest('SHA-256', new TextEncoder().encode(key)).then(buffer => {
4067
4080
  return Array.from(new Uint8Array(buffer))
@@ -4069,18 +4082,42 @@ class PostAvatar {
4069
4082
  .join('');
4070
4083
  });
4071
4084
  }
4072
- onSlotDefaultChange() {
4073
- this.slottedImage = this.host.querySelector('img');
4074
- this.getAvatar();
4085
+ slotChanged() {
4086
+ const slot = this.host.shadowRoot.querySelector('slot');
4087
+ const assignedNodes = slot?.assignedNodes({ flatten: true }) || [];
4088
+ assignedNodes.forEach(node => {
4089
+ if (node.nodeType === Node.ELEMENT_NODE) {
4090
+ const el = node;
4091
+ if (el.tagName === 'IMG') {
4092
+ this.observeImageSrcChanges(el);
4093
+ }
4094
+ }
4095
+ });
4096
+ this.getAvatarImage();
4075
4097
  }
4076
- componentWillRender() {
4077
- this.slottedImage = this.host.querySelector('img');
4078
- this.getAvatar();
4098
+ // Observe the Slotted image src attribute and update the image
4099
+ observeImageSrcChanges(img) {
4100
+ if (this.slottedImageObserver) {
4101
+ this.slottedImageObserver.disconnect();
4102
+ }
4103
+ this.slottedImageObserver = new MutationObserver(mutations => {
4104
+ mutations.forEach(mutation => {
4105
+ if (mutation.type === 'attributes' && mutation.attributeName === 'src') {
4106
+ this.getAvatarImage();
4107
+ }
4108
+ });
4109
+ });
4110
+ this.slottedImageObserver.observe(img, { attributes: true, attributeFilter: ['src'] });
4111
+ }
4112
+ connectedCallback() {
4113
+ //This provides a fallback by showing the initials while the image is still loading or delayed.
4114
+ this.getAvatarInitials();
4115
+ this.getAvatarImage();
4079
4116
  }
4080
4117
  componentDidLoad() {
4081
4118
  this.validateFirstname();
4082
4119
  this.validateLastname();
4083
- this.validateUserid();
4120
+ this.validateUserId();
4084
4121
  this.validateEmail();
4085
4122
  }
4086
4123
  render() {
@@ -4092,14 +4129,14 @@ class PostAvatar {
4092
4129
  // eslint-disable-next-line @stencil-community/render-returns-host
4093
4130
  return acc;
4094
4131
  }, []);
4095
- return (hAsync(Host, { "data-version": version$1 }, hAsync("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && hAsync("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && hAsync("div", { class: "initials" }, initials))));
4132
+ return (hAsync(Host, { "data-version": version$1 }, hAsync("span", { class: this.avatarType === 'slotted' ? '' : 'd-none' }, hAsync("slot", { onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && hAsync("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && hAsync("div", { class: "initials" }, initials)));
4096
4133
  }
4097
4134
  get host() { return getElement(this); }
4098
4135
  static get watchers() { return {
4099
4136
  "firstname": ["validateFirstname"],
4100
4137
  "lastname": ["validateLastname"],
4101
- "userid": ["validateUserid"],
4102
- "email": ["validateEmail"]
4138
+ "userid": ["updateUserid"],
4139
+ "email": ["updateEmail"]
4103
4140
  }; }
4104
4141
  static get style() { return postAvatarCss; }
4105
4142
  static get cmpMeta() { return {
@@ -4114,7 +4151,8 @@ class PostAvatar {
4114
4151
  "avatarType": [32],
4115
4152
  "imageUrl": [32],
4116
4153
  "imageAlt": [32],
4117
- "initials": [32]
4154
+ "initials": [32],
4155
+ "storageKey": [32]
4118
4156
  },
4119
4157
  "$listeners$": undefined,
4120
4158
  "$lazyBundleId$": "-",
@@ -4312,7 +4350,7 @@ class PostBanner {
4312
4350
  this.hasActions = this.host.querySelectorAll('[slot="actions"]').length > 0;
4313
4351
  }
4314
4352
  render() {
4315
- return (hAsync(Host, { key: 'fc9507a57b443c485cf9496be4e04f66c04d7eaf', "data-version": version$1, role: "alert" }, hAsync("slot", { key: '1f59c2d63144990f148a37046d70b2155280abd6', name: "close-button" }), hAsync("slot", { key: '65d0e3c723cb474498d40d26f7f369b7d3abb41e', name: "heading" }), hAsync("slot", { key: '03ff96159a3066a64a7a474d9e6a5450937f8c84' }), this.hasActions && (hAsync("div", { key: '641ad34505cd5141133e5ef788f7e38ab0f977c8', class: "actions" }, hAsync("slot", { key: '242f388c40d71f37a25f2af3fe3eb622a9ab2796', name: "actions" })))));
4353
+ return (hAsync(Host, { key: 'e15185f83fd0da3aa39b2b5272e4326ecd77ee9d', "data-version": version$1, role: "alert" }, hAsync("slot", { key: '328dd1643a38643593ef79b5416b6f4b49e4eeef', name: "close-button" }), hAsync("slot", { key: '37ba09740a254eb559e5035dc2611849c1d01993', name: "heading" }), hAsync("slot", { key: '705fe8a24b3d31cce0637bea745128393aeee121' }), this.hasActions && (hAsync("div", { key: '296f89787a5f497fc835d88931b0784ab9c7ace9', class: "actions" }, hAsync("slot", { key: '7a3c6c574ef61890ebd8d038d491b56e65a22129', name: "actions" })))));
4316
4354
  }
4317
4355
  get host() { return getElement(this); }
4318
4356
  static get watchers() { return {
@@ -4327,7 +4365,7 @@ class PostBanner {
4327
4365
  "hasActions": [32],
4328
4366
  "dismiss": [64]
4329
4367
  },
4330
- "$listeners$": [[0, "postClick", "onCloseButtonClick"]],
4368
+ "$listeners$": [[0, "click", "onCloseButtonClick"]],
4331
4369
  "$lazyBundleId$": "-",
4332
4370
  "$attrsToReflect$": [["type", "type"]]
4333
4371
  }; }
@@ -4833,7 +4871,6 @@ const postClosebuttonCss = ".btn-icon-close{padding:0;border:unset;min-height:un
4833
4871
  class PostClosebutton {
4834
4872
  constructor(hostRef) {
4835
4873
  registerInstance(this, hostRef);
4836
- this.postClick = createEvent(this, "postClick");
4837
4874
  }
4838
4875
  componentDidLoad() {
4839
4876
  this.checkHiddenLabel();
@@ -4844,7 +4881,7 @@ class PostClosebutton {
4844
4881
  }
4845
4882
  }
4846
4883
  render() {
4847
- return (hAsync(Host, { key: '639599ff890ccf96684035e80449a99dcad7de85', "data-version": version$1 }, hAsync("button", { key: '0cc95e3c46a6d91ec3d31fff498b4c0b784de272', class: "btn btn-icon-close", type: "button", onClick: () => this.postClick.emit() }, hAsync("post-icon", { key: 'e30566a7734bb6a64a03f8983da015e7e7ec8c90', "aria-hidden": "true", name: "closex" }), hAsync("span", { key: '549ef38de408b6af78605f5e2f6f5c9aa291c04b', class: "visually-hidden" }, hAsync("slot", { key: '0325e4b54cfa8cfea9ddf243c1c25730d9a4b88f', onSlotchange: () => this.checkHiddenLabel() })))));
4884
+ return (hAsync(Host, { key: 'a8db3ecbefea609234c4c8c29dbf085637592c2c', "data-version": version$1 }, hAsync("button", { key: '58cef7f32f6ec89d46a1ea57b5497089a96aebf3', class: "btn btn-icon-close", type: "button" }, hAsync("post-icon", { key: '023a67437b69bb9966d08b027cc5f10d68baac40', "aria-hidden": "true", name: "closex" }), hAsync("span", { key: 'b1a21810b6179ddd8d66b426a3149966c1972f59', class: "visually-hidden" }, hAsync("slot", { key: '2a2417bedbcb57c75993722d3267342c7df7381d', onSlotchange: () => this.checkHiddenLabel() })))));
4848
4885
  }
4849
4886
  get host() { return getElement(this); }
4850
4887
  static get style() { return postClosebuttonCss; }
@@ -6425,6 +6462,9 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
6425
6462
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6426
6463
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6427
6464
  };
6465
+ /**
6466
+ * @part menu - The container element that holds the list of menu items.
6467
+ */
6428
6468
  class PostMenu {
6429
6469
  constructor(hostRef) {
6430
6470
  registerInstance(this, hostRef);
@@ -6585,7 +6625,7 @@ class PostMenu {
6585
6625
  .flatMap(el => Array.from(getFocusableChildren(el))));
6586
6626
  }
6587
6627
  render() {
6588
- return (hAsync(Host, { key: 'bca8873f7f98b03d3e6952bce4990d1c435bd5ec', "data-version": version$1, role: "menu" }, hAsync("post-popovercontainer", { key: '805c1e528c4af6e35b7881395b2f9de9e430f8c8', placement: this.placement, ref: e => (this.popoverRef = e) }, hAsync("div", { key: 'f534119e208f2bb387f39824736aee766f550fa8', part: "menu" }, hAsync("slot", { key: 'ec9ae42dab9aebd93aafdbebd15d8c39736c84df' })))));
6628
+ return (hAsync(Host, { key: 'ee365a30646247563fccd55556f7667cb1591d02', "data-version": version$1, role: "menu" }, hAsync("post-popovercontainer", { key: 'c649841d408d3f35dfed959cdc6b041163ff80d3', placement: this.placement, ref: e => (this.popoverRef = e) }, hAsync("div", { key: '9f4f145b80c716d27dc51f4bcb0d269b2b2678a8', part: "menu" }, hAsync("slot", { key: '72b53c8f154a4a91541799a789e8618a8d1a9c2c' })))));
6589
6629
  }
6590
6630
  get host() { return getElement(this); }
6591
6631
  static get watchers() { return {
@@ -10060,8 +10100,8 @@ const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;b
10060
10100
  /**
10061
10101
  * @slot tabs - Slot for placing tab headers. Each tab header should be a <post-tab-header> element.
10062
10102
  * @slot default - Slot for placing tab panels. Each tab panel should be a <post-tab-panel> element.
10063
- * @part tabs - Add custom styles for the tab header container.
10064
- * @part content - Add custom styles for the tab panel container.
10103
+ * @part tabs - The container element that holds the set of tabs.
10104
+ * @part content - The container element that displays the content of the currently active tab.
10065
10105
  */
10066
10106
  class PostTabs {
10067
10107
  constructor(hostRef) {
@@ -10202,7 +10242,7 @@ class PostTabs {
10202
10242
  nextTab.focus();
10203
10243
  }
10204
10244
  render() {
10205
- return (hAsync(Host, { key: '467959e964a6d7f44ac3eee09f9c7d2b501af4fe', "data-version": version$1 }, hAsync("div", { key: '7ce4c0428360124f6937d123a4664d6f22e1110c', class: "tabs-wrapper", part: "tabs" }, hAsync("div", { key: 'c41b073b855cb12a789c8656d12b0f6e9e20ea6f', class: "tabs", role: "tablist" }, hAsync("slot", { key: '37935aa4c4d1ca4e71931e9e50d91e77075d2b64', name: "tabs", onSlotchange: () => this.enableTabs() }))), hAsync("div", { key: 'bb84a728572c00256e219b5dd28322cbab699932', class: "tab-content", part: "content" }, hAsync("slot", { key: 'e2aa9cf6a9faa9f5ded6018def77b9b818b2b986', onSlotchange: () => this.moveMisplacedTabs() }))));
10245
+ return (hAsync(Host, { key: 'dc7228c840d65e3546e0d13e5bcaa78819b5aeb9', "data-version": version$1 }, hAsync("div", { key: '377d592f7c00f3ec0c7aba2a4a8ca2b88cd37927', class: "tabs-wrapper", part: "tabs" }, hAsync("div", { key: '6e79f33d6cd82d55ba9fad2f09f6163ce7e0a372', class: "tabs", role: "tablist" }, hAsync("slot", { key: '65fbf3cb6525f2f2ae97eb60dad313811db4c585', name: "tabs", onSlotchange: () => this.enableTabs() }))), hAsync("div", { key: '675a59a27e79bad06ea2b70c4fc7b0a6f4b020ff', class: "tab-content", part: "content" }, hAsync("slot", { key: 'b559af0fa652e352673fbabb6829a62a5630e809', onSlotchange: () => this.moveMisplacedTabs() }))));
10206
10246
  }
10207
10247
  get host() { return getElement(this); }
10208
10248
  static get style() { return postTabsCss; }