@swisspost/design-system-components 9.0.0-next.21 → 9.0.0-next.23

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 (182) hide show
  1. package/dist/cjs/breakpoints-c6247c71.js +54 -0
  2. package/dist/cjs/index.cjs.js +21 -20
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{package-c6bc9e82.js → package-fdebc7ce.js} +1 -1
  5. package/dist/cjs/{post-accordion-d1345784.js → post-accordion-d6ddb379.js} +1 -1
  6. package/dist/cjs/{post-accordion-item-a796d803.js → post-accordion-item-61aed72f.js} +1 -1
  7. package/dist/cjs/post-accordion-item.cjs.entry.js +2 -2
  8. package/dist/cjs/post-accordion.cjs.entry.js +2 -2
  9. package/dist/cjs/{post-avatar-b4e96354.js → post-avatar-b5d6aaa9.js} +1 -1
  10. package/dist/cjs/post-avatar.cjs.entry.js +2 -2
  11. package/dist/cjs/{post-back-to-top-fc541c6b.js → post-back-to-top-80cbf486.js} +1 -1
  12. package/dist/cjs/post-back-to-top.cjs.entry.js +2 -2
  13. package/dist/cjs/{post-banner-46522b4f.js → post-banner-72f433b1.js} +1 -1
  14. package/dist/cjs/post-banner.cjs.entry.js +2 -2
  15. package/dist/cjs/{post-breadcrumb-799d34da.js → post-breadcrumb-63107527.js} +1 -1
  16. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +2 -2
  17. package/dist/cjs/post-breadcrumb.cjs.entry.js +2 -2
  18. package/dist/cjs/{post-card-control-7bf7d3f2.js → post-card-control-dfb221d5.js} +1 -1
  19. package/dist/cjs/post-card-control.cjs.entry.js +2 -2
  20. package/dist/cjs/post-closebutton_15.cjs.entry.js +3 -2
  21. package/dist/cjs/{post-collapsible-trigger-0568e3ec.js → post-collapsible-trigger-e24eae7e.js} +1 -1
  22. package/dist/cjs/post-collapsible_2.cjs.entry.js +2 -2
  23. package/dist/cjs/post-components.cjs.js +1 -1
  24. package/dist/cjs/{post-footer-f87a556b.js → post-footer-cfa3cc4c.js} +3 -53
  25. package/dist/cjs/post-footer.cjs.entry.js +3 -2
  26. package/dist/cjs/{post-linkarea-0ccf93fc.js → post-linkarea-9e808259.js} +1 -1
  27. package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
  28. package/dist/cjs/{post-menu-item-eba24c40.js → post-menu-item-0e147e2c.js} +1 -1
  29. package/dist/cjs/{post-popover-35f679f6.js → post-popover-bddabf57.js} +1 -1
  30. package/dist/cjs/post-popover.cjs.entry.js +2 -2
  31. package/dist/cjs/{post-rating-d12fa214.js → post-rating-f4c48349.js} +1 -1
  32. package/dist/cjs/post-rating.cjs.entry.js +2 -2
  33. package/dist/cjs/{post-tab-header-89dca04b.js → post-tab-header-246cd064.js} +1 -1
  34. package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
  35. package/dist/cjs/{post-tab-panel-ad1ab180.js → post-tab-panel-0e494e5c.js} +1 -1
  36. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  37. package/dist/cjs/{post-tabs-0db75745.js → post-tabs-3ead6ac7.js} +1 -1
  38. package/dist/cjs/post-tabs.cjs.entry.js +2 -2
  39. package/dist/cjs/{post-tag-396a46c9.js → post-tag-f62abd13.js} +1 -1
  40. package/dist/cjs/post-tag.cjs.entry.js +2 -2
  41. package/dist/cjs/{post-togglebutton-69983699.js → post-togglebutton-63708f9f.js} +84 -50
  42. package/dist/cjs/{post-tooltip-7174ea97.js → post-tooltip-2f80afc8.js} +1 -1
  43. package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
  44. package/dist/collection/components/post-header/post-header.css +1 -1
  45. package/dist/collection/components/post-header/post-header.js +50 -33
  46. package/dist/collection/components/post-language-option/post-language-option.css +1 -1
  47. package/dist/collection/components/post-language-switch/post-language-switch.js +1 -1
  48. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  49. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +16 -4
  50. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  51. package/dist/collection/components/post-megadropdown/post-megadropdown.js +15 -10
  52. package/dist/components/breakpoints.js +52 -0
  53. package/dist/components/package.js +1 -1
  54. package/dist/components/post-footer2.js +1 -51
  55. package/dist/components/post-header2.js +184 -34
  56. package/dist/components/post-language-option2.js +1 -1
  57. package/dist/components/post-language-switch2.js +1 -1
  58. package/dist/components/post-mainnavigation2.js +17 -5
  59. package/dist/components/post-megadropdown2.js +15 -10
  60. package/dist/docs.json +2 -2
  61. package/dist/esm/breakpoints-bbe0c54e.js +52 -0
  62. package/dist/esm/index.js +21 -20
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/package-30b5445a.js +3 -0
  65. package/dist/esm/{post-accordion-f6d1834d.js → post-accordion-72896a6b.js} +1 -1
  66. package/dist/esm/{post-accordion-item-7cb93300.js → post-accordion-item-42446f00.js} +1 -1
  67. package/dist/esm/post-accordion-item.entry.js +2 -2
  68. package/dist/esm/post-accordion.entry.js +2 -2
  69. package/dist/esm/{post-avatar-96108967.js → post-avatar-3d552832.js} +1 -1
  70. package/dist/esm/post-avatar.entry.js +2 -2
  71. package/dist/esm/{post-back-to-top-7f8a61c8.js → post-back-to-top-dbfe00b0.js} +1 -1
  72. package/dist/esm/post-back-to-top.entry.js +2 -2
  73. package/dist/esm/{post-banner-bb69bce8.js → post-banner-3ec35c25.js} +1 -1
  74. package/dist/esm/post-banner.entry.js +2 -2
  75. package/dist/esm/{post-breadcrumb-9d9efa4e.js → post-breadcrumb-640a1b7a.js} +1 -1
  76. package/dist/esm/post-breadcrumb-item_2.entry.js +2 -2
  77. package/dist/esm/post-breadcrumb.entry.js +2 -2
  78. package/dist/esm/{post-card-control-fdced7d5.js → post-card-control-549f9ac0.js} +1 -1
  79. package/dist/esm/post-card-control.entry.js +2 -2
  80. package/dist/esm/post-closebutton_15.entry.js +3 -2
  81. package/dist/esm/{post-collapsible-trigger-17b2f067.js → post-collapsible-trigger-76749a79.js} +1 -1
  82. package/dist/esm/post-collapsible_2.entry.js +2 -2
  83. package/dist/esm/post-components.js +1 -1
  84. package/dist/esm/{post-footer-2dcd8159.js → post-footer-2fb4d20e.js} +2 -52
  85. package/dist/esm/post-footer.entry.js +3 -2
  86. package/dist/esm/{post-linkarea-06c5144d.js → post-linkarea-d7dbf30c.js} +1 -1
  87. package/dist/esm/post-linkarea.entry.js +2 -2
  88. package/dist/esm/{post-menu-item-e917bf99.js → post-menu-item-80d44823.js} +1 -1
  89. package/dist/esm/{post-popover-67a3cbf2.js → post-popover-1fb2446b.js} +1 -1
  90. package/dist/esm/post-popover.entry.js +2 -2
  91. package/dist/esm/{post-rating-9613bee8.js → post-rating-e9a95e85.js} +1 -1
  92. package/dist/esm/post-rating.entry.js +2 -2
  93. package/dist/esm/{post-tab-header-dff3a025.js → post-tab-header-aa2be14d.js} +1 -1
  94. package/dist/esm/post-tab-header.entry.js +2 -2
  95. package/dist/esm/{post-tab-panel-2b3f82a8.js → post-tab-panel-15f4254a.js} +1 -1
  96. package/dist/esm/post-tab-panel.entry.js +2 -2
  97. package/dist/esm/{post-tabs-46d1165f.js → post-tabs-07612298.js} +1 -1
  98. package/dist/esm/post-tabs.entry.js +2 -2
  99. package/dist/esm/{post-tag-4176268e.js → post-tag-b9d3bb0f.js} +1 -1
  100. package/dist/esm/post-tag.entry.js +2 -2
  101. package/dist/esm/{post-togglebutton-5892c5bd.js → post-togglebutton-5f0e2508.js} +84 -50
  102. package/dist/esm/{post-tooltip-5a45a569.js → post-tooltip-b1309328.js} +1 -1
  103. package/dist/esm/post-tooltip.entry.js +2 -2
  104. package/dist/post-components/index.esm.js +1 -1
  105. package/dist/post-components/p-32caa5d5.entry.js +1 -0
  106. package/dist/post-components/{p-fe8c300c.js → p-33963539.js} +1 -1
  107. package/dist/post-components/p-3994c72c.entry.js +1 -0
  108. package/dist/post-components/p-442957b7.entry.js +1 -0
  109. package/dist/post-components/p-449caeba.entry.js +1 -0
  110. package/dist/post-components/{p-04895a54.js → p-4f6694d4.js} +1 -1
  111. package/dist/post-components/p-513e4b41.entry.js +1 -0
  112. package/dist/post-components/{p-b9bf5a5f.js → p-530bedb1.js} +1 -1
  113. package/dist/post-components/{p-52790b8b.js → p-534ca692.js} +1 -1
  114. package/dist/post-components/p-5556960c.entry.js +1 -0
  115. package/dist/post-components/p-590c8681.entry.js +1 -0
  116. package/dist/post-components/p-5aeb3656.js +1 -0
  117. package/dist/post-components/p-68e0803e.entry.js +1 -0
  118. package/dist/post-components/p-6be78a63.entry.js +1 -0
  119. package/dist/post-components/{p-67a45f16.js → p-745ce238.js} +1 -1
  120. package/dist/post-components/{p-4f41f63e.js → p-75627a39.js} +1 -1
  121. package/dist/post-components/{p-59ca0a13.js → p-7b526da4.js} +1 -1
  122. package/dist/post-components/{p-2b1281af.js → p-7c08cad2.js} +1 -1
  123. package/dist/post-components/{p-12a11565.js → p-819f6f7e.js} +1 -1
  124. package/dist/post-components/p-8891c692.entry.js +1 -0
  125. package/dist/post-components/p-88b5add2.js +1 -0
  126. package/dist/post-components/{p-12573893.js → p-9f986e3d.js} +1 -1
  127. package/dist/post-components/p-a1cbef0b.entry.js +1 -0
  128. package/dist/post-components/{p-79c552fb.js → p-b1b5248c.js} +1 -1
  129. package/dist/post-components/p-b54c207a.js +1 -0
  130. package/dist/post-components/{p-803b7598.js → p-b559d89c.js} +1 -1
  131. package/dist/post-components/{p-98fcf90b.entry.js → p-b5f43c76.entry.js} +1 -1
  132. package/dist/post-components/{p-47cb31dd.js → p-b6e041ee.js} +1 -1
  133. package/dist/post-components/{p-30af1d48.js → p-bbf9ba02.js} +1 -1
  134. package/dist/post-components/p-ca01c184.js +1 -0
  135. package/dist/post-components/{p-07a0a626.js → p-d993dd37.js} +1 -1
  136. package/dist/post-components/p-d9e7aec4.entry.js +1 -0
  137. package/dist/post-components/p-da18066a.entry.js +1 -0
  138. package/dist/post-components/{p-dd4a5c0a.entry.js → p-e2da4e76.entry.js} +1 -1
  139. package/dist/post-components/p-e3d794b1.entry.js +1 -0
  140. package/dist/post-components/{p-c6b3a926.js → p-eba6a679.js} +1 -1
  141. package/dist/post-components/p-f175148d.entry.js +1 -0
  142. package/dist/post-components/{p-017dc6c7.js → p-f1995b47.js} +1 -1
  143. package/dist/post-components/p-f5a940f4.entry.js +1 -0
  144. package/dist/post-components/p-fcb60a95.entry.js +1 -0
  145. package/dist/post-components/post-components.esm.js +1 -1
  146. package/dist/types/components/post-header/post-header.d.ts +7 -5
  147. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +1 -0
  148. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +5 -3
  149. package/dist/types/components.d.ts +3 -0
  150. package/loaders/breakpoints.js +52 -0
  151. package/loaders/index.js +2 -1
  152. package/loaders/package.js +1 -1
  153. package/loaders/post-footer.js +1 -51
  154. package/loaders/post-header.js +184 -34
  155. package/loaders/post-language-option.js +1 -1
  156. package/loaders/post-language-switch.js +1 -1
  157. package/loaders/post-mainnavigation.js +17 -5
  158. package/loaders/post-megadropdown.js +15 -10
  159. package/package.json +3 -3
  160. package/dist/components/index3.js +0 -135
  161. package/dist/esm/package-5614c98b.js +0 -3
  162. package/dist/post-components/p-0227b899.js +0 -1
  163. package/dist/post-components/p-04c38bfe.entry.js +0 -1
  164. package/dist/post-components/p-1289b0a7.entry.js +0 -1
  165. package/dist/post-components/p-1542a80e.entry.js +0 -1
  166. package/dist/post-components/p-254a9bd2.entry.js +0 -1
  167. package/dist/post-components/p-28500934.entry.js +0 -1
  168. package/dist/post-components/p-2c69e7f2.entry.js +0 -1
  169. package/dist/post-components/p-30132b19.entry.js +0 -1
  170. package/dist/post-components/p-3bdeb686.entry.js +0 -1
  171. package/dist/post-components/p-5aaa5703.entry.js +0 -1
  172. package/dist/post-components/p-6d8ac9bd.entry.js +0 -1
  173. package/dist/post-components/p-77cc2a5e.entry.js +0 -1
  174. package/dist/post-components/p-7dd05e6d.entry.js +0 -1
  175. package/dist/post-components/p-994fae4c.entry.js +0 -1
  176. package/dist/post-components/p-a805515a.entry.js +0 -1
  177. package/dist/post-components/p-b5b48f66.entry.js +0 -1
  178. package/dist/post-components/p-c9dd3cdb.entry.js +0 -1
  179. package/dist/post-components/p-cb5e4a06.js +0 -1
  180. package/dist/post-components/p-e6d54838.entry.js +0 -1
  181. package/dist/post-components/p-f4b0cc7d.js +0 -1
  182. package/loaders/index3.js +0 -135
@@ -1,10 +1,143 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { t as throttle } from './index3.js';
3
2
  import { v as version } from './package.js';
4
3
  import { s as slideUp, a as slideDown } from './slide.js';
5
4
  import { g as getFocusableChildren } from './get-focusable-children.js';
6
5
 
7
- const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}.global-sub{display:flex;align-items:center;gap:24px}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out;border-block-end:1px solid #e1e0dc}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:18px;box-shadow:var(--post-device-elevation-300)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:12px;flex-wrap:wrap;gap:16px}.local-header.local-header-mobile-extended{border-bottom:1px solid #e1e0dc}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:16px}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:12px !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:8px !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:28px !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:20px !important;max-width:calc(100vw - 8px - 16px)}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:#fff;inset-block-end:calc(100dvh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:16px 24px;padding-inline:32px}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100dvh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:#fafafa;gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
6
+ /* eslint-disable no-undefined,no-param-reassign,no-shadow */
7
+
8
+ /**
9
+ * Throttle execution of a function. Especially useful for rate limiting
10
+ * execution of handlers on events like resize and scroll.
11
+ *
12
+ * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
13
+ * are most useful.
14
+ * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
15
+ * as-is, to `callback` when the throttled-function is executed.
16
+ * @param {object} [options] - An object to configure options.
17
+ * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
18
+ * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
19
+ * one final time after the last throttled-function call. (After the throttled-function has not been called for
20
+ * `delay` milliseconds, the internal counter is reset).
21
+ * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
22
+ * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
23
+ * callback will never executed if both noLeading = true and noTrailing = true.
24
+ * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
25
+ * false (at end), schedule `callback` to execute after `delay` ms.
26
+ *
27
+ * @returns {Function} A new, throttled, function.
28
+ */
29
+ function throttle (delay, callback, options) {
30
+ var _ref = options || {},
31
+ _ref$noTrailing = _ref.noTrailing,
32
+ noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
33
+ _ref$noLeading = _ref.noLeading,
34
+ noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
35
+ _ref$debounceMode = _ref.debounceMode,
36
+ debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
37
+ /*
38
+ * After wrapper has stopped being called, this timeout ensures that
39
+ * `callback` is executed at the proper times in `throttle` and `end`
40
+ * debounce modes.
41
+ */
42
+ var timeoutID;
43
+ var cancelled = false;
44
+
45
+ // Keep track of the last time `callback` was executed.
46
+ var lastExec = 0;
47
+
48
+ // Function to clear existing timeout
49
+ function clearExistingTimeout() {
50
+ if (timeoutID) {
51
+ clearTimeout(timeoutID);
52
+ }
53
+ }
54
+
55
+ // Function to cancel next exec
56
+ function cancel(options) {
57
+ var _ref2 = options || {},
58
+ _ref2$upcomingOnly = _ref2.upcomingOnly,
59
+ upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
60
+ clearExistingTimeout();
61
+ cancelled = !upcomingOnly;
62
+ }
63
+
64
+ /*
65
+ * The `wrapper` function encapsulates all of the throttling / debouncing
66
+ * functionality and when executed will limit the rate at which `callback`
67
+ * is executed.
68
+ */
69
+ function wrapper() {
70
+ for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
71
+ arguments_[_key] = arguments[_key];
72
+ }
73
+ var self = this;
74
+ var elapsed = Date.now() - lastExec;
75
+ if (cancelled) {
76
+ return;
77
+ }
78
+
79
+ // Execute `callback` and update the `lastExec` timestamp.
80
+ function exec() {
81
+ lastExec = Date.now();
82
+ callback.apply(self, arguments_);
83
+ }
84
+
85
+ /*
86
+ * If `debounceMode` is true (at begin) this is used to clear the flag
87
+ * to allow future `callback` executions.
88
+ */
89
+ function clear() {
90
+ timeoutID = undefined;
91
+ }
92
+ if (!noLeading && debounceMode && !timeoutID) {
93
+ /*
94
+ * Since `wrapper` is being called for the first time and
95
+ * `debounceMode` is true (at begin), execute `callback`
96
+ * and noLeading != true.
97
+ */
98
+ exec();
99
+ }
100
+ clearExistingTimeout();
101
+ if (debounceMode === undefined && elapsed > delay) {
102
+ if (noLeading) {
103
+ /*
104
+ * In throttle mode with noLeading, if `delay` time has
105
+ * been exceeded, update `lastExec` and schedule `callback`
106
+ * to execute after `delay` ms.
107
+ */
108
+ lastExec = Date.now();
109
+ if (!noTrailing) {
110
+ timeoutID = setTimeout(debounceMode ? clear : exec, delay);
111
+ }
112
+ } else {
113
+ /*
114
+ * In throttle mode without noLeading, if `delay` time has been exceeded, execute
115
+ * `callback`.
116
+ */
117
+ exec();
118
+ }
119
+ } else if (noTrailing !== true) {
120
+ /*
121
+ * In trailing throttle mode, since `delay` time has not been
122
+ * exceeded, schedule `callback` to execute `delay` ms after most
123
+ * recent execution.
124
+ *
125
+ * If `debounceMode` is true (at begin), schedule `clear` to execute
126
+ * after `delay` ms.
127
+ *
128
+ * If `debounceMode` is false (at end), schedule `callback` to
129
+ * execute after `delay` ms.
130
+ */
131
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
132
+ }
133
+ }
134
+ wrapper.cancel = cancel;
135
+
136
+ // Return the wrapper function.
137
+ return wrapper;
138
+ }
139
+
140
+ const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}.global-sub{display:flex;align-items:center;gap:24px}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out}.local-header::after{content:\"\";position:absolute;width:100%;height:1px;background-color:#e1e0dc;bottom:-1px;z-index:1}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:18px;box-shadow:var(--post-device-elevation-300)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:12px;flex-wrap:wrap;gap:16px}.local-header.local-header-mobile-extended::after{bottom:0}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:16px}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:12px !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:8px !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:28px !important;line-height:34px !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:20px !important;max-width:calc(100vw - 8px - 16px)}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:#fff;inset-block-end:calc(100dvh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:16px 24px;padding-inline:32px}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100dvh - var(--header-height));display:flex;flex-direction:column}.navigation.extended.scroll-y{overflow-y:auto}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:#fafafa;gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
8
141
  const PostHeaderStyle0 = postHeaderCss;
9
142
 
10
143
  const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends HTMLElement {
@@ -15,17 +148,23 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
15
148
  this.postUpdateDevice = createEvent(this, "postUpdateDevice", 7);
16
149
  this.device = null;
17
150
  this.mobileMenuExtended = false;
151
+ this.megadropdownOpen = false;
18
152
  }
19
153
  firstFocusableEl;
20
154
  lastFocusableEl;
21
- scrollParent = null;
155
+ scrollListenerElement = null;
156
+ overflowElement = null;
22
157
  mobileMenu;
23
158
  mobileMenuAnimation;
24
159
  throttledScroll = () => this.handleScrollEvent();
25
160
  throttledResize = throttle(50, () => this.handleResize());
26
161
  componentWillRender() {
27
- this.scrollParent = this.getScrollParent(this.host);
28
- this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
162
+ this.scrollListenerElement = this.getScrollParent();
163
+ this.overflowElement =
164
+ this.scrollListenerElement === document
165
+ ? document.documentElement
166
+ : this.scrollListenerElement;
167
+ this.scrollListenerElement.addEventListener('scroll', this.throttledScroll, { passive: true });
29
168
  window.addEventListener('resize', this.throttledResize, { passive: true });
30
169
  this.handleResize();
31
170
  this.handleScrollEvent();
@@ -33,18 +172,24 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
33
172
  }
34
173
  componentDidLoad() {
35
174
  this.updateLocalHeaderHeight();
175
+ // Check if the mega dropdown is expanded
176
+ document.addEventListener('postToggleMegadropdown', (event) => {
177
+ this.megadropdownOpen = event.detail.isVisible;
178
+ });
179
+ this.host.addEventListener('click', this.handleLinkClick.bind(this));
36
180
  }
37
181
  // Clean up possible side effects when post-header is disconnected
38
182
  disconnectedCallback() {
39
183
  this.mobileMenuExtended = false;
40
- document.body.style.overflow = '';
184
+ this.overflowElement.style.overflow = '';
41
185
  this.host.removeEventListener('keydown', e => {
42
186
  this.keyboardHandler(e);
43
187
  });
188
+ this.host.removeEventListener('click', this.handleLinkClick.bind(this));
44
189
  }
45
190
  get host() { return this; }
46
191
  frozeBody(isMobileMenuExtended) {
47
- document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
192
+ this.overflowElement.style.overflow = isMobileMenuExtended ? 'hidden' : '';
48
193
  if (isMobileMenuExtended) {
49
194
  this.host.addEventListener('keydown', e => {
50
195
  this.keyboardHandler(e);
@@ -109,42 +254,43 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
109
254
  }
110
255
  }
111
256
  }
257
+ getScrollParent() {
258
+ let parent = this.host.parentElement;
259
+ if (parent.tagName === 'BODY') {
260
+ parent = document;
261
+ }
262
+ return parent;
263
+ }
112
264
  handleScrollEvent() {
113
265
  // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
114
- const st = Math.max(0, this.scrollParent instanceof Document
115
- ? this.scrollParent.documentElement.scrollTop
116
- : this.scrollParent.scrollTop);
266
+ const st = Math.max(0, this.scrollListenerElement instanceof Document
267
+ ? this.scrollListenerElement.documentElement.scrollTop
268
+ : this.scrollListenerElement.scrollTop);
117
269
  this.host.style.setProperty('--header-scroll-top', `${st}px`);
118
270
  }
119
- getScrollParent(node) {
120
- let currentParent = node.parentElement;
121
- while (currentParent) {
122
- if (currentParent.nodeName === 'BODY') {
123
- return document;
124
- }
125
- if (this.isScrollable(currentParent)) {
126
- return currentParent;
127
- }
128
- currentParent = currentParent.parentElement;
129
- }
130
- return document;
131
- }
132
- isScrollable(node) {
133
- if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
134
- return false;
135
- }
136
- const style = getComputedStyle(node);
137
- return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
138
- const value = style.getPropertyValue(propertyName);
139
- return value === 'auto' || value === 'scroll';
140
- });
141
- }
142
271
  updateLocalHeaderHeight() {
143
272
  requestAnimationFrame(() => {
144
273
  const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight || 0;
145
274
  this.host.style.setProperty('--local-header-height', `${mhh}px`);
146
275
  });
147
276
  }
277
+ handleLinkClick(event) {
278
+ const target = event.target;
279
+ const isLinkInMainNav = target.closest('post-mainnavigation a');
280
+ const isLinkInMegadropdown = target.closest('post-megadropdown a');
281
+ if (!isLinkInMainNav && !isLinkInMegadropdown) {
282
+ return;
283
+ }
284
+ if (this.mobileMenuExtended && (isLinkInMainNav || isLinkInMegadropdown)) {
285
+ this.toggleMobileMenu();
286
+ }
287
+ if (this.device === 'desktop' && isLinkInMegadropdown) {
288
+ const megadropdownLink = target.closest('post-megadropdown a');
289
+ if (megadropdownLink) {
290
+ target.closest('post-megadropdown').hide(true);
291
+ }
292
+ }
293
+ }
148
294
  handleResize() {
149
295
  const previousDevice = this.device;
150
296
  let newDevice;
@@ -184,10 +330,13 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
184
330
  if (this.mobileMenuExtended) {
185
331
  navigationClasses.push('extended');
186
332
  }
333
+ if (!this.megadropdownOpen) {
334
+ navigationClasses.push('scroll-y');
335
+ }
187
336
  return (h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" })))));
188
337
  }
189
338
  render() {
190
- return (h(Host, { key: '45452d2c2f6ac9a067ce71330ea898a797040cca', version: version }, h("div", { key: 'c50478141de45d0a718b18c0edc416eb9c832fde', class: "global-header" }, h("div", { key: 'a2ddc2de9a94fb3b16928fe9c1ac3b3ae61ff9bf', class: "global-sub" }, h("div", { key: '30083683ff7683202118471473f2a0ed98a1c920', class: "logo" }, h("slot", { key: '028bd4a8f03a228378b09a80dce8654d52c30e5c', name: "post-logo" }))), h("div", { key: '853bcf2e6c8a95d88f62795cef8d8e58c8996811', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '40e3027a4e4358b7a614558ed7e1f59fa65ed312', name: "meta-navigation" }), h("slot", { key: '31c141cc45aa12441557d9b817630328df3d3778', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'afe4b2c3123a89c1a4390578c22e89dfff7be655', name: "post-language-switch" }), h("div", { key: 'aea74d0c7f25288afa18b5aeb3e557216d695ec3', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '1efed8b7c823ef49b89120ed2e23f151c64b9c0e', name: "post-togglebutton" })))), h("div", { key: 'e09df2136d01c0516d0166f505055615cf1d70d3', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '491f9bbcb2743519f544b24ae6f00405be85e589', name: "title" }), h("div", { key: 'e85c0a76597832a6966e989111b4508579fb9c4d', class: "local-sub" }, h("slot", { key: 'f2d504ea6a3d7592a15551e6be8cb0c1ba220fbc', name: "local-controls" }), h("slot", { key: 'e0dd0f9c12e0c6bf5d5d66cb29139af59f7c0b4d' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
339
+ return (h(Host, { key: 'd92b8f3fbf93f1defc6eff9d7283c7452962f1d9', version: version }, h("div", { key: '2d4d19e4aab0bb294c95b4ed672aaac0d0ad23e9', class: "global-header" }, h("div", { key: '069ae5f4ad46baa0245dd97966738a1d4be8d954', class: "global-sub" }, h("div", { key: 'f48c56b8dab12bc8e9a19628d4bc9f7a99ebfd8a', class: "logo" }, h("slot", { key: '663d5f7aa39ec7ff68dd90f24472740ab49d6838', name: "post-logo" }))), h("div", { key: '6a0c11629c5d58d63b49cf99f87fa5858d05c5b0', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: 'ecc46275f314af761ab96fc209133e5f011d25e1', name: "meta-navigation" }), h("slot", { key: '92d41365424c09e07750be9f561d08d062d25c37', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: '6c4d7640261933e939a0cde1cf73d26024e4fcfc', name: "post-language-switch" }), h("div", { key: '39e2ee687469c80f36559d3e50210203e20e2854', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: 'f8e746e4dfef7f2427a78ac40b81f4cfd9422d95', name: "post-togglebutton" })))), h("div", { key: '90ca0666714d3e87600bd0ba160dcec289d9ed98', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '08eb843b431faceac96aaada6714bd86c26f41f5', name: "title" }), h("div", { key: '04542458a9e4aa804daf74d17471a3849e62071e', class: "local-sub" }, h("slot", { key: 'c8c2bc0a9d8433776241c1121a04feb13c34b30c', name: "local-controls" }), h("slot", { key: 'c0b60ab9499dbb9bf08a7e104bac218accd16861' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
191
340
  }
192
341
  static get watchers() { return {
193
342
  "mobileMenuExtended": ["frozeBody"]
@@ -196,6 +345,7 @@ const PostHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostHeader extends H
196
345
  }, [1, "post-header", {
197
346
  "device": [32],
198
347
  "mobileMenuExtended": [32],
348
+ "megadropdownOpen": [32],
199
349
  "toggleMobileMenu": [64]
200
350
  }, undefined, {
201
351
  "mobileMenuExtended": ["frozeBody"]
@@ -3,7 +3,7 @@ import { c as checkEmptyOrType } from './index2.js';
3
3
  import { v as version } from './package.js';
4
4
  import { c as checkType } from './check-type.js';
5
5
 
6
- const postLanguageOptionCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */post-language-option{display:inline-block}post-language-option 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}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option button{background-color:ButtonFace !important}post-language-option button:hover{background-color:Highlight !important}}post-language-option a{color:inherit;text-decoration:none}post-language-option :is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:2px;text-transform:uppercase}post-language-option :is(a,button){outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-language-option:where([variant=list]) :is(a,button){padding-inline:0;width:40px;height:40px;border-radius:2px}post-language-option:where([variant=list]) :is(a,button):hover{color:#504f4b}post-language-option:where([variant=list]):not([active=false]) :is(a,button){background-color:#050400 !important;color:#fff;pointer-events:none}post-language-option:where([variant=list]):not([active=false]) :hover{color:#fff}post-language-option:where([variant=menu]){width:100%}post-language-option:where([variant=menu]):not([active=false]){display:none}post-language-option:where([variant=menu]) :is(a,button){padding-block:13px;padding-inline:24px;box-sizing:border-box;position:relative;width:100%}post-language-option:where([variant=menu]) :is(a,button):hover{color:#fff;background-color:#504f4b}";
6
+ const postLanguageOptionCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */post-language-option{display:inline-block}post-language-option 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}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option button{background-color:ButtonFace !important}post-language-option button:hover{background-color:Highlight !important}}post-language-option a{color:inherit;text-decoration:none}post-language-option :is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:2px;text-transform:uppercase}post-language-option :is(a,button){outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-language-option :is(a,button):is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-language-option:where([variant=list]) :is(a,button){padding-inline:0;width:40px;height:40px;border-radius:2px}post-language-option:where([variant=list]) :is(a,button):hover{color:#504f4b}post-language-option:where([variant=list])[active]:not([active=false]) :is(a,button){background-color:#050400 !important;color:#fff;pointer-events:none}post-language-option:where([variant=menu]){width:100%}post-language-option:where([variant=menu])[active]:not([active=false]){display:none}post-language-option:where([variant=menu]) :is(a,button){padding-block:13px;padding-inline:24px;box-sizing:border-box;position:relative;width:100%}post-language-option:where([variant=menu]) :is(a,button):hover{color:#fff;background-color:#504f4b}";
7
7
  const PostLanguageOptionStyle0 = postLanguageOptionCss;
8
8
 
9
9
  const PostLanguageOption$1 = /*@__PURE__*/ proxyCustomElement(class PostLanguageOption extends HTMLElement {
@@ -68,7 +68,7 @@ const PostLanguageSwitch$1 = /*@__PURE__*/ proxyCustomElement(class PostLanguage
68
68
  // Hides the dropdown when an option has been clicked
69
69
  if (this.variant === 'menu') {
70
70
  const menu = this.host.shadowRoot.querySelector('post-menu');
71
- menu.toggle(menu);
71
+ menu.hide();
72
72
  }
73
73
  });
74
74
  }
@@ -1,8 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { t as throttle } from './index3.js';
3
2
  import { d as defineCustomElement$2 } from './post-icon2.js';
4
3
 
5
- const postMainnavigationCss = "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 post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-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}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 screen and (min-width: 1024px){post-mainnavigation{display:block}post-mainnavigation nav{max-width:100vw;background:#fff;max-height:var(--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(--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{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(--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%;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;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}";
4
+ const postMainnavigationCss = "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 post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-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}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 screen and (min-width: 1024px){post-mainnavigation{display:block}post-mainnavigation nav{max-width:100%;background:#fff;max-height:var(--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(--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(--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%;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;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}";
6
5
  const PostMainnavigationStyle0 = postMainnavigationCss;
7
6
 
8
7
  const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
@@ -23,6 +22,7 @@ const PostMainnavigation$1 = /*@__PURE__*/ proxyCustomElement(class PostMainnavi
23
22
  leftScrollButton;
24
23
  scrollRepeatInterval;
25
24
  navbarDisableTimer;
25
+ resizeObserver;
26
26
  mutationObserver = new MutationObserver(async (mutations) => {
27
27
  // Wait for all elements to be hydrated
28
28
  await Promise.all(mutations
@@ -52,13 +52,25 @@ const PostMainnavigation$1 = /*@__PURE__*/ proxyCustomElement(class PostMainnavi
52
52
  disconnectedCallback() {
53
53
  this.header = null;
54
54
  this.mutationObserver.disconnect();
55
+ if (this.resizeObserver) {
56
+ this.resizeObserver.disconnect();
57
+ }
55
58
  }
56
59
  componentDidLoad() {
57
60
  setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
61
+ this.resizeObserver = new ResizeObserver(() => {
62
+ this.checkScrollability();
63
+ });
64
+ // Observe the navbar and the navigation list for size changes
65
+ if (this.navbar) {
66
+ this.resizeObserver.observe(this.navbar);
67
+ const navList = this.navigationList;
68
+ if (navList) {
69
+ this.resizeObserver.observe(navList);
70
+ }
71
+ }
58
72
  this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
59
73
  this.fixLayoutShift();
60
- window.addEventListener('resize', // Recheck scrollability on window resize
61
- throttle(100, () => this.checkScrollability()));
62
74
  // Handle focus changes and adjust scroll as needed
63
75
  this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
64
76
  }
@@ -223,7 +235,7 @@ const PostMainnavigation$1 = /*@__PURE__*/ proxyCustomElement(class PostMainnavi
223
235
  });
224
236
  }
225
237
  render() {
226
- return (h(Host, { key: 'd9be56167f714c041eb05283832986ec38c451cd', slot: "post-mainnavigation" }, h("div", { key: '5852c66b93a6eb9697fd7c7b1379e748804c6917', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '0d4d98897fb5a8f8cf1c0871037ac01023c41cc2', name: "back-button" })), h("nav", { key: 'c60635b5db5a54b9e7661b92eeec29ed6d453cfe', ref: el => (this.navbar = el) }, h("slot", { key: 'd83facd6cb8c2a892ad432e42357123660c647ed' })), h("div", { key: 'e9afc48596b3e877d9efb9a4189abb8c84aadb6d', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'ef11720ec4f6d7811eb10027871a336e46ba6b84', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, h("post-icon", { key: 'f85ff2ef87841409f4b4f6c33e6d0dca4c764cc6', "aria-hidden": "true", name: "chevronleft" }))), h("div", { key: '181dc100ddedcba3f07b5f0ff9aedf165499f74f', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: '83a8a824fcfe499207f6030e11381e68d530c67d', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, h("post-icon", { key: '52caec8a9a8c15e97ea5702ec3fe30bd4777c728', "aria-hidden": "true", name: "chevronright" })))));
238
+ return (h(Host, { key: '3c740536fd968e22d22a8117766df12800e6eb6e', slot: "post-mainnavigation" }, h("div", { key: '113602ca8b5ee48c290b31b77329b34d85df40bd', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '6cd5e18449f1a9340a6c35c0b97385f0a4bf6ede', name: "back-button" })), h("nav", { key: '6fb39c4a929f973468407928b43f877233fa9326', ref: el => (this.navbar = el) }, h("slot", { key: 'dd9957b2dea293bc7153239f817ac76f37db3728' })), h("div", { key: '3942637952cec7095dbbcfa16aea1a3768a52fdb', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: '381b0aef119a161e6e3ac8f396ef8a214df0c439', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, h("post-icon", { key: '632835cf735a1d5487d1e18861622318041b9fb3', "aria-hidden": "true", name: "chevronleft" }))), h("div", { key: '2cb6c7222c5e755ba1fdfc8c9e68d73299efe0de', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'd665cde32ea285134522a00689accf3cc40c927c', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, h("post-icon", { key: '13530078ad9aa9b48bdfd5bd78c8aa8d6ea910d0', "aria-hidden": "true", name: "chevronright" })))));
227
239
  }
228
240
  static get watchers() { return {
229
241
  "translationAmount": ["onTranslateAmountChanges"]
@@ -1,7 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { g as getFocusableChildren } from './get-focusable-children.js';
3
+ import { b as breakpoint } from './breakpoints.js';
3
4
 
4
- const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;border-top:1px solid #e1e0dc;width:100%;top:100%;left:0;border-radius:0}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown-container{border-block-end:1px solid CanvasText}}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{z-index:4;top:0 !important;left:0;width:100%;position:fixed;height:calc(100dvh - var(--header-height));max-height:calc(100dvh - var(--header-height));border-top:unset;overflow:auto}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{display:flex;flex-direction:column;width:inherit;padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;display:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:16px 12px 14px 8px}.megadropdown post-list .list-title h3:not(:has(a)){position:relative}.megadropdown post-list .list-title h3:not(:has(a))::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:2px;position:absolute;left:0}.megadropdown post-list .list-title h3 a{border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown post-list .list-title h3 a.selected,.megadropdown post-list .list-title h3 a[aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown post-list .list-title h3 a:hover{background-color:#504f4b;color:#fff}.megadropdown post-list .list-title h3 a:hover::before{background-color:#504f4b}.megadropdown post-list .list-title h3 a::before{height:2px}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:14px 12px 12px 8px}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{order:-1;display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
5
+ const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;width:100%;top:100%;left:0;border-radius:0}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown-container{border-block-end:1px solid CanvasText}}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{z-index:4;top:0 !important;left:0;width:100%;position:fixed;height:calc(100dvh - var(--header-height));max-height:calc(100dvh - var(--header-height));border-top:unset;overflow:auto}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{display:flex;flex-direction:column;width:inherit;padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;display:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:16px 12px 14px 8px}.megadropdown post-list .list-title h3:not(:has(a)){position:relative}.megadropdown post-list .list-title h3:not(:has(a))::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:2px;position:absolute;left:0}.megadropdown post-list .list-title h3 a{border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown post-list .list-title h3 a.selected,.megadropdown post-list .list-title h3 a[aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown post-list .list-title h3 a:hover{background-color:#504f4b;color:#fff}.megadropdown post-list .list-title h3 a:hover::before{background-color:#504f4b}.megadropdown post-list .list-title h3 a::before{height:2px}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:14px 12px 12px 8px}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px;white-space:normal;word-break:break-word}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{order:-1;display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
5
6
  const PostMegadropdownStyle0 = postMegadropdownCss;
6
7
 
7
8
  const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdown extends HTMLElement {
@@ -9,16 +10,21 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
9
10
  super();
10
11
  this.__registerHost();
11
12
  this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown", 7);
12
- this.device = undefined;
13
+ this.device = breakpoint.get('name');
13
14
  this.isVisible = false;
14
15
  this.animationClass = null;
15
16
  }
16
- header;
17
17
  firstFocusableEl;
18
18
  lastFocusableEl;
19
19
  get host() { return this; }
20
20
  /** Tracks the currently active dropdown instance. */
21
21
  static activeDropdown = null;
22
+ breakpointChange(e) {
23
+ this.device = e.detail;
24
+ if (this.device === 'desktop' && this.isVisible) {
25
+ this.animationClass = null;
26
+ }
27
+ }
22
28
  /**
23
29
  * Emits when the dropdown is shown or hidden.
24
30
  * The event payload is an object.
@@ -28,6 +34,7 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
28
34
  postToggleMegadropdown;
29
35
  disconnectedCallback() {
30
36
  this.removeListeners();
37
+ window.removeEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
31
38
  if (PostMegadropdown.activeDropdown === this) {
32
39
  PostMegadropdown.activeDropdown = null;
33
40
  }
@@ -73,16 +80,14 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
73
80
  this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
74
81
  this.animationClass = 'slide-out';
75
82
  }
83
+ /**
84
+ * Sets focus to the first focusable element within the component.
85
+ */
76
86
  async focusFirst() {
77
87
  this.firstFocusableEl?.focus();
78
88
  }
79
89
  connectedCallback() {
80
- this.header = this.host.closest('post-header');
81
- if (this.header) {
82
- this.header.addEventListener('postUpdateDevice', (event) => {
83
- this.device = event.detail;
84
- });
85
- }
90
+ window.addEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
86
91
  }
87
92
  /**
88
93
  * Forces the dropdown to close without animation.
@@ -157,7 +162,7 @@ const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdo
157
162
  }
158
163
  render() {
159
164
  const containerStyle = this.isVisible ? {} : { display: 'none' };
160
- return (h(Host, { key: '1475e9ff941f5333d5cfe4f00157f8b2fc826b5e' }, h("div", { key: 'f3da1ec8abc7d00be7020821be69ea3af16f3ad2', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'f02279d454c7413080ce52711fe0cb923950d066', class: "megadropdown" }, h("slot", { key: '87da859d1a8408c3a49ea1ab050ea5f27de45ec2', name: "megadropdown-title" }), h("div", { key: 'c389959cf97c2ea69dd7b3f6945071e0c1793458', class: "megadropdown-content" }, h("slot", { key: '1a1241624a5b5421de0e4a3a54ddba3eb1e0834f' })), h("div", { key: 'f8fad723719e1505730f679dfff6428f3a5f1340', onClick: () => this.hide(true), class: "back-button" }, h("slot", { key: '6ca62ac352810b6d3642ee69433de4aac4089117', name: "back-button" })), h("div", { key: '16200fc7dee7d5535399e0450e39a816f04dffd6', onClick: () => this.hide(true), class: "close-button" }, h("slot", { key: 'e9478713c07f69011f397af3e3ffa6a3b8b7fb6a', name: "close-button" }))))));
165
+ return (h(Host, { key: '56fa590bb7f9f96a235ac867e5fa813d3af85e0e' }, h("div", { key: 'b2c7b68296103caa71a2a50f5637b7ffb6c07439', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'adb9e8e0017c030c7b2d296c50ac6f7a0807c0cd', class: "megadropdown" }, h("slot", { key: '081e04f3a23c1f1578d1a57e3c4485627b3370bf', name: "megadropdown-title" }), h("div", { key: 'ce46885e7c2992cbee84ed4712cac476c37d764a', class: "megadropdown-content" }, h("slot", { key: '57aa14b27969ab85d078ea42b440fc689d602ffa' })), h("div", { key: 'bfbd760c4f8ef244adf9f51517df22065e0b6cf7', onClick: () => this.hide(true), class: "back-button" }, h("slot", { key: '5cab958bc29dca98b1eeac97b844d26324f045bf', name: "back-button" })), h("div", { key: '8a959443f689a9bb318bedd2089493d291529250', onClick: () => this.hide(true), class: "close-button" }, h("slot", { key: '212685a6a63c5af4eccec78a80d6a8c3d7a2bbe9', name: "close-button" }))))));
161
166
  }
162
167
  static get style() { return PostMegadropdownStyle0; }
163
168
  }, [4, "post-megadropdown", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "9.0.0-next.21",
3
+ "version": "9.0.0-next.23",
4
4
  "description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.cjs.js",
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "@floating-ui/dom": "1.6.13",
28
28
  "@oddbird/popover-polyfill": "0.3.7",
29
- "@swisspost/design-system-icons": "9.0.0-next.21",
30
- "@swisspost/design-system-styles": "9.0.0-next.21",
29
+ "@swisspost/design-system-icons": "9.0.0-next.23",
30
+ "@swisspost/design-system-styles": "9.0.0-next.23",
31
31
  "ally.js": "1.4.1",
32
32
  "long-press-event": "2.5.0",
33
33
  "nanoid": "5.0.9"