@swisspost/design-system-components 9.0.0-next.33 → 9.0.0-next.34

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 (332) hide show
  1. package/dist/cjs/{attribute-observer-6d8b886b.js → attribute-observer-c3a805b2.js} +3 -1
  2. package/dist/cjs/{breakpoints-c6247c71.js → breakpoints-cdf1b747.js} +12 -7
  3. package/dist/cjs/get-root-8102fecd.js +17 -0
  4. package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +2 -2
  5. package/dist/cjs/index.cjs.js +24 -25
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/long-press-event-6e62d113.js +266 -0
  8. package/dist/cjs/{package-3562c265.js → package-3426e8f7.js} +1 -1
  9. package/dist/cjs/{post-accordion-6c5681ba.js → post-accordion-3ac8dca8.js} +5 -5
  10. package/dist/cjs/{post-accordion-item-05a78451.js → post-accordion-item-aace6bc2.js} +5 -5
  11. package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
  12. package/dist/cjs/post-accordion.cjs.entry.js +4 -3
  13. package/dist/cjs/{post-avatar-6710a77a.js → post-avatar-53abd22f.js} +5 -4
  14. package/dist/cjs/post-avatar.cjs.entry.js +4 -3
  15. package/dist/cjs/{post-back-to-top-d0662842.js → post-back-to-top-b231fc1c.js} +9 -9
  16. package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
  17. package/dist/cjs/{post-banner-bd97db9c.js → post-banner-e6d14bf1.js} +4 -8
  18. package/dist/cjs/post-banner.cjs.entry.js +4 -3
  19. package/dist/cjs/{post-breadcrumb-36ab841c.js → post-breadcrumb-a929f2a6.js} +30 -22
  20. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
  21. package/dist/cjs/post-breadcrumb.cjs.entry.js +4 -4
  22. package/dist/cjs/{post-card-control-155fb433.js → post-card-control-cbee7b86.js} +26 -40
  23. package/dist/cjs/post-card-control.cjs.entry.js +4 -3
  24. package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -5
  25. package/dist/cjs/{post-collapsible-trigger-6601c554.js → post-collapsible-trigger-d1cb592a.js} +24 -41
  26. package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
  27. package/dist/cjs/post-components.cjs.js +2 -2
  28. package/dist/cjs/{post-footer-23699aef.js → post-footer-4290dafc.js} +11 -11
  29. package/dist/cjs/post-footer.cjs.entry.js +4 -4
  30. package/dist/cjs/{post-linkarea-8e5e1a9f.js → post-linkarea-f22f4f92.js} +5 -5
  31. package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
  32. package/dist/cjs/{post-menu-item-8dd94792.js → post-menu-item-afabaa61.js} +4 -4
  33. package/dist/cjs/{post-popover-858cbd12.js → post-popover-a4c72d38.js} +16 -14
  34. package/dist/cjs/post-popover.cjs.entry.js +5 -4
  35. package/dist/cjs/{post-rating-ef592484.js → post-rating-b87616fc.js} +4 -14
  36. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  37. package/dist/cjs/{post-tab-header-d785e7fc.js → post-tab-header-45cb6bb4.js} +5 -4
  38. package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
  39. package/dist/cjs/{post-tab-panel-41ea371e.js → post-tab-panel-00d16ba7.js} +4 -4
  40. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  41. package/dist/cjs/{post-tabs-c6f00130.js → post-tabs-2c3a89d0.js} +5 -12
  42. package/dist/cjs/post-tabs.cjs.entry.js +4 -3
  43. package/dist/cjs/{post-tag-d1a1176c.js → post-tag-370a2f4d.js} +3 -3
  44. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  45. package/dist/cjs/{post-togglebutton-02c56b7b.js → post-togglebutton-2c9552e3.js} +935 -460
  46. package/dist/cjs/{post-tooltip-3176e280.js → post-tooltip-4d4d2ea9.js} +39 -296
  47. package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
  48. package/dist/collection/animations/collapse.js +3 -1
  49. package/dist/collection/components/post-accordion/post-accordion.js +1 -3
  50. package/dist/collection/components/post-accordion-item/post-accordion-item.js +0 -2
  51. package/dist/collection/components/post-avatar/post-avatar.js +3 -4
  52. package/dist/collection/components/post-back-to-top/post-back-to-top.js +6 -8
  53. package/dist/collection/components/post-banner/post-banner.js +0 -6
  54. package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +16 -19
  55. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
  56. package/dist/collection/components/post-card-control/post-card-control.js +24 -40
  57. package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
  58. package/dist/collection/components/post-closebutton/post-closebutton.js +12 -2
  59. package/dist/collection/components/post-collapsible/post-collapsible.js +4 -10
  60. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +15 -28
  61. package/dist/collection/components/post-footer/post-footer.js +8 -9
  62. package/dist/collection/components/post-header/post-header.css +1 -1
  63. package/dist/collection/components/post-header/post-header.js +13 -22
  64. package/dist/collection/components/post-icon/post-icon.js +4 -6
  65. package/dist/collection/components/post-language-option/post-language-option.js +1 -10
  66. package/dist/collection/components/post-language-switch/post-language-switch.js +7 -19
  67. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
  68. package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
  69. package/dist/collection/components/post-list/post-list.js +1 -3
  70. package/dist/collection/components/post-list-item/post-list-item.js +1 -2
  71. package/dist/collection/components/post-logo/post-logo.js +1 -2
  72. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  73. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +98 -182
  74. package/dist/collection/components/post-megadropdown/post-megadropdown.js +20 -30
  75. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +36 -37
  76. package/dist/collection/components/post-menu/post-menu.js +45 -53
  77. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
  78. package/dist/collection/components/post-popover/post-popover.js +12 -12
  79. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
  80. package/dist/collection/components/post-rating/post-rating.js +1 -12
  81. package/dist/collection/components/post-tab-header/post-tab-header.js +2 -3
  82. package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
  83. package/dist/collection/components/post-tabs/post-tabs.js +1 -10
  84. package/dist/collection/components/post-tag/post-tag.js +0 -1
  85. package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
  86. package/dist/collection/components/post-tooltip/post-tooltip.js +36 -32
  87. package/dist/collection/utils/attribute-observer.js +2 -1
  88. package/dist/collection/utils/breakpoints.js +9 -7
  89. package/dist/collection/utils/environment.js +2 -0
  90. package/dist/collection/utils/get-root.js +6 -1
  91. package/dist/collection/utils/index.js +5 -0
  92. package/dist/collection/utils/is-motion-reduced.js +2 -1
  93. package/dist/components/attribute-observer.js +3 -1
  94. package/dist/components/breakpoints.js +12 -8
  95. package/dist/components/get-root.js +7 -1
  96. package/dist/components/long-press-event.js +264 -0
  97. package/dist/components/package.js +1 -1
  98. package/dist/components/post-accordion-item2.js +3 -3
  99. package/dist/components/post-accordion2.js +3 -3
  100. package/dist/components/post-avatar2.js +4 -3
  101. package/dist/components/post-back-to-top2.js +8 -8
  102. package/dist/components/post-banner2.js +2 -6
  103. package/dist/components/post-breadcrumb-item2.js +2 -2
  104. package/dist/components/post-breadcrumb2.js +28 -20
  105. package/dist/components/post-card-control2.js +25 -39
  106. package/dist/components/post-closebutton2.js +8 -3
  107. package/dist/components/post-collapsible-trigger2.js +19 -31
  108. package/dist/components/post-collapsible2.js +9 -12
  109. package/dist/components/post-footer2.js +8 -8
  110. package/dist/components/post-header2.js +15 -23
  111. package/dist/components/post-icon2.js +5 -5
  112. package/dist/components/post-language-option2.js +3 -10
  113. package/dist/components/post-language-switch2.js +9 -18
  114. package/dist/components/post-linkarea2.js +5 -4
  115. package/dist/components/post-list-item2.js +2 -2
  116. package/dist/components/post-list2.js +2 -3
  117. package/dist/components/post-logo2.js +3 -2
  118. package/dist/components/post-mainnavigation2.js +94 -182
  119. package/dist/components/post-megadropdown-trigger2.js +38 -37
  120. package/dist/components/post-megadropdown2.js +21 -30
  121. package/dist/components/post-menu-trigger2.js +15 -15
  122. package/dist/components/post-menu2.js +48 -54
  123. package/dist/components/post-popover2.js +14 -12
  124. package/dist/components/post-popovercontainer2.js +638 -36
  125. package/dist/components/post-rating2.js +2 -12
  126. package/dist/components/post-tab-header2.js +4 -3
  127. package/dist/components/post-tab-panel2.js +3 -3
  128. package/dist/components/post-tabs2.js +3 -10
  129. package/dist/components/post-tag2.js +1 -1
  130. package/dist/components/post-togglebutton2.js +12 -11
  131. package/dist/components/post-tooltip2.js +37 -294
  132. package/dist/docs.json +21 -15
  133. package/dist/esm/{attribute-observer-2f203993.js → attribute-observer-009deee5.js} +3 -1
  134. package/dist/esm/{breakpoints-bbe0c54e.js → breakpoints-7812702e.js} +12 -8
  135. package/dist/esm/get-root-1b1af46f.js +15 -0
  136. package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +2 -2
  137. package/dist/esm/index.js +24 -25
  138. package/dist/esm/loader.js +3 -3
  139. package/dist/esm/long-press-event-04d24397.js +264 -0
  140. package/dist/esm/package-8986a24c.js +3 -0
  141. package/dist/esm/{post-accordion-024451fa.js → post-accordion-577b52a0.js} +5 -5
  142. package/dist/esm/{post-accordion-item-19b996d1.js → post-accordion-item-99053b41.js} +5 -5
  143. package/dist/esm/post-accordion-item.entry.js +5 -4
  144. package/dist/esm/post-accordion.entry.js +4 -3
  145. package/dist/esm/{post-avatar-33aed045.js → post-avatar-2914706c.js} +5 -4
  146. package/dist/esm/post-avatar.entry.js +4 -3
  147. package/dist/esm/{post-back-to-top-7dd43c3b.js → post-back-to-top-4c7b1b47.js} +9 -9
  148. package/dist/esm/post-back-to-top.entry.js +4 -3
  149. package/dist/esm/{post-banner-28d18721.js → post-banner-295fd0f5.js} +4 -8
  150. package/dist/esm/post-banner.entry.js +4 -3
  151. package/dist/esm/{post-breadcrumb-d86fae7b.js → post-breadcrumb-1abfb312.js} +30 -22
  152. package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
  153. package/dist/esm/post-breadcrumb.entry.js +4 -4
  154. package/dist/esm/{post-card-control-aa043898.js → post-card-control-ad72d4f8.js} +26 -40
  155. package/dist/esm/post-card-control.entry.js +4 -3
  156. package/dist/esm/post-closebutton_15.entry.js +5 -5
  157. package/dist/esm/{post-collapsible-trigger-b1612866.js → post-collapsible-trigger-6b4ece20.js} +24 -41
  158. package/dist/esm/post-collapsible_2.entry.js +5 -5
  159. package/dist/esm/post-components.js +3 -3
  160. package/dist/esm/{post-footer-2ed5e520.js → post-footer-a5105e66.js} +11 -11
  161. package/dist/esm/post-footer.entry.js +4 -4
  162. package/dist/esm/{post-linkarea-802bf774.js → post-linkarea-22f97a88.js} +5 -5
  163. package/dist/esm/post-linkarea.entry.js +3 -3
  164. package/dist/esm/{post-menu-item-d97611d8.js → post-menu-item-9465a1f3.js} +4 -4
  165. package/dist/esm/{post-popover-e51a7a18.js → post-popover-e9b4569c.js} +16 -14
  166. package/dist/esm/post-popover.entry.js +5 -4
  167. package/dist/esm/{post-rating-e1ac47ce.js → post-rating-ae16e3c9.js} +4 -14
  168. package/dist/esm/post-rating.entry.js +3 -3
  169. package/dist/esm/{post-tab-header-06dcbf7f.js → post-tab-header-11f23150.js} +5 -4
  170. package/dist/esm/post-tab-header.entry.js +4 -3
  171. package/dist/esm/{post-tab-panel-75932601.js → post-tab-panel-0f3a952e.js} +4 -4
  172. package/dist/esm/post-tab-panel.entry.js +3 -3
  173. package/dist/esm/{post-tabs-3ef2ea23.js → post-tabs-1192509c.js} +5 -12
  174. package/dist/esm/post-tabs.entry.js +4 -3
  175. package/dist/esm/{post-tag-a3b989e0.js → post-tag-8be0a71c.js} +3 -3
  176. package/dist/esm/post-tag.entry.js +3 -3
  177. package/dist/esm/{post-togglebutton-db251030.js → post-togglebutton-b634fc7c.js} +935 -460
  178. package/dist/esm/{post-tooltip-c256d714.js → post-tooltip-f64bd0cc.js} +39 -296
  179. package/dist/esm/post-tooltip.entry.js +5 -4
  180. package/dist/post-components/index.esm.js +1 -1
  181. package/dist/post-components/p-0f398677.js +1 -0
  182. package/dist/post-components/p-1038fc25.js +1 -0
  183. package/dist/post-components/p-30f94eca.entry.js +1 -0
  184. package/dist/post-components/p-31bb6dc5.entry.js +1 -0
  185. package/dist/post-components/p-32173742.js +1 -0
  186. package/dist/post-components/p-338a2507.js +1 -0
  187. package/dist/post-components/p-36540dd6.entry.js +1 -0
  188. package/dist/post-components/p-3aa766a6.js +1 -0
  189. package/dist/post-components/p-3b0158b3.js +1 -0
  190. package/dist/post-components/p-40db8cd5.js +1 -0
  191. package/dist/post-components/p-44f13ce4.entry.js +1 -0
  192. package/dist/post-components/p-46a9324f.entry.js +1 -0
  193. package/dist/post-components/p-49c5aa99.js +1 -0
  194. package/dist/post-components/p-4cd4a936.entry.js +1 -0
  195. package/dist/post-components/p-548ef2f5.entry.js +1 -0
  196. package/dist/post-components/p-58f453dd.js +1 -0
  197. package/dist/post-components/p-5f54b77f.js +1 -0
  198. package/dist/post-components/p-60bb7f26.js +1 -0
  199. package/dist/post-components/p-60bfa4be.entry.js +1 -0
  200. package/dist/post-components/p-6b31a76a.js +1 -0
  201. package/dist/post-components/p-6ee81c5d.js +1 -0
  202. package/dist/post-components/p-6faad212.entry.js +1 -0
  203. package/dist/post-components/p-722ffaae.js +1 -0
  204. package/dist/post-components/p-74a0b44c.entry.js +1 -0
  205. package/dist/post-components/{p-dbe31632.js → p-78b4c699.js} +1 -1
  206. package/dist/post-components/p-7aa0468b.entry.js +1 -0
  207. package/dist/post-components/p-7afc495e.entry.js +1 -0
  208. package/dist/post-components/p-8db32dab.js +8 -0
  209. package/dist/post-components/p-96034ba4.entry.js +1 -0
  210. package/dist/post-components/p-9aaf9f54.js +1 -0
  211. package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
  212. package/dist/post-components/p-ab4073be.js +1 -0
  213. package/dist/post-components/p-abd7eb91.js +8 -0
  214. package/dist/post-components/p-afb8a487.entry.js +1 -0
  215. package/dist/post-components/p-b003b381.js +1 -0
  216. package/dist/post-components/p-b97dea1e.entry.js +1 -0
  217. package/dist/post-components/p-be37cf2a.js +1 -0
  218. package/dist/post-components/p-c31b56ed.js +1 -0
  219. package/dist/post-components/p-ccbb51fe.js +1 -0
  220. package/dist/post-components/p-d3900385.entry.js +1 -0
  221. package/dist/post-components/p-ef49153c.entry.js +1 -0
  222. package/dist/post-components/p-f27e5691.js +1 -0
  223. package/dist/post-components/p-f553019f.entry.js +1 -0
  224. package/dist/post-components/p-ffc1db17.entry.js +1 -0
  225. package/dist/post-components/post-components.esm.js +1 -1
  226. package/dist/types/components/post-avatar/post-avatar.d.ts +1 -1
  227. package/dist/types/components/post-card-control/post-card-control.d.ts +1 -1
  228. package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +4 -14
  229. package/dist/types/components/post-footer/post-footer.d.ts +2 -2
  230. package/dist/types/components/post-header/post-header.d.ts +1 -0
  231. package/dist/types/components/post-icon/post-icon.d.ts +0 -1
  232. package/dist/types/components/post-language-switch/post-language-switch.d.ts +2 -5
  233. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
  234. package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
  235. package/dist/types/components/post-popover/post-popover.d.ts +3 -1
  236. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
  237. package/dist/types/components/post-tooltip/post-tooltip.d.ts +6 -1
  238. package/dist/types/components.d.ts +4 -4
  239. package/dist/types/popover-fn.d.ts +11 -0
  240. package/dist/types/utils/environment.d.ts +2 -0
  241. package/dist/types/utils/get-root.d.ts +4 -0
  242. package/dist/types/utils/index.d.ts +5 -0
  243. package/loaders/attribute-observer.js +3 -1
  244. package/loaders/breakpoints.js +12 -8
  245. package/loaders/get-root.js +7 -1
  246. package/loaders/index.js +3 -3
  247. package/loaders/long-press-event.js +264 -0
  248. package/loaders/package.js +1 -1
  249. package/loaders/post-accordion-item2.js +3 -3
  250. package/loaders/post-accordion.js +3 -3
  251. package/loaders/post-avatar.js +4 -3
  252. package/loaders/post-back-to-top.js +8 -8
  253. package/loaders/post-banner.js +2 -6
  254. package/loaders/post-breadcrumb-item2.js +2 -2
  255. package/loaders/post-breadcrumb.js +28 -20
  256. package/loaders/post-card-control.js +25 -39
  257. package/loaders/post-closebutton.js +8 -3
  258. package/loaders/post-collapsible-trigger2.js +19 -31
  259. package/loaders/post-collapsible2.js +9 -12
  260. package/loaders/post-footer.js +8 -8
  261. package/loaders/post-header.js +15 -23
  262. package/loaders/post-icon2.js +5 -5
  263. package/loaders/post-language-option.js +3 -10
  264. package/loaders/post-language-switch.js +9 -18
  265. package/loaders/post-linkarea.js +5 -4
  266. package/loaders/post-list-item.js +2 -2
  267. package/loaders/post-list.js +2 -3
  268. package/loaders/post-logo.js +3 -2
  269. package/loaders/post-mainnavigation.js +94 -182
  270. package/loaders/post-megadropdown-trigger.js +38 -37
  271. package/loaders/post-megadropdown.js +21 -30
  272. package/loaders/post-menu-trigger2.js +15 -15
  273. package/loaders/post-menu2.js +48 -54
  274. package/loaders/post-popover.js +14 -12
  275. package/loaders/post-popovercontainer2.js +638 -36
  276. package/loaders/post-rating.js +2 -12
  277. package/loaders/post-tab-header.js +4 -3
  278. package/loaders/post-tab-panel.js +3 -3
  279. package/loaders/post-tabs.js +3 -10
  280. package/loaders/post-tag.js +1 -1
  281. package/loaders/post-togglebutton.js +12 -11
  282. package/loaders/post-tooltip.js +37 -294
  283. package/package.json +5 -5
  284. package/dist/cjs/debounce-158fd76f.js +0 -13
  285. package/dist/cjs/get-root-7a3498ef.js +0 -11
  286. package/dist/components/debounce.js +0 -11
  287. package/dist/esm/debounce-e54c7131.js +0 -11
  288. package/dist/esm/get-root-7af2e0d1.js +0 -9
  289. package/dist/esm/package-da68ab5a.js +0 -3
  290. package/dist/post-components/p-1376c653.js +0 -1
  291. package/dist/post-components/p-13835969.js +0 -1
  292. package/dist/post-components/p-13fdbaf6.entry.js +0 -1
  293. package/dist/post-components/p-1e2169ae.entry.js +0 -1
  294. package/dist/post-components/p-23e4c270.entry.js +0 -1
  295. package/dist/post-components/p-2641e06b.js +0 -1
  296. package/dist/post-components/p-2d3b16c7.js +0 -1
  297. package/dist/post-components/p-33c35e15.js +0 -1
  298. package/dist/post-components/p-3b247d71.entry.js +0 -1
  299. package/dist/post-components/p-42a5fdf8.js +0 -1
  300. package/dist/post-components/p-4ed7bab6.js +0 -1
  301. package/dist/post-components/p-5aeb3656.js +0 -1
  302. package/dist/post-components/p-5c518421.js +0 -1
  303. package/dist/post-components/p-6db1a2e0.entry.js +0 -1
  304. package/dist/post-components/p-6fe98184.entry.js +0 -1
  305. package/dist/post-components/p-7d731077.entry.js +0 -1
  306. package/dist/post-components/p-7ee47334.entry.js +0 -1
  307. package/dist/post-components/p-8223e97b.js +0 -1
  308. package/dist/post-components/p-8a8376d0.js +0 -1
  309. package/dist/post-components/p-8bb828cf.entry.js +0 -1
  310. package/dist/post-components/p-8e55ddd2.js +0 -1
  311. package/dist/post-components/p-9681efce.js +0 -1
  312. package/dist/post-components/p-96a59372.entry.js +0 -1
  313. package/dist/post-components/p-9748a355.js +0 -1
  314. package/dist/post-components/p-99c8fd43.entry.js +0 -1
  315. package/dist/post-components/p-ac042f7a.entry.js +0 -1
  316. package/dist/post-components/p-c34cacb7.js +0 -1
  317. package/dist/post-components/p-c3a970c5.js +0 -1
  318. package/dist/post-components/p-c4651d32.entry.js +0 -1
  319. package/dist/post-components/p-c9b61d31.entry.js +0 -1
  320. package/dist/post-components/p-d16dd7f9.js +0 -1
  321. package/dist/post-components/p-d81c5908.entry.js +0 -1
  322. package/dist/post-components/p-e1baac59.js +0 -1
  323. package/dist/post-components/p-e2294014.js +0 -15
  324. package/dist/post-components/p-e8ff8122.js +0 -1
  325. package/dist/post-components/p-ed78d04a.entry.js +0 -1
  326. package/dist/post-components/p-f1c0924a.js +0 -1
  327. package/dist/post-components/p-f1db96d0.entry.js +0 -1
  328. package/dist/post-components/p-f7aa917f.entry.js +0 -1
  329. package/dist/post-components/p-f96b80cc.entry.js +0 -1
  330. package/dist/post-components/p-fc91cbc2.js +0 -1
  331. package/dist/post-components/p-fd78716d.js +0 -1
  332. package/loaders/debounce.js +0 -11
@@ -4,12 +4,11 @@ import { version } from "../../../../package";
4
4
  * @slot default- Slot for placing the content of the list item.
5
5
  */
6
6
  export class PostListItem {
7
- host;
8
7
  connectedCallback() {
9
8
  this.host.setAttribute('slot', 'post-list-item');
10
9
  }
11
10
  render() {
12
- return (h(Host, { key: '9626999693fa26c4fb42db178e53099ea8a95c2e', role: "listitem", slot: "post-list-item", version: version }, h("slot", { key: '5f2d0a626e9d09a44d4c20f3bc97a2c60ca77feb' })));
11
+ return (h(Host, { key: 'c826293ea2a7446bea2f5b223934b444655198a0', role: "listitem", slot: "post-list-item", version: version }, h("slot", { key: 'b997f79da2fbc87fbc6a388c118a03c008ad2c23' })));
13
12
  }
14
13
  static get is() { return "post-list-item"; }
15
14
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,6 @@ export class PostLogo {
8
8
  constructor() {
9
9
  this.url = undefined;
10
10
  }
11
- host;
12
11
  validateUrl() {
13
12
  checkEmptyOrUrl(this, 'url');
14
13
  }
@@ -24,7 +23,7 @@ export class PostLogo {
24
23
  render() {
25
24
  const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
26
25
  const LogoTag = logoLink ? 'a' : 'span';
27
- return (h(Host, { key: '128604612a51624b537f30b0b9c91d9ea6b950be', "data-version": version }, h(LogoTag, { key: '885f057200f9da839fd38cb7070f319f6c89793e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'bee12585bf74fe5c2ce8a644c540c86626295526', class: "description" }, h("slot", { key: 'e516075c5138cef9378d3dc7137eb6c28d02b279', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'c0056463b93f7c0e5da07db4656d9c8dc9161c32', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '1dfc33886c9b1fb6cd3b08f448a89c11a6080598', id: "Logo" }, h("rect", { key: 'dd84426568259714379a92a3f56349c6b3220a61', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '56fa6445c184a41355a968365098b75387a16f48', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'f2abb1db77a2e795f477662453d7296a28882756', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
26
+ return (h(Host, { key: '7dee19302c0c560b29f09b1675135f10d41fc44a', "data-version": version }, h(LogoTag, { key: '1d851ca305d1bfc24666b416ad5f210b96d39811', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'cd75bd4040bc2f0d62e5cec2afc9529fa7c43c49', class: "description" }, h("slot", { key: 'caf63c4f823873181fa52cfb0cf38217b6a45823', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'd41c14973b829eb35764c9e562fe449e65f410b4', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '90c52e528bf4fc8e075e6517c18a59686ffd39f6', id: "Logo" }, h("rect", { key: '50633d1110596123232f07272406ebd0a32ffce8', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '7a617412c094669a66914edf769fba9ee9448b83', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: '74213b21fad18ba6a1dbb07e0b0b7dcf4a89b855', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
28
27
  }
29
28
  static get is() { return "post-logo"; }
30
29
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button{background-color:ButtonFace !important}post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:Highlight !important}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:4px;outline-offset:-2px !important}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:16px}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:14px}}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{content:"";mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:24px;width:24px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation>button,post-mainnavigation post-megadropdown-trigger button{border:1px solid ButtonBorder !important}post-mainnavigation>button:hover::after,post-mainnavigation>button[aria-expanded=true]::after,post-mainnavigation post-megadropdown-trigger button:hover::after,post-mainnavigation post-megadropdown-trigger button[aria-expanded=true]::after{color:HighlightText}}@media screen and (min-width: 1024px){post-mainnavigation{display:block;overflow-x:hidden}post-mainnavigation nav{max-width:100%;background:#fff;max-height:var(--post-main-navigation-height);user-select:none;transition:margin 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{z-index:4;position:absolute;inset-block-end:0;overflow:hidden}post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;background:#fff;padding:16px;box-shadow:var(--post-device-elevation-500);line-height:100%;height:var(--post-main-navigation-height)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{background-color:ButtonFace !important}post-mainnavigation .left-scroll-button button:hover,post-mainnavigation .right-scroll-button button:hover{background-color:Highlight !important}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button button post-icon,post-mainnavigation .right-scroll-button button post-icon{font-size:1rem}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button.d-none,post-mainnavigation .right-scroll-button.d-none{display:none}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button{inset-inline-start:0;padding-inline-end:2rem}}@media screen and (min-width: 1024px){post-mainnavigation .right-scroll-button{inset-inline-end:0;padding-inline-start:2rem}}@media screen and (min-width: 1024px){post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:12px;height:var(--post-main-navigation-height);gap:4px;font-size:16px;z-index:4}post-mainnavigation post-list-item>a .nav-el-active,post-mainnavigation post-list-item>button .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-active{font-weight:700;text-align:center;opacity:0}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{position:absolute;opacity:1;text-align:center;width:100%;inset-inline-start:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff;font-weight:700}post-mainnavigation post-list-item>a.selected .nav-el-active,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item>button.selected .nav-el-active,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-active{opacity:1}post-mainnavigation post-list-item>a.selected .nav-el-inactive,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item>button.selected .nav-el-inactive,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-inactive{opacity:0}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:14px}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:12px;transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{width:calc(100% - 28px)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:"";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close).selected,post-mainnavigation post-megadropdown button:not(.btn-icon-close)[aria-expanded=true],post-mainnavigation post-megadropdown a.selected,post-mainnavigation post-megadropdown a[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover,post-mainnavigation post-megadropdown a:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{background-color:#504f4b}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:"";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{background-color:#504f4b}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{display:none}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{transform:rotate(-90deg)}}post-mainnavigation .back-button .btn{padding-inline:0}
1
+ post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button{background-color:ButtonFace !important}post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:Highlight !important}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:4px;outline-offset:-2px !important}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:16px}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:14px}}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{content:"";mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:24px;width:24px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation>button,post-mainnavigation post-megadropdown-trigger button{border:1px solid ButtonBorder !important}post-mainnavigation>button:hover::after,post-mainnavigation>button[aria-expanded=true]::after,post-mainnavigation post-megadropdown-trigger button:hover::after,post-mainnavigation post-megadropdown-trigger button[aria-expanded=true]::after{color:HighlightText}}@media screen and (min-width: 1024px){post-mainnavigation{display:block;position:relative;height:var(--post-main-navigation-height);background:#fff;user-select:none}post-mainnavigation nav{flex:1 1 auto;overflow:hidden;scroll-behavior:smooth}post-mainnavigation .scroll-control{cursor:pointer;position:absolute;inset-block:0;z-index:5;padding:16px;background:#fff;box-shadow:var(--post-device-elevation-500);line-height:1}post-mainnavigation .scroll-control.scroll-left{inset-inline-start:0}post-mainnavigation .scroll-control.scroll-right{inset-inline-end:0}post-mainnavigation .scroll-control.d-none{display:none}post-mainnavigation .scroll-control post-icon{font-size:1rem}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:12px;height:var(--post-main-navigation-height);gap:4px;font-size:16px;z-index:4}post-mainnavigation post-list-item>a .nav-el-active,post-mainnavigation post-list-item>button .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-active{font-weight:700;text-align:center;opacity:0}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{position:absolute;opacity:1;text-align:center;width:100%;inset-inline-start:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff;font-weight:700}post-mainnavigation post-list-item>a.selected .nav-el-active,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item>button.selected .nav-el-active,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-active{opacity:1}post-mainnavigation post-list-item>a.selected .nav-el-inactive,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item>button.selected .nav-el-inactive,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-inactive{opacity:0}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:14px}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:12px;transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{width:calc(100% - 28px)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:"";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close).selected,post-mainnavigation post-megadropdown button:not(.btn-icon-close)[aria-expanded=true],post-mainnavigation post-megadropdown a.selected,post-mainnavigation post-megadropdown a[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover,post-mainnavigation post-megadropdown a:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{background-color:#504f4b}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .scroll-control{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:"";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{background-color:#504f4b}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{display:none}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{transform:rotate(-90deg)}}post-mainnavigation .back-button .btn{padding-inline:0}
@@ -2,234 +2,152 @@ import { Host, h } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
3
  const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
4
4
  const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
5
- const NAVIGATION_LIST_SELECTOR = 'post-list > [role="list"]:not(post-megadropdown *)';
6
- const NAVIGATION_ITEM_SELECTOR = 'post-list-item :is(a, button):not(post-megadropdown *)';
7
5
  export class PostMainnavigation {
8
6
  constructor() {
9
7
  this.canScrollLeft = false;
10
8
  this.canScrollRight = false;
11
- this.translationAmount = 0;
9
+ this.scrollRight = this.scrollRight.bind(this);
10
+ this.scrollLeft = this.scrollLeft.bind(this);
11
+ this.handleMutations = this.handleMutations.bind(this);
12
+ this.checkScrollability = this.checkScrollability.bind(this);
13
+ this.resizeObserver = new ResizeObserver(this.checkScrollability);
14
+ this.mutationObserver = new MutationObserver(this.handleMutations);
12
15
  }
13
- header;
14
- navbar;
15
- rightScrollButton;
16
- leftScrollButton;
17
- scrollRepeatInterval;
18
- navbarDisableTimer;
19
- resizeObserver;
20
- mutationObserver = new MutationObserver(async (mutations) => {
21
- // Wait for all elements to be hydrated
22
- await Promise.all(mutations
23
- .flatMap((mutation) => Array.from(mutation.addedNodes))
24
- .map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
25
- // Recalculate scrollability after DOM changes
26
- this.checkScrollability();
27
- });
28
- host;
29
- /**
30
- * Update navbar translation when 'translateAmount' changes and recalculate scrollability
31
- */
32
- onTranslateAmountChanges(value) {
33
- this.navbar.style.marginInlineStart = `-${value}px`;
34
- this.checkScrollability();
16
+ componentDidLoad() {
17
+ setTimeout(() => {
18
+ this.fixLayoutShift();
19
+ this.checkScrollability();
20
+ });
21
+ // Observe the navbar for size changes
22
+ this.resizeObserver.observe(this.navbar);
23
+ // Observe the navabar for mutation changes
24
+ this.mutationObserver.observe(this.navbar, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
25
+ // Ensure the scroll buttons are correctly displayed or hidden whenever the navbar is scrolled
26
+ this.navbar.addEventListener('scrollend', this.checkScrollability);
35
27
  }
36
28
  /**
37
- * Retrieves a reference to the closest 'post-header' element when the main navigation is added to the DOM.
38
- * This ensures that we can interact with the header for mobile menu toggling.
29
+ * Disconnects observers and remove event listeners when the main navigation is removed from the DOM.
39
30
  */
40
- connectedCallback() {
41
- this.header = this.host.closest('post-header');
31
+ disconnectedCallback() {
32
+ this.mutationObserver.disconnect();
33
+ this.resizeObserver.disconnect();
34
+ this.navbar.removeEventListener('scrollend', this.checkScrollability);
42
35
  }
43
36
  /**
44
- * Cleans up references and disconnects the MutationObserver when the main navigation is removed from the DOM.
37
+ * Stops the repeated scrolling when the mouse button is released.
45
38
  */
46
- disconnectedCallback() {
47
- this.header = null;
48
- this.mutationObserver.disconnect();
49
- if (this.resizeObserver) {
50
- this.resizeObserver.disconnect();
51
- }
39
+ stopScrolling() {
40
+ if (this.scrollRepeatInterval)
41
+ clearInterval(this.scrollRepeatInterval);
52
42
  }
53
- componentDidLoad() {
54
- setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
55
- this.resizeObserver = new ResizeObserver(() => {
56
- this.checkScrollability();
43
+ async handleMutations(mutations) {
44
+ const addedNodes = mutations.flatMap((mutation) => {
45
+ return Array.from(mutation.addedNodes);
57
46
  });
58
- // Observe the navbar and the navigation list for size changes
59
- if (this.navbar) {
60
- this.resizeObserver.observe(this.navbar);
61
- const navList = this.navigationList;
62
- if (navList) {
63
- this.resizeObserver.observe(navList);
64
- }
65
- }
66
- this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
47
+ // Wait for all elements to be hydrated
48
+ await Promise.all(addedNodes.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
67
49
  this.fixLayoutShift();
68
- // Handle focus changes and adjust scroll as needed
69
- this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
50
+ this.checkScrollability();
51
+ }
52
+ get navigationItems() {
53
+ return Array.from(this.navbar.querySelectorAll(':is(a, button):not(post-megadropdown *)'));
70
54
  }
71
- // Hack that duplicates navigation elements to fix the layout shift on active elements
55
+ /**
56
+ * Hack to fix the layout shift due to bold text on active elements
57
+ */
72
58
  fixLayoutShift() {
73
- // Select first level of main navigation elements, both the links and the megadropdown trigger buttons
74
- const children = this.host.querySelectorAll('nav > post-list > div > post-list-item > a, nav > post-list > div > post-list-item > post-megadropdown-trigger > button');
75
- // Update HTML so that the content is duplicated
76
- children.forEach(child => (child.innerHTML = `<span class="nav-el-active">${child.innerHTML}</span><span class="nav-el-inactive"aria-hidden="true">${child.innerHTML}</span>`));
59
+ this.navigationItems
60
+ .filter(item => !item.matches(':has(.nav-el-active)'))
61
+ .forEach(item => {
62
+ item.innerHTML = `
63
+ <span class="nav-el-active">${item.innerHTML}</span>
64
+ <span class="nav-el-inactive" aria-hidden="true">${item.innerHTML}</span>
65
+ `;
66
+ });
77
67
  }
78
68
  handleBackButtonClick() {
79
- if (this.header)
80
- this.header.toggleMobileMenu();
69
+ const header = this.navbar.closest('post-header');
70
+ if (header)
71
+ header.toggleMobileMenu();
81
72
  }
82
73
  /**
83
- * Moves focus on the navbar and adjusts scrolling to bring focused element into view.
74
+ * Returns whether scrolling is enabled in either the left or right direction.
84
75
  */
85
- adjustTranslation(e) {
86
- const focusedElement = e.target;
87
- if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
88
- return;
89
- // We need to move the element into the view before it is focused to avoid browser default behavior
90
- e.preventDefault();
91
- this.withoutTransition(() => {
92
- // Try scrolling in both directions, only the necessary translation will actually occur
93
- this.translateRightTo(focusedElement);
94
- this.translateLeftTo(focusedElement);
95
- focusedElement.focus();
96
- });
76
+ get canScroll() {
77
+ return this.canScrollLeft || this.canScrollRight;
97
78
  }
98
79
  /**
99
80
  * Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
100
81
  */
101
82
  checkScrollability() {
102
- const { scrollWidth, clientWidth } = this.navbar;
103
- const couldScroll = this.canScroll;
83
+ const { scrollLeft, scrollWidth, clientWidth } = this.navbar;
104
84
  if (scrollWidth === clientWidth) {
105
85
  // If scroll width equals client width, scrolling is disabled in both directions
106
86
  this.canScrollLeft = this.canScrollRight = false;
107
87
  }
108
88
  else {
109
- this.canScrollLeft = this.translationAmount > 0; // Scrolling left is possible if not at the start
110
- this.canScrollRight = clientWidth + this.translationAmount < scrollWidth; // Scrolling right is possible if not at the end
111
- }
112
- if (couldScroll && !this.canScroll) {
113
- this.withoutTransition(() => (this.translationAmount = 0));
89
+ this.canScrollLeft = Math.floor(scrollLeft) > 0; // Scrolling left is possible if not at the start
90
+ this.canScrollRight = Math.ceil(clientWidth + scrollLeft) < scrollWidth; // Scrolling right is possible if not at the end
114
91
  }
115
92
  }
116
- /**
117
- * Returns whether scrolling is enabled in either the left or right direction.
118
- */
119
- get canScroll() {
120
- return this.canScrollLeft || this.canScrollRight;
121
- }
122
93
  /**
123
94
  * Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
124
95
  */
125
- handleScrollButtonClick(direction) {
126
- if (!this.canScroll)
96
+ handleScrollButtonClick(e, direction) {
97
+ if (!this.canScroll || e.button !== 0)
127
98
  return;
128
99
  // Disable interaction with the navbar during scrolling
129
- this.disableNavbar();
130
- // Perform the initial scroll action
131
- this.scroll(direction);
100
+ this.temporarilyDisableNavbar();
101
+ // Set up the correct scroll function
102
+ const scroll = direction === 'right' ? this.scrollRight : this.scrollLeft;
103
+ scroll();
132
104
  // Repeat the scrolling action while the button is held down
133
105
  this.scrollRepeatInterval = setInterval(() => {
134
- this.scroll(direction);
106
+ scroll();
135
107
  }, SCROLL_REPEAT_INTERVAL);
136
108
  }
137
- /**
138
- * Stops the repeated scrolling when the mouse button is released.
139
- */
140
- stopScrolling() {
141
- if (this.scrollRepeatInterval)
142
- clearInterval(this.scrollRepeatInterval);
143
- }
144
- scroll(direction) {
145
- const navigationItems = Array.from(this.navigationItems);
146
- if (direction === 'left')
147
- navigationItems.reverse();
148
- for (const item of navigationItems) {
149
- const couldScroll = direction === 'left' ? this.translateLeftTo(item, true) : this.translateRightTo(item, true);
150
- if (couldScroll)
151
- break;
109
+ scrollRight() {
110
+ const scrollRightLeftEdge = document
111
+ .querySelector('.scroll-right')
112
+ .getBoundingClientRect().left;
113
+ for (const navigationItem of this.navigationItems) {
114
+ const { right, width } = navigationItem.getBoundingClientRect();
115
+ // Scroll to the first navigation item that is less than 75% visible
116
+ const isThreeQuartersVisible = right - 0.25 * width < scrollRightLeftEdge;
117
+ if (!isThreeQuartersVisible) {
118
+ this.navbar.scrollBy({ left: right - scrollRightLeftEdge });
119
+ return;
120
+ }
152
121
  }
153
122
  }
154
- translateRightTo(navigationItem, skipSmallTranslation = false) {
155
- const listItem = navigationItem.closest('post-list-item');
156
- // Calculate the right edge position of the list item relative to the left of the screen
157
- const rightEdgePosition = listItem.offsetLeft + listItem.offsetWidth;
158
- // Calculate the last visible position on the screen, right before the right scroll button
159
- const lastVisiblePosition = this.host.clientWidth - this.rightScrollButton.clientWidth;
160
- // If the item is already fully visible, no translation is needed
161
- if (rightEdgePosition < lastVisiblePosition)
162
- return false;
163
- const translationIncrease = rightEdgePosition - lastVisiblePosition + 1; // + 1 because offset values are rounded
164
- // If the required scroll distance is too small (less than half the width of the item), avoid unnecessary scroll
165
- if (skipSmallTranslation && translationIncrease < listItem.clientWidth / 2)
166
- return false;
167
- // Calculate the maximum translation amount to prevent scrolling past the end of the content
168
- const maximumTranslation = this.navbar.scrollWidth - this.host.clientWidth;
169
- // Adjust the translation amount, ensuring it doesn't exceed the maximum scrollable area
170
- const { marginRight } = getComputedStyle(this.navigationList);
171
- this.translationAmount =
172
- Math.min(this.translationAmount + translationIncrease, maximumTranslation) +
173
- parseInt(marginRight);
174
- return true;
175
- }
176
- translateLeftTo(navigationItem, skipSmallTranslation = false) {
177
- const listItem = navigationItem.closest('post-list-item');
178
- // Get the left edge position of the list item relative to the left of the screen
179
- const leftEdgePosition = listItem.offsetLeft;
180
- // Calculate the first visible position on the screen to the left, right after the left scroll button
181
- const firstVisiblePosition = this.leftScrollButton.clientWidth;
182
- // If the item is already fully visible, no translation is needed
183
- if (leftEdgePosition > firstVisiblePosition)
184
- return false;
185
- const translationDecrease = firstVisiblePosition - leftEdgePosition + 1; // + 1 because offset values are rounded
186
- // If the required scroll distance is too small (less than half the width of the item), don't perform the scroll
187
- if (skipSmallTranslation && translationDecrease < listItem.clientWidth / 2)
188
- return false;
189
- // Calculate the minimum allowed translation amount (no negative scrolling allowed)
190
- const minimumTranslation = 0;
191
- // Adjust the translation amount, ensuring it doesn't go below the minimum scrollable area
192
- const { marginLeft } = getComputedStyle(this.navigationList);
193
- this.translationAmount = Math.max(this.translationAmount - translationDecrease - parseInt(marginLeft), minimumTranslation);
194
- return true;
195
- }
196
- /**
197
- * Returns the navigation list container element
198
- */
199
- get navigationList() {
200
- return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
201
- }
202
- /**
203
- * Returns the navigation items
204
- */
205
- get navigationItems() {
206
- return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
123
+ scrollLeft() {
124
+ const scrollLeftRightEdge = document
125
+ .querySelector('.scroll-left')
126
+ .getBoundingClientRect().right;
127
+ for (const navigationItem of this.navigationItems.reverse()) {
128
+ const { left, width } = navigationItem.getBoundingClientRect();
129
+ // Scroll to the first navigation item that is less than 75% visible
130
+ const isThreeQuartersVisible = left + 0.25 * width > scrollLeftRightEdge;
131
+ if (!isThreeQuartersVisible) {
132
+ this.navbar.scrollBy({ left: left - scrollLeftRightEdge });
133
+ return;
134
+ }
135
+ }
207
136
  }
208
137
  /**
209
138
  * Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
210
139
  * Re-enables interactions after a brief delay to avoid blocking the user entirely.
211
140
  */
212
- disableNavbar() {
141
+ temporarilyDisableNavbar() {
213
142
  if (this.navbarDisableTimer)
214
143
  clearTimeout(this.navbarDisableTimer);
215
- this.navbar.style.pointerEvents = 'none';
144
+ this.navbar.setAttribute('inert', '');
216
145
  this.navbarDisableTimer = setTimeout(() => {
217
- this.navbar.style.pointerEvents = 'initial';
146
+ this.navbar.removeAttribute('inert');
218
147
  }, NAVBAR_DISABLE_DURATION);
219
148
  }
220
- /**
221
- * Allows to translate the navbar without a transition
222
- */
223
- withoutTransition(callback) {
224
- const transition = this.navbar.style.transition;
225
- this.navbar.style.transition = 'none';
226
- callback();
227
- setTimeout(() => {
228
- this.navbar.style.transition = transition;
229
- });
230
- }
231
149
  render() {
232
- return (h(Host, { key: 'e91995f96b3b795fe2ed5c79ee89257b5c8aec2a', slot: "post-mainnavigation", version: version }, h("div", { key: '165c6efcf5e05984708de9e0abdaed130036816e', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: 'a894f4788fc85d2fb0d6480831af711871c3b9f4', name: "back-button" })), h("nav", { key: '11d276069f40676b0c3e2fb5e8426b5803bcdad2', ref: el => (this.navbar = el) }, h("slot", { key: '6070e3f75ccfa7dfaf22554802e6c43dd025830c' })), h("div", { key: '06aefb232bfa1d7cd053e33bf7150fe418e4239a', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'f16d493af4ca62cd64a06a27ff8f805039cc806f', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, h("post-icon", { key: '8a4d2fa0b90a571445b02fa4b157ca4a5ac5eb9b', "aria-hidden": "true", name: "chevronleft" }))), h("div", { key: '2e540a2b9c6e1c1a68be89f8ed8a3a4840083b02', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: '1aafbe38dd159eedb4b8dcb72dd19a61348b603a', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, h("post-icon", { key: '72eccd291ba4a15bf64bf76f87398dddf7586bae', "aria-hidden": "true", name: "chevronright" })))));
150
+ return (h(Host, { key: '6cd850555585d87eb25e3f6892b8010f5e4d23d6', slot: "post-mainnavigation", version: version }, h("div", { key: '3411008120d072920f4de0b71c9dc014748f1390', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '2e3747380cb546bd6da77e5ffba2403586205a55', name: "back-button" })), h("div", { key: 'e9eedd836b3f679ba2861109db2d0811c1142677', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '628511a2c1812a08828e1aa2b51f26ad01a5a2cf', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: '1b660d65e1984e8701a98a369046f391fd177338', ref: el => (this.navbar = el) }, h("slot", { key: '0eb35366ac0bd58509afd6a12f68c2b09396a497' })), h("div", { key: '11145ad6602e2df78d3c3f4643cc6e4e960775aa', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '26e795cd00221dbfb1a7632453d0d48993584b0b', "aria-hidden": "true", name: "chevronright" }))));
233
151
  }
234
152
  static get is() { return "post-mainnavigation"; }
235
153
  static get originalStyleUrls() {
@@ -245,17 +163,9 @@ export class PostMainnavigation {
245
163
  static get states() {
246
164
  return {
247
165
  "canScrollLeft": {},
248
- "canScrollRight": {},
249
- "translationAmount": {}
166
+ "canScrollRight": {}
250
167
  };
251
168
  }
252
- static get elementRef() { return "host"; }
253
- static get watchers() {
254
- return [{
255
- "propName": "translationAmount",
256
- "methodName": "onTranslateAmountChanges"
257
- }];
258
- }
259
169
  static get listeners() {
260
170
  return [{
261
171
  "name": "mouseup",
@@ -263,6 +173,12 @@ export class PostMainnavigation {
263
173
  "target": "window",
264
174
  "capture": false,
265
175
  "passive": true
176
+ }, {
177
+ "name": "mouseleave",
178
+ "method": "stopScrolling",
179
+ "target": "window",
180
+ "capture": false,
181
+ "passive": true
266
182
  }];
267
183
  }
268
184
  }
@@ -4,28 +4,34 @@ import { version } from "../../../../package";
4
4
  import { breakpoint } from "../../utils/breakpoints";
5
5
  export class PostMegadropdown {
6
6
  constructor() {
7
+ this.handleClickOutside = (event) => {
8
+ if (this.device !== 'desktop')
9
+ return;
10
+ const target = event.target;
11
+ if (this.host.contains(target)) {
12
+ return;
13
+ }
14
+ if (target instanceof HTMLElement) {
15
+ const trigger = target.closest('post-megadropdown-trigger');
16
+ if (trigger) {
17
+ const targetDropdownId = trigger.getAttribute('for');
18
+ if (targetDropdownId !== this.host.id) {
19
+ return;
20
+ }
21
+ }
22
+ }
23
+ this.hide(false);
24
+ };
7
25
  this.device = breakpoint.get('name');
8
26
  this.isVisible = false;
9
27
  this.animationClass = null;
10
28
  }
11
- firstFocusableEl;
12
- lastFocusableEl;
13
- host;
14
- /** Tracks the currently active dropdown instance. */
15
- static activeDropdown = null;
16
29
  breakpointChange(e) {
17
30
  this.device = e.detail;
18
31
  if (this.device === 'desktop' && this.isVisible) {
19
32
  this.animationClass = null;
20
33
  }
21
34
  }
22
- /**
23
- * Emits when the dropdown is shown or hidden.
24
- * The event payload is an object.
25
- * `isVisible` is true when the dropdown gets opened and false when it gets closed
26
- * `focusParent` determines whether after the closing of the mega dropdown, the focus should go back to the trigger parent or naturally go to the next focusable element in the page
27
- **/
28
- postToggleMegadropdown;
29
35
  disconnectedCallback() {
30
36
  this.removeListeners();
31
37
  window.removeEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
@@ -105,24 +111,6 @@ export class PostMegadropdown {
105
111
  this.removeListeners();
106
112
  }
107
113
  }
108
- handleClickOutside = (event) => {
109
- if (this.device !== 'desktop')
110
- return;
111
- const target = event.target;
112
- if (this.host.contains(target)) {
113
- return;
114
- }
115
- if (target instanceof HTMLElement) {
116
- const trigger = target.closest('post-megadropdown-trigger');
117
- if (trigger) {
118
- const targetDropdownId = trigger.getAttribute('for');
119
- if (targetDropdownId !== this.host.id) {
120
- return;
121
- }
122
- }
123
- }
124
- this.hide(false);
125
- };
126
114
  addListeners() {
127
115
  this.host.addEventListener('keydown', e => this.keyboardHandler(e));
128
116
  document.addEventListener('keyup', e => this.handleTabOutside(e));
@@ -283,3 +271,5 @@ export class PostMegadropdown {
283
271
  }
284
272
  static get elementRef() { return "host"; }
285
273
  }
274
+ /** Tracks the currently active dropdown instance. */
275
+ PostMegadropdown.activeDropdown = null;
@@ -4,20 +4,45 @@ import { checkType } from "../../utils/index";
4
4
  import { eventGuard } from "../../utils/event-gua";
5
5
  export class PostMegadropdownTrigger {
6
6
  constructor() {
7
+ /**
8
+ * Reference to the slotted button within the trigger, if present.
9
+ * Used to manage click and key events for mega dropdown control.
10
+ */
11
+ this.slottedButton = null;
12
+ /**
13
+ * Tracks whether this trigger's dropdown was expanded before a state change.
14
+ * Used to determine if this trigger should handle focus when its dropdown closes.
15
+ */
16
+ this.wasExpanded = false;
17
+ this.handleKeyDown = (event) => {
18
+ if (event.key === 'Enter' || event.key === ' ') {
19
+ event.preventDefault();
20
+ this.handleToggle();
21
+ if (this.megadropdown && !this.ariaExpanded) {
22
+ setTimeout(() => this.megadropdown.focusFirst(), 100);
23
+ }
24
+ }
25
+ };
26
+ this.handleToggleMegadropdown = (event) => {
27
+ eventGuard(this.host, event, { targetLocalName: 'post-megadropdown' }, () => {
28
+ if (event.target.id === this.for) {
29
+ this.ariaExpanded = event.detail.isVisible;
30
+ // Focus on the trigger parent of the dropdown after it's closed if the close button had been clicked
31
+ if (this.wasExpanded && !this.ariaExpanded && event.detail.focusParent) {
32
+ setTimeout(() => {
33
+ this.slottedButton?.focus();
34
+ }, 100);
35
+ }
36
+ this.wasExpanded = this.ariaExpanded;
37
+ if (this.slottedButton) {
38
+ this.slottedButton.setAttribute('aria-expanded', this.ariaExpanded.toString());
39
+ }
40
+ }
41
+ });
42
+ };
7
43
  this.for = undefined;
8
44
  this.ariaExpanded = false;
9
45
  }
10
- host;
11
- /**
12
- * Reference to the slotted button within the trigger, if present.
13
- * Used to manage click and key events for mega dropdown control.
14
- */
15
- slottedButton = null;
16
- /**
17
- * Tracks whether this trigger's dropdown was expanded before a state change.
18
- * Used to determine if this trigger should handle focus when its dropdown closes.
19
- */
20
- wasExpanded = false;
21
46
  /**
22
47
  * Watch for changes to the `for` property to validate its type and ensure it is a string.
23
48
  * @param forValue - The new value of the `for` property.
@@ -39,32 +64,6 @@ export class PostMegadropdownTrigger {
39
64
  console.warn(`No post-megadropdown found with ID: ${this.for}`);
40
65
  }
41
66
  }
42
- handleKeyDown = (event) => {
43
- if (event.key === 'Enter' || event.key === ' ') {
44
- event.preventDefault();
45
- this.handleToggle();
46
- if (this.megadropdown && !this.ariaExpanded) {
47
- setTimeout(() => this.megadropdown.focusFirst(), 100);
48
- }
49
- }
50
- };
51
- handleToggleMegadropdown = (event) => {
52
- eventGuard(this.host, event, { targetLocalName: 'post-megadropdown' }, () => {
53
- if (event.target.id === this.for) {
54
- this.ariaExpanded = event.detail.isVisible;
55
- // Focus on the trigger parent of the dropdown after it's closed if the close button had been clicked
56
- if (this.wasExpanded && !this.ariaExpanded && event.detail.focusParent) {
57
- setTimeout(() => {
58
- this.slottedButton?.focus();
59
- }, 100);
60
- }
61
- this.wasExpanded = this.ariaExpanded;
62
- if (this.slottedButton) {
63
- this.slottedButton.setAttribute('aria-expanded', this.ariaExpanded.toString());
64
- }
65
- }
66
- });
67
- };
68
67
  componentDidLoad() {
69
68
  this.validateControlFor();
70
69
  // Check if the mega dropdown attached to the trigger is expanded or not