@swisspost/design-system-components 9.0.1 → 10.0.0-next.38

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 (568) hide show
  1. package/dist/.config/bindings.angular.js +4 -0
  2. package/dist/cjs/breakpoints-cdf1b747.js +59 -0
  3. package/dist/cjs/check-non-empty-bd99d236.js +15 -0
  4. package/dist/cjs/check-one-of-75d270b5.js +13 -0
  5. package/dist/cjs/check-type-cdbf6d29.js +21 -0
  6. package/dist/cjs/check-url-220a286c.js +19 -0
  7. package/dist/cjs/event-guard-efabc84f.js +47 -0
  8. package/dist/cjs/fade-72d5ef55.js +14 -0
  9. package/dist/cjs/get-root-8102fecd.js +17 -0
  10. package/dist/cjs/index-23e36ff7.js +37 -0
  11. package/dist/cjs/{index-e1f32cce.js → index-b60129c4.js} +35 -15
  12. package/dist/cjs/index.browser-4af21c17.js +16 -0
  13. package/dist/cjs/index.cjs.js +57 -28
  14. package/dist/cjs/loader.cjs.js +2 -2
  15. package/dist/cjs/long-press-event-6e62d113.js +266 -0
  16. package/dist/cjs/{package-93f142ae.js → package-3e61e6f3.js} +1 -1
  17. package/dist/cjs/{post-accordion-60af96cf.js → post-accordion-e54524be.js} +11 -12
  18. package/dist/cjs/post-accordion-item-86f11a16.js +64 -0
  19. package/dist/cjs/post-accordion-item.cjs.entry.js +10 -6
  20. package/dist/cjs/post-accordion.cjs.entry.js +6 -4
  21. package/dist/cjs/post-avatar-22bfd12e.js +145 -0
  22. package/dist/cjs/post-avatar.cjs.entry.js +14 -0
  23. package/dist/cjs/post-back-to-top-f682ea05.js +96 -0
  24. package/dist/cjs/post-back-to-top.cjs.entry.js +16 -0
  25. package/dist/cjs/post-banner-5c749a94.js +92 -0
  26. package/dist/cjs/post-banner.cjs.entry.js +20 -0
  27. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +18 -0
  28. package/dist/cjs/post-breadcrumbs-76f55ae5.js +120 -0
  29. package/dist/cjs/post-breadcrumbs.cjs.entry.js +13 -0
  30. package/dist/cjs/post-card-control-161a7102.js +269 -0
  31. package/dist/cjs/post-card-control.cjs.entry.js +6 -5
  32. package/dist/cjs/post-closebutton_15.cjs.entry.js +36 -0
  33. package/dist/cjs/{post-collapsible-trigger-3de8fe4e.js → post-collapsible-trigger-6cdf4481.js} +62 -76
  34. package/dist/cjs/post-collapsible_2.cjs.entry.js +11 -7
  35. package/dist/cjs/post-components.cjs.js +2 -2
  36. package/dist/cjs/post-footer-15d78645.js +38 -0
  37. package/dist/cjs/post-footer.cjs.entry.js +12 -0
  38. package/dist/cjs/post-linkarea-095d1928.js +30 -0
  39. package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
  40. package/dist/cjs/post-menu-item-387e079b.js +68 -0
  41. package/dist/cjs/post-popover-388c8091.js +135 -0
  42. package/dist/cjs/post-popover.cjs.entry.js +4 -3
  43. package/dist/cjs/{post-rating-21f9c46d.js → post-rating-246e4d89.js} +4 -4
  44. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  45. package/dist/cjs/post-tab-header-0e9d0e06.js +34 -0
  46. package/dist/cjs/post-tab-header.cjs.entry.js +6 -4
  47. package/dist/cjs/{post-tab-panel-dd58f425.js → post-tab-panel-f952714f.js} +5 -4
  48. package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
  49. package/dist/cjs/{post-tabs-83191b9a.js → post-tabs-97c30d81.js} +14 -16
  50. package/dist/cjs/post-tabs.cjs.entry.js +5 -4
  51. package/dist/cjs/post-tag-58003cf0.js +47 -0
  52. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  53. package/dist/cjs/post-togglebutton-87c984d8.js +4494 -0
  54. package/dist/cjs/{post-tooltip-782f020b.js → post-tooltip-28e7711a.js} +10 -6
  55. package/dist/cjs/{post-tooltip-trigger-b2aeb636.js → post-tooltip-trigger-cbc53d14.js} +17 -280
  56. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +5 -4
  57. package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
  58. package/dist/cjs/slide-cd1f09b3.js +28 -0
  59. package/dist/collection/animations/collapse.js +8 -6
  60. package/dist/collection/animations/fade.js +6 -2
  61. package/dist/collection/animations/slide.js +23 -0
  62. package/dist/collection/collection-manifest.json +22 -3
  63. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  64. package/dist/collection/components/post-accordion/post-accordion.js +8 -10
  65. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  66. package/dist/collection/components/post-accordion-item/post-accordion-item.js +30 -16
  67. package/dist/collection/components/post-avatar/post-avatar.css +1 -0
  68. package/dist/collection/components/post-avatar/post-avatar.js +233 -0
  69. package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
  70. package/dist/collection/components/post-back-to-top/post-back-to-top.js +127 -0
  71. package/dist/collection/components/post-banner/banner-types.js +1 -0
  72. package/dist/collection/components/post-banner/post-banner.css +1 -0
  73. package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +44 -72
  74. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
  75. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +96 -0
  76. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -0
  77. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +160 -0
  78. package/dist/collection/components/post-card-control/post-card-control.css +1 -31
  79. package/dist/collection/components/post-card-control/post-card-control.js +20 -24
  80. package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
  81. package/dist/collection/components/post-closebutton/post-closebutton.js +23 -0
  82. package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
  83. package/dist/collection/components/post-collapsible/post-collapsible.js +6 -3
  84. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +43 -45
  85. package/dist/collection/components/post-footer/post-footer.css +1 -0
  86. package/dist/collection/components/post-footer/post-footer.js +75 -0
  87. package/dist/collection/components/post-header/post-header.css +1 -0
  88. package/dist/collection/components/post-header/post-header.js +320 -0
  89. package/dist/collection/components/post-icon/post-icon.js +58 -55
  90. package/dist/collection/components/post-language-option/post-language-option.css +1 -0
  91. package/dist/collection/components/post-language-option/post-language-option.js +237 -0
  92. package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
  93. package/dist/collection/components/post-language-switch/post-language-switch.js +186 -0
  94. package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
  95. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
  96. package/dist/collection/components/post-linkarea/post-linkarea.js +30 -0
  97. package/dist/collection/components/post-list/post-list.css +1 -0
  98. package/dist/collection/components/post-list/post-list.js +88 -0
  99. package/dist/collection/components/post-list-item/post-list-item.css +1 -0
  100. package/dist/collection/components/post-list-item/post-list-item.js +26 -0
  101. package/dist/collection/components/post-logo/post-logo.css +1 -1
  102. package/dist/collection/components/post-logo/post-logo.js +2 -2
  103. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
  104. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +184 -0
  105. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
  106. package/dist/collection/components/post-megadropdown/post-megadropdown.js +275 -0
  107. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
  108. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +133 -0
  109. package/dist/collection/components/post-menu/post-menu.css +1 -0
  110. package/dist/collection/components/post-menu/post-menu.js +294 -0
  111. package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
  112. package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
  113. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +120 -0
  114. package/dist/collection/components/post-popover/post-popover.css +1 -31
  115. package/dist/collection/components/post-popover/post-popover.js +16 -13
  116. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -31
  117. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +39 -6
  118. package/dist/collection/components/post-rating/post-rating.css +1 -31
  119. package/dist/collection/components/post-rating/post-rating.js +1 -1
  120. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -31
  121. package/dist/collection/components/post-tab-header/post-tab-header.js +6 -5
  122. package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -3
  123. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  124. package/dist/collection/components/post-tabs/post-tabs.js +7 -15
  125. package/dist/collection/components/post-tag/post-tag.css +1 -31
  126. package/dist/collection/components/post-tag/post-tag.js +2 -2
  127. package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
  128. package/dist/collection/components/post-togglebutton/post-togglebutton.js +74 -0
  129. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  130. package/dist/collection/components/post-tooltip/post-tooltip.js +6 -3
  131. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +14 -14
  132. package/dist/collection/index.js +21 -2
  133. package/dist/collection/utils/attribute-observer.js +6 -5
  134. package/dist/collection/utils/breakpoints.js +52 -0
  135. package/dist/collection/utils/component-on-ready.js +4 -4
  136. package/dist/collection/utils/debounce.js +2 -1
  137. package/dist/collection/utils/environment.js +2 -0
  138. package/dist/collection/utils/event-guard.js +43 -0
  139. package/dist/collection/utils/get-focusable-children.js +33 -0
  140. package/dist/collection/utils/get-root.js +6 -1
  141. package/dist/collection/utils/index.js +5 -0
  142. package/dist/collection/utils/is-motion-reduced.js +2 -1
  143. package/dist/collection/utils/property-checkers/check-non-empty.js +6 -2
  144. package/dist/collection/utils/property-checkers/check-one-of.js +8 -3
  145. package/dist/collection/utils/property-checkers/check-pattern.js +8 -3
  146. package/dist/collection/utils/property-checkers/check-type.js +11 -6
  147. package/dist/collection/utils/property-checkers/check-url.js +11 -6
  148. package/dist/collection/utils/property-checkers/empty-or.js +5 -2
  149. package/dist/collection/utils/sass-export.js +8 -5
  150. package/dist/components/breakpoints.js +56 -0
  151. package/dist/components/check-non-empty.js +6 -2
  152. package/dist/components/check-one-of.js +8 -3
  153. package/dist/components/check-type.js +11 -6
  154. package/dist/components/event-guard.js +45 -0
  155. package/dist/components/fade.js +6 -2
  156. package/dist/components/get-focusable-children.js +35 -0
  157. package/dist/components/get-root.js +15 -0
  158. package/dist/components/index.browser.js +14 -0
  159. package/dist/components/index.js +21 -2
  160. package/dist/components/index2.js +25 -12
  161. package/dist/components/long-press-event.js +264 -0
  162. package/dist/components/package.js +1 -1
  163. package/dist/components/post-accordion-item2.js +37 -18
  164. package/dist/components/post-accordion2.js +8 -9
  165. package/dist/components/post-avatar.d.ts +11 -0
  166. package/dist/components/post-avatar.js +6 -0
  167. package/dist/components/post-avatar2.js +170 -0
  168. package/dist/components/post-back-to-top.d.ts +11 -0
  169. package/dist/components/post-back-to-top.js +6 -0
  170. package/dist/components/post-back-to-top2.js +121 -0
  171. package/dist/components/post-banner.d.ts +11 -0
  172. package/dist/components/post-banner.js +6 -0
  173. package/dist/components/post-banner2.js +127 -0
  174. package/dist/components/post-breadcrumb-item.d.ts +11 -0
  175. package/dist/components/post-breadcrumb-item.js +6 -0
  176. package/dist/components/post-breadcrumb-item2.js +82 -0
  177. package/dist/components/post-breadcrumbs.d.ts +11 -0
  178. package/dist/components/post-breadcrumbs.js +6 -0
  179. package/dist/components/post-breadcrumbs2.js +177 -0
  180. package/dist/components/post-card-control2.js +16 -19
  181. package/dist/components/post-closebutton.d.ts +11 -0
  182. package/dist/components/post-closebutton.js +6 -0
  183. package/dist/components/post-closebutton2.js +39 -0
  184. package/dist/components/post-collapsible-trigger2.js +47 -64
  185. package/dist/components/post-collapsible2.js +17 -12
  186. package/dist/components/post-footer.d.ts +11 -0
  187. package/dist/components/post-footer.js +6 -0
  188. package/dist/components/post-footer2.js +78 -0
  189. package/dist/components/post-header.d.ts +11 -0
  190. package/dist/components/post-header.js +6 -0
  191. package/dist/components/post-header2.js +399 -0
  192. package/dist/components/post-icon2.js +59 -55
  193. package/dist/components/post-language-option.d.ts +11 -0
  194. package/dist/components/post-language-option.js +6 -0
  195. package/dist/components/post-language-option2.js +103 -0
  196. package/dist/components/post-language-switch.d.ts +11 -0
  197. package/dist/components/post-language-switch.js +6 -0
  198. package/dist/components/post-language-switch2.js +145 -0
  199. package/dist/components/post-linkarea.d.ts +11 -0
  200. package/dist/components/post-linkarea.js +6 -0
  201. package/dist/components/post-linkarea2.js +43 -0
  202. package/dist/components/post-list-item.d.ts +11 -0
  203. package/dist/components/post-list-item.js +6 -0
  204. package/dist/components/post-list-item2.js +36 -0
  205. package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
  206. package/dist/components/post-list.js +6 -0
  207. package/dist/components/post-list2.js +54 -0
  208. package/dist/components/post-logo2.js +4 -3
  209. package/dist/components/post-mainnavigation.d.ts +11 -0
  210. package/dist/components/post-mainnavigation.js +6 -0
  211. package/dist/components/post-mainnavigation2.js +183 -0
  212. package/dist/components/post-megadropdown-trigger.d.ts +11 -0
  213. package/dist/components/post-megadropdown-trigger.js +6 -0
  214. package/dist/components/post-megadropdown-trigger2.js +121 -0
  215. package/dist/components/post-megadropdown.d.ts +11 -0
  216. package/dist/components/post-megadropdown.js +6 -0
  217. package/dist/components/post-megadropdown2.js +190 -0
  218. package/dist/components/post-menu-item.d.ts +11 -0
  219. package/dist/components/post-menu-item.js +6 -0
  220. package/dist/components/post-menu-item2.js +27 -0
  221. package/dist/components/post-menu-trigger.d.ts +11 -0
  222. package/dist/components/post-menu-trigger.js +6 -0
  223. package/dist/components/post-menu-trigger2.js +109 -0
  224. package/dist/components/post-menu.d.ts +11 -0
  225. package/dist/components/post-menu.js +6 -0
  226. package/dist/components/post-menu2.js +192 -0
  227. package/dist/components/post-popover2.js +20 -16
  228. package/dist/components/post-popovercontainer2.js +788 -73
  229. package/dist/components/post-rating2.js +2 -2
  230. package/dist/components/post-tab-header2.js +8 -6
  231. package/dist/components/post-tab-panel2.js +4 -3
  232. package/dist/components/post-tabs2.js +11 -13
  233. package/dist/components/post-tag2.js +2 -2
  234. package/dist/components/post-togglebutton.d.ts +11 -0
  235. package/dist/components/post-togglebutton.js +6 -0
  236. package/dist/components/post-togglebutton2.js +62 -0
  237. package/dist/components/post-tooltip-trigger2.js +14 -277
  238. package/dist/components/post-tooltip2.js +7 -3
  239. package/dist/components/slide.js +25 -0
  240. package/dist/docs.json +1977 -287
  241. package/dist/esm/breakpoints-7812702e.js +56 -0
  242. package/dist/esm/check-non-empty-258a56b3.js +13 -0
  243. package/dist/esm/check-one-of-0bee20f5.js +11 -0
  244. package/dist/esm/check-type-37d5d307.js +19 -0
  245. package/dist/esm/check-url-17962bc8.js +17 -0
  246. package/dist/esm/event-guard-538ee077.js +45 -0
  247. package/dist/esm/fade-1f3cacf4.js +11 -0
  248. package/dist/esm/get-root-1b1af46f.js +15 -0
  249. package/dist/esm/index-8f8fe5b0.js +32 -0
  250. package/dist/esm/{index-e1b64755.js → index-f4d19816.js} +35 -15
  251. package/dist/esm/index.browser-ff103197.js +14 -0
  252. package/dist/esm/index.js +33 -23
  253. package/dist/esm/loader.js +3 -3
  254. package/dist/esm/long-press-event-04d24397.js +264 -0
  255. package/dist/esm/package-33ac2576.js +3 -0
  256. package/dist/esm/{post-accordion-bcfe7e61.js → post-accordion-03796d13.js} +11 -12
  257. package/dist/esm/post-accordion-item-d29c49e5.js +62 -0
  258. package/dist/esm/post-accordion-item.entry.js +10 -6
  259. package/dist/esm/post-accordion.entry.js +6 -4
  260. package/dist/esm/post-avatar-639dc17a.js +143 -0
  261. package/dist/esm/post-avatar.entry.js +6 -0
  262. package/dist/esm/post-back-to-top-8099279e.js +94 -0
  263. package/dist/esm/post-back-to-top.entry.js +8 -0
  264. package/dist/esm/post-banner-54834fbf.js +90 -0
  265. package/dist/esm/post-banner.entry.js +12 -0
  266. package/dist/esm/post-breadcrumb-item_2.entry.js +9 -0
  267. package/dist/esm/post-breadcrumbs-caf56014.js +118 -0
  268. package/dist/esm/post-breadcrumbs.entry.js +5 -0
  269. package/dist/esm/post-card-control-b063586b.js +267 -0
  270. package/dist/esm/post-card-control.entry.js +6 -5
  271. package/dist/esm/post-closebutton_15.entry.js +14 -0
  272. package/dist/esm/{post-collapsible-trigger-3168178e.js → post-collapsible-trigger-727bcde1.js} +62 -76
  273. package/dist/esm/post-collapsible_2.entry.js +11 -7
  274. package/dist/esm/post-components.js +3 -3
  275. package/dist/esm/post-footer-16f1a8de.js +36 -0
  276. package/dist/esm/post-footer.entry.js +4 -0
  277. package/dist/esm/post-linkarea-4e4228fb.js +28 -0
  278. package/dist/esm/post-linkarea.entry.js +3 -0
  279. package/dist/esm/post-menu-item-e9dd8173.js +65 -0
  280. package/dist/esm/post-popover-46ede6b5.js +133 -0
  281. package/dist/esm/post-popover.entry.js +4 -3
  282. package/dist/esm/{post-rating-0fd5de37.js → post-rating-8d0d970b.js} +4 -4
  283. package/dist/esm/post-rating.entry.js +3 -3
  284. package/dist/esm/post-tab-header-8224c7c2.js +32 -0
  285. package/dist/esm/post-tab-header.entry.js +6 -4
  286. package/dist/esm/{post-tab-panel-6b1219e0.js → post-tab-panel-dfdeccd3.js} +5 -4
  287. package/dist/esm/post-tab-panel.entry.js +4 -3
  288. package/dist/esm/{post-tabs-b8ff3c5d.js → post-tabs-fabd0569.js} +14 -16
  289. package/dist/esm/post-tabs.entry.js +5 -4
  290. package/dist/esm/post-tag-13994238.js +45 -0
  291. package/dist/esm/post-tag.entry.js +3 -3
  292. package/dist/esm/post-togglebutton-87967c5b.js +4478 -0
  293. package/dist/esm/{post-tooltip-aa745743.js → post-tooltip-eecaa4c7.js} +10 -6
  294. package/dist/esm/{post-tooltip-trigger-ce0b4106.js → post-tooltip-trigger-642cbb22.js} +17 -280
  295. package/dist/esm/post-tooltip-trigger.entry.js +5 -4
  296. package/dist/esm/post-tooltip.entry.js +5 -4
  297. package/dist/esm/slide-cd2850ee.js +25 -0
  298. package/dist/post-components/index.esm.js +1 -1
  299. package/dist/post-components/p-0539071d.js +1 -0
  300. package/dist/post-components/p-0889c759.js +1 -0
  301. package/dist/post-components/p-0dcd25ab.js +1 -0
  302. package/dist/post-components/p-181c73d5.js +1 -0
  303. package/dist/post-components/p-19317b15.js +8 -0
  304. package/dist/post-components/p-1ef9415b.js +1 -0
  305. package/dist/post-components/p-24d0695f.entry.js +1 -0
  306. package/dist/post-components/p-2e50a07d.entry.js +1 -0
  307. package/dist/post-components/p-30eb4d87.js +1 -0
  308. package/dist/post-components/p-46008c18.entry.js +1 -0
  309. package/dist/post-components/p-47ab2c2b.entry.js +1 -0
  310. package/dist/post-components/p-4c049de0.entry.js +1 -0
  311. package/dist/post-components/p-4c4acc32.entry.js +1 -0
  312. package/dist/post-components/p-5d473fcd.js +1 -0
  313. package/dist/post-components/p-5d539b30.js +1 -0
  314. package/dist/post-components/p-64e3de38.js +1 -0
  315. package/dist/post-components/p-6783e509.entry.js +1 -0
  316. package/dist/post-components/p-692ba59d.js +1 -0
  317. package/dist/post-components/p-6933fb57.entry.js +1 -0
  318. package/dist/post-components/p-6b31a76a.js +1 -0
  319. package/dist/post-components/p-72197a6b.js +1 -0
  320. package/dist/post-components/p-722ffaae.js +1 -0
  321. package/dist/post-components/p-7709c14a.js +1 -0
  322. package/dist/post-components/p-77910344.entry.js +1 -0
  323. package/dist/post-components/p-80e5100e.entry.js +1 -0
  324. package/dist/post-components/p-84fbf49c.js +1 -0
  325. package/dist/post-components/p-85fdc2d3.js +1 -0
  326. package/dist/post-components/p-8c09291c.js +1 -0
  327. package/dist/post-components/p-8db32dab.js +8 -0
  328. package/dist/post-components/p-93da1a5f.js +1 -0
  329. package/dist/post-components/p-9b052461.js +1 -0
  330. package/dist/post-components/p-9b8ee310.entry.js +1 -0
  331. package/dist/post-components/{p-3eab790d.js → p-9e461613.js} +2 -2
  332. package/dist/post-components/p-9efb84d3.entry.js +1 -0
  333. package/dist/post-components/p-9fbf2f82.entry.js +1 -0
  334. package/dist/post-components/p-a07f85ee.js +1 -0
  335. package/dist/post-components/p-a25019de.js +1 -0
  336. package/dist/post-components/p-a710ee00.js +1 -0
  337. package/dist/post-components/p-b94e5b4d.entry.js +1 -0
  338. package/dist/post-components/p-c2348d3d.js +1 -0
  339. package/dist/post-components/p-c65f32b0.js +1 -0
  340. package/dist/post-components/p-c6b03446.entry.js +1 -0
  341. package/dist/post-components/p-d0dfd5f9.js +1 -0
  342. package/dist/post-components/p-d45df336.js +1 -0
  343. package/dist/post-components/p-d4890d50.entry.js +1 -0
  344. package/dist/post-components/p-d5210531.entry.js +1 -0
  345. package/dist/post-components/p-dd39c542.entry.js +1 -0
  346. package/dist/post-components/p-df6c8a4c.js +1 -0
  347. package/dist/post-components/p-e068a41e.js +1 -0
  348. package/dist/post-components/p-e585c6fe.js +1 -0
  349. package/dist/post-components/p-f2c4a48d.js +1 -0
  350. package/dist/post-components/p-f31b9b5d.entry.js +1 -0
  351. package/dist/post-components/p-f58252d5.entry.js +1 -0
  352. package/dist/post-components/p-fda767f0.js +1 -0
  353. package/dist/post-components/post-components.esm.js +1 -1
  354. package/dist/types/animations/collapse.d.ts +2 -2
  355. package/dist/types/animations/fade.d.ts +2 -2
  356. package/dist/types/animations/slide.d.ts +2 -0
  357. package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
  358. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +8 -2
  359. package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
  360. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +21 -0
  361. package/dist/types/components/post-banner/banner-types.d.ts +2 -0
  362. package/dist/types/components/post-banner/post-banner.d.ts +49 -0
  363. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +20 -0
  364. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +30 -0
  365. package/dist/types/components/post-card-control/post-card-control.d.ts +9 -9
  366. package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
  367. package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +9 -14
  368. package/dist/types/components/post-footer/post-footer.d.ts +23 -0
  369. package/dist/types/components/post-header/post-header.d.ts +52 -0
  370. package/dist/types/components/post-icon/post-icon.d.ts +10 -6
  371. package/dist/types/components/post-language-option/post-language-option.d.ts +49 -0
  372. package/dist/types/components/post-language-switch/post-language-switch.d.ts +39 -0
  373. package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
  374. package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
  375. package/dist/types/components/post-list/post-list.d.ts +24 -0
  376. package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
  377. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +46 -0
  378. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +59 -0
  379. package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +33 -0
  380. package/dist/types/components/post-menu/post-menu.d.ts +49 -0
  381. package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
  382. package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +28 -0
  383. package/dist/types/components/post-popover/post-popover.d.ts +6 -4
  384. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +9 -1
  385. package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
  386. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  387. package/dist/types/components/post-tag/post-tag.d.ts +2 -2
  388. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
  389. package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -0
  390. package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +0 -1
  391. package/dist/types/components.d.ts +603 -50
  392. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
  393. package/dist/types/index.d.ts +22 -3
  394. package/dist/types/popover-fn.d.ts +11 -0
  395. package/dist/types/utils/attribute-observer.d.ts +1 -1
  396. package/dist/types/utils/breakpoints.d.ts +12 -0
  397. package/dist/types/utils/component-on-ready.d.ts +1 -1
  398. package/dist/types/utils/environment.d.ts +2 -0
  399. package/dist/types/utils/event-guard.d.ts +4 -0
  400. package/dist/types/utils/get-focusable-children.d.ts +1 -0
  401. package/dist/types/utils/get-root.d.ts +5 -1
  402. package/dist/types/utils/index.d.ts +5 -0
  403. package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
  404. package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
  405. package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
  406. package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
  407. package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
  408. package/dist/types/utils/property-checkers/index.d.ts +12 -4
  409. package/dist/types/utils/sass-export.d.ts +5 -1
  410. package/loaders/breakpoints.js +56 -0
  411. package/loaders/check-non-empty.js +6 -2
  412. package/loaders/check-one-of.js +8 -3
  413. package/loaders/check-type.js +11 -6
  414. package/loaders/event-guard.js +45 -0
  415. package/loaders/fade.js +6 -2
  416. package/loaders/get-focusable-children.js +35 -0
  417. package/loaders/get-root.js +15 -0
  418. package/loaders/index.browser.js +14 -0
  419. package/loaders/index.d.ts +40 -2
  420. package/loaders/index.js +22 -2
  421. package/loaders/index2.js +25 -12
  422. package/loaders/long-press-event.js +264 -0
  423. package/loaders/package.js +1 -1
  424. package/loaders/post-accordion-item.js +1 -82
  425. package/loaders/post-accordion-item2.js +103 -0
  426. package/loaders/post-accordion.js +8 -9
  427. package/loaders/post-avatar.d.ts +11 -0
  428. package/loaders/post-avatar.js +173 -0
  429. package/loaders/post-back-to-top.d.ts +11 -0
  430. package/loaders/post-back-to-top.js +124 -0
  431. package/loaders/post-banner.d.ts +11 -0
  432. package/loaders/post-banner.js +130 -0
  433. package/loaders/post-breadcrumb-item.d.ts +11 -0
  434. package/loaders/post-breadcrumb-item.js +6 -0
  435. package/loaders/post-breadcrumb-item2.js +82 -0
  436. package/loaders/post-breadcrumbs.d.ts +11 -0
  437. package/loaders/post-breadcrumbs.js +180 -0
  438. package/loaders/post-card-control.js +16 -19
  439. package/loaders/post-closebutton.d.ts +11 -0
  440. package/loaders/post-closebutton.js +42 -0
  441. package/loaders/post-collapsible-trigger2.js +47 -64
  442. package/loaders/post-collapsible2.js +16 -11
  443. package/loaders/post-footer.d.ts +11 -0
  444. package/loaders/post-footer.js +81 -0
  445. package/loaders/post-header.d.ts +11 -0
  446. package/loaders/post-header.js +402 -0
  447. package/loaders/post-icon2.js +59 -55
  448. package/loaders/post-language-option.d.ts +11 -0
  449. package/loaders/post-language-option.js +106 -0
  450. package/loaders/post-language-switch.d.ts +11 -0
  451. package/loaders/post-language-switch.js +148 -0
  452. package/loaders/post-linkarea.d.ts +11 -0
  453. package/loaders/post-linkarea.js +46 -0
  454. package/loaders/post-list-item.d.ts +11 -0
  455. package/loaders/post-list-item.js +39 -0
  456. package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
  457. package/loaders/post-list.js +57 -0
  458. package/loaders/post-logo.js +5 -4
  459. package/loaders/post-mainnavigation.d.ts +11 -0
  460. package/loaders/post-mainnavigation.js +186 -0
  461. package/loaders/post-megadropdown-trigger.d.ts +11 -0
  462. package/loaders/post-megadropdown-trigger.js +124 -0
  463. package/loaders/post-megadropdown.d.ts +11 -0
  464. package/loaders/post-megadropdown.js +193 -0
  465. package/loaders/post-menu-item.d.ts +11 -0
  466. package/loaders/post-menu-item.js +6 -0
  467. package/loaders/post-menu-item2.js +27 -0
  468. package/loaders/post-menu-trigger.d.ts +11 -0
  469. package/loaders/post-menu-trigger.js +6 -0
  470. package/loaders/post-menu-trigger2.js +109 -0
  471. package/loaders/post-menu.d.ts +11 -0
  472. package/loaders/post-menu.js +6 -0
  473. package/loaders/post-menu2.js +192 -0
  474. package/loaders/post-popover.js +20 -16
  475. package/loaders/post-popovercontainer2.js +788 -73
  476. package/loaders/post-rating.js +2 -2
  477. package/loaders/post-tab-header.js +8 -6
  478. package/loaders/post-tab-panel.js +4 -3
  479. package/loaders/post-tabs.js +11 -13
  480. package/loaders/post-tag.js +2 -2
  481. package/loaders/post-togglebutton.d.ts +11 -0
  482. package/loaders/post-togglebutton.js +65 -0
  483. package/loaders/post-tooltip-trigger.js +14 -277
  484. package/loaders/post-tooltip.js +7 -3
  485. package/loaders/slide.js +25 -0
  486. package/package.json +45 -33
  487. package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
  488. package/dist/cjs/check-one-of-f4f5d0c0.js +0 -8
  489. package/dist/cjs/check-type-64af82a9.js +0 -16
  490. package/dist/cjs/fade-35a3633a.js +0 -10
  491. package/dist/cjs/index-824d2b71.js +0 -39
  492. package/dist/cjs/post-accordion-item-744c881d.js +0 -52
  493. package/dist/cjs/post-alert-2a768f58.js +0 -99
  494. package/dist/cjs/post-alert.cjs.entry.js +0 -17
  495. package/dist/cjs/post-card-control-197c8e44.js +0 -272
  496. package/dist/cjs/post-icon-df629079.js +0 -139
  497. package/dist/cjs/post-icon.cjs.entry.js +0 -16
  498. package/dist/cjs/post-logo-7caeb918.js +0 -39
  499. package/dist/cjs/post-logo.cjs.entry.js +0 -15
  500. package/dist/cjs/post-popover-090c3d01.js +0 -131
  501. package/dist/cjs/post-popovercontainer-872681bf.js +0 -2281
  502. package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
  503. package/dist/cjs/post-tab-header-422d0f03.js +0 -32
  504. package/dist/cjs/post-tag-c72183f2.js +0 -47
  505. package/dist/collection/components/post-alert/alert-types.js +0 -1
  506. package/dist/collection/components/post-alert/post-alert.css +0 -35
  507. package/dist/components/post-alert.js +0 -6
  508. package/dist/components/post-alert2.js +0 -136
  509. package/dist/esm/check-non-empty-58bd6b17.js +0 -9
  510. package/dist/esm/check-one-of-6b3ef8eb.js +0 -6
  511. package/dist/esm/check-type-8828dbe4.js +0 -14
  512. package/dist/esm/fade-7fd71785.js +0 -7
  513. package/dist/esm/index-69587a51.js +0 -34
  514. package/dist/esm/package-45827c3b.js +0 -3
  515. package/dist/esm/post-accordion-item-8869c90b.js +0 -50
  516. package/dist/esm/post-alert-21fd0068.js +0 -97
  517. package/dist/esm/post-alert.entry.js +0 -9
  518. package/dist/esm/post-card-control-60c132dc.js +0 -270
  519. package/dist/esm/post-icon-2e2e18ad.js +0 -137
  520. package/dist/esm/post-icon.entry.js +0 -8
  521. package/dist/esm/post-logo-f364eb72.js +0 -37
  522. package/dist/esm/post-logo.entry.js +0 -7
  523. package/dist/esm/post-popover-697201cd.js +0 -129
  524. package/dist/esm/post-popovercontainer-2b5f37fb.js +0 -2279
  525. package/dist/esm/post-popovercontainer.entry.js +0 -3
  526. package/dist/esm/post-tab-header-c8898fa2.js +0 -30
  527. package/dist/esm/post-tag-83470f28.js +0 -45
  528. package/dist/post-components/p-08dc45bb.entry.js +0 -1
  529. package/dist/post-components/p-1a48d1b0.js +0 -1
  530. package/dist/post-components/p-2737eaf5.js +0 -1
  531. package/dist/post-components/p-2b61a526.entry.js +0 -1
  532. package/dist/post-components/p-3f5bf5d9.entry.js +0 -1
  533. package/dist/post-components/p-40e5bb56.entry.js +0 -1
  534. package/dist/post-components/p-4a3f67ab.js +0 -1
  535. package/dist/post-components/p-56ca6bb5.js +0 -1
  536. package/dist/post-components/p-58cbb854.entry.js +0 -1
  537. package/dist/post-components/p-5c557e64.js +0 -1
  538. package/dist/post-components/p-5ce2abc9.entry.js +0 -1
  539. package/dist/post-components/p-5f08d625.js +0 -15
  540. package/dist/post-components/p-611b3c41.js +0 -1
  541. package/dist/post-components/p-7069ac74.entry.js +0 -1
  542. package/dist/post-components/p-755b2746.js +0 -1
  543. package/dist/post-components/p-788e64fb.js +0 -1
  544. package/dist/post-components/p-799cf60e.js +0 -1
  545. package/dist/post-components/p-7bbcc8ee.js +0 -1
  546. package/dist/post-components/p-7cdf9571.entry.js +0 -1
  547. package/dist/post-components/p-7e4181ce.entry.js +0 -1
  548. package/dist/post-components/p-9409f729.js +0 -1
  549. package/dist/post-components/p-a07846ea.js +0 -1
  550. package/dist/post-components/p-a4560368.js +0 -1
  551. package/dist/post-components/p-a503cb2c.entry.js +0 -1
  552. package/dist/post-components/p-b095519d.js +0 -1
  553. package/dist/post-components/p-b46e2451.js +0 -1
  554. package/dist/post-components/p-b7207224.js +0 -1
  555. package/dist/post-components/p-bafc0491.js +0 -1
  556. package/dist/post-components/p-c078fd94.entry.js +0 -1
  557. package/dist/post-components/p-c0aebe5e.entry.js +0 -1
  558. package/dist/post-components/p-c7e4acde.js +0 -1
  559. package/dist/post-components/p-ca71a3ff.entry.js +0 -1
  560. package/dist/post-components/p-d582cc10.js +0 -1
  561. package/dist/post-components/p-e49f57c0.entry.js +0 -1
  562. package/dist/post-components/p-eb712f9b.entry.js +0 -1
  563. package/dist/post-components/p-eebd060d.js +0 -1
  564. package/dist/post-components/p-f7cead60.entry.js +0 -1
  565. package/dist/post-components/p-ffd75503.js +0 -1
  566. package/dist/types/components/post-alert/alert-types.d.ts +0 -2
  567. package/dist/types/components/post-alert/post-alert.d.ts +0 -54
  568. package/loaders/post-alert.js +0 -139
@@ -1,18 +1,37 @@
1
1
  // Export every single component so it gets included in the dist output
2
2
  export { PostAccordion } from './components/post-accordion/post-accordion';
3
3
  export { PostAccordionItem } from './components/post-accordion-item/post-accordion-item';
4
- export { PostAlert } from './components/post-alert/post-alert';
4
+ export { PostAvatar } from './components/post-avatar/post-avatar';
5
+ export { PostBackToTop } from './components/post-back-to-top/post-back-to-top';
6
+ export { PostBanner } from './components/post-banner/post-banner';
7
+ export { PostBreadcrumbs } from './components/post-breadcrumbs/post-breadcrumbs';
8
+ export { PostBreadcrumbItem } from './components/post-breadcrumb-item/post-breadcrumb-item';
5
9
  export { PostCardControl } from './components/post-card-control/post-card-control';
10
+ export { PostClosebutton } from './components/post-closebutton/post-closebutton';
6
11
  export { PostCollapsible } from './components/post-collapsible/post-collapsible';
7
12
  export { PostCollapsibleTrigger } from './components/post-collapsible-trigger/post-collapsible-trigger';
13
+ export { PostFooter } from './components/post-footer/post-footer';
14
+ export { PostHeader } from './components/post-header/post-header';
8
15
  export { PostIcon } from './components/post-icon/post-icon';
16
+ export { PostLanguageOption } from './components/post-language-option/post-language-option';
17
+ export { PostLanguageSwitch } from './components/post-language-switch/post-language-switch';
18
+ export { PostLinkarea } from './components/post-linkarea/post-linkarea';
19
+ export { PostList } from './components/post-list/post-list';
20
+ export { PostListItem } from './components/post-list-item/post-list-item';
9
21
  export { PostLogo } from './components/post-logo/post-logo';
22
+ export { PostMainnavigation } from './components/post-mainnavigation/post-mainnavigation';
23
+ export { PostMegadropdown } from './components/post-megadropdown/post-megadropdown';
24
+ export { PostMegadropdownTrigger } from './components/post-megadropdown-trigger/post-megadropdown-trigger';
25
+ export { PostMenu } from './components/post-menu/post-menu';
26
+ export { PostMenuItem } from './components/post-menu-item/post-menu-item';
27
+ export { PostMenuTrigger } from './components/post-menu-trigger/post-menu-trigger';
10
28
  export { PostPopover } from './components/post-popover/post-popover';
11
29
  export { PostPopovercontainer } from './components/post-popovercontainer/post-popovercontainer';
12
30
  export { PostRating } from './components/post-rating/post-rating';
13
31
  export { PostTabs } from './components/post-tabs/post-tabs';
14
32
  export { PostTabHeader } from './components/post-tab-header/post-tab-header';
15
33
  export { PostTabPanel } from './components/post-tab-panel/post-tab-panel';
34
+ export { PostTag } from './components/post-tag/post-tag';
35
+ export { PostTogglebutton } from './components/post-togglebutton/post-togglebutton';
16
36
  export { PostTooltip } from './components/post-tooltip/post-tooltip';
17
37
  export { PostTooltipTrigger } from './components/post-tooltip-trigger/post-tooltip-trigger';
18
- export { PostTag } from './components/post-tag/post-tag';
@@ -1,9 +1,10 @@
1
- export const getAttributeObserver = (attribute, handler) => {
1
+ import { IS_BROWSER } from "./environment";
2
+ export function getAttributeObserver(attribute, handler) {
2
3
  /**
3
4
  * Handle attribute changes and childList changes from the observer
4
5
  * @param {MutationRecord[]} mutationList
5
6
  */
6
- const observerHandler = (mutationList) => {
7
+ function observerHandler(mutationList) {
7
8
  mutationList.forEach(mutation => {
8
9
  if (mutation.type === 'attributes' && mutation.attributeName === attribute) {
9
10
  handler(mutation.target);
@@ -17,7 +18,7 @@ export const getAttributeObserver = (attribute, handler) => {
17
18
  });
18
19
  }
19
20
  });
20
- };
21
+ }
21
22
  // Initialize a mutation observer for patching accessibility features
22
- return new MutationObserver(observerHandler);
23
- };
23
+ return IS_BROWSER ? new MutationObserver(observerHandler) : null;
24
+ }
@@ -0,0 +1,52 @@
1
+ import { IS_BROWSER } from "./environment";
2
+ export class Breakpoint {
3
+ constructor() {
4
+ this.current = {
5
+ key: '',
6
+ name: '',
7
+ };
8
+ if (IS_BROWSER && !this.breakpointMap) {
9
+ const keys = this.getStyles('--post-breakpoint-keys');
10
+ const names = this.getStyles('--post-breakpoint-names');
11
+ const widths = this.getStyles('--post-breakpoint-widths');
12
+ this.breakpointMap = widths
13
+ .map((width, i) => ({
14
+ minWidth: Number(width),
15
+ key: keys[i],
16
+ name: names[i],
17
+ }))
18
+ .reverse();
19
+ window.addEventListener('resize', () => this.updateHandler(), { passive: true });
20
+ }
21
+ }
22
+ getStyles(propertyName) {
23
+ const styles = getComputedStyle(document.documentElement);
24
+ return (styles
25
+ .getPropertyValue(propertyName)
26
+ ?.split(',')
27
+ .map(w => w.trim()) ?? []);
28
+ }
29
+ updateHandler(emitEvents = true) {
30
+ const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
31
+ if (this.current.key !== calculated.key) {
32
+ this.current.key = calculated.key;
33
+ if (emitEvents)
34
+ this.dispatchEvent('key');
35
+ }
36
+ if (this.current.name !== calculated.name) {
37
+ this.current.name = calculated.name;
38
+ if (emitEvents)
39
+ this.dispatchEvent('name');
40
+ }
41
+ }
42
+ dispatchEvent(type) {
43
+ if (IS_BROWSER) {
44
+ window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
45
+ }
46
+ }
47
+ get(type) {
48
+ this.updateHandler(false);
49
+ return this.current[type];
50
+ }
51
+ }
52
+ export const breakpoint = new Breakpoint();
@@ -2,7 +2,7 @@
2
2
  * Invoke the `componentOnReady` method if it is available, simulate it otherwise
3
3
  * @see https://stenciljs.com/docs/api#componentonready
4
4
  */
5
- export const componentOnReady = (el) => {
5
+ export function componentOnReady(el) {
6
6
  if (typeof el.componentOnReady === 'function') {
7
7
  return el.componentOnReady();
8
8
  }
@@ -11,10 +11,10 @@ export const componentOnReady = (el) => {
11
11
  resolve(el);
12
12
  }));
13
13
  }
14
- };
15
- const customOnReady = (callback) => {
14
+ }
15
+ function customOnReady(callback) {
16
16
  if (typeof requestAnimationFrame === 'function') {
17
17
  return requestAnimationFrame(callback);
18
18
  }
19
19
  return setTimeout(callback);
20
- };
20
+ }
@@ -1,8 +1,9 @@
1
1
  export function debounce(callback, timeout = 200) {
2
2
  let id;
3
3
  return (...args) => {
4
- if (id)
4
+ if (id) {
5
5
  clearTimeout(id);
6
+ }
6
7
  id = setTimeout(callback, timeout, ...args);
7
8
  };
8
9
  }
@@ -0,0 +1,2 @@
1
+ export const IS_SERVER = typeof window === 'undefined';
2
+ export const IS_BROWSER = !IS_SERVER;
@@ -0,0 +1,43 @@
1
+ export function eventGuard(host, event, options, callback) {
2
+ const target = event.target;
3
+ if (!target)
4
+ return;
5
+ if (target.localName === options.targetLocalName) {
6
+ if (!options.delegatorSelector || shadowClosest(target, options.delegatorSelector) === host) {
7
+ callback();
8
+ }
9
+ }
10
+ }
11
+ /**
12
+ * Traverses up the DOM (including crossing shadow DOM boundaries) starting from the given element
13
+ * to find and return the closest ancestor that matches the specified CSS selector.
14
+ * If no matching element is found, returns null.
15
+ *
16
+ * @param element - The starting element from which the search begins.
17
+ * @param selector - The CSS selector used to test each ancestor element.
18
+ * @returns The closest matching ancestor element or null if none is found.
19
+ */
20
+ function shadowClosest(element, selector) {
21
+ let currentElement = element;
22
+ while (currentElement) {
23
+ if (currentElement.matches(selector)) {
24
+ return currentElement;
25
+ }
26
+ const parent = currentElement.parentElement;
27
+ if (parent) {
28
+ currentElement = parent;
29
+ }
30
+ else {
31
+ const parentNode = currentElement.parentNode;
32
+ // When no parentElement exists, check if the current element is inside a shadow DOM.
33
+ // If so, move up to the shadow host to continue the search outside the shadow boundary.
34
+ if (parentNode instanceof ShadowRoot) {
35
+ currentElement = parentNode.host;
36
+ }
37
+ else {
38
+ currentElement = null;
39
+ }
40
+ }
41
+ }
42
+ return null;
43
+ }
@@ -0,0 +1,33 @@
1
+ const focusableSelector = `:where(${[
2
+ 'button',
3
+ 'input:not([type="hidden"])',
4
+ '[tabindex]',
5
+ 'select',
6
+ 'textarea',
7
+ '[contenteditable]',
8
+ 'a[href]',
9
+ 'iframe',
10
+ 'audio[controls]',
11
+ 'video[controls]',
12
+ 'area[href]',
13
+ 'details > summary:first-of-type',
14
+ ].join(',')})`;
15
+ const focusDisablingSelector = `:where(${[
16
+ '[inert]',
17
+ '[inert] *',
18
+ ':disabled',
19
+ 'dialog:not([open]) *',
20
+ '[popover]:not(:popover-open) *',
21
+ 'details:not([open]) > *:not(details > summary:first-of-type)',
22
+ 'details:not([open]) > *:not(details > summary:first-of-type) *',
23
+ '[tabindex^="-"]',
24
+ '[hidden]:not([hidden="false"])',
25
+ ].join(',')})`;
26
+ export function getFocusableChildren(element) {
27
+ const focusableChildren = element.querySelectorAll(`${focusableSelector}:not(${focusDisablingSelector})`);
28
+ const visibleFocusableChildren = Array.from(focusableChildren).filter(child => {
29
+ const style = window.getComputedStyle(child.parentElement);
30
+ return style.display !== 'none' && style.visibility !== 'hidden';
31
+ });
32
+ return visibleFocusableChildren;
33
+ }
@@ -1,5 +1,10 @@
1
+ import { IS_BROWSER } from "./environment";
2
+ /**
3
+ * getRootNode() can only be used after the element has been attached to the document!
4
+ * So use it for example in the componentDidLoad lifecycle hook.
5
+ */
1
6
  export function getRoot(element) {
2
- const root = element.getRootNode();
7
+ const root = IS_BROWSER ? element.getRootNode() : element;
3
8
  if (root instanceof Document || root instanceof ShadowRoot) {
4
9
  return root;
5
10
  }
@@ -1,7 +1,12 @@
1
+ export * from './get-focusable-children';
2
+ export * from './attribute-observer';
1
3
  export * from './component-on-ready';
2
4
  export * from './property-checkers';
5
+ export * from './breakpoints';
3
6
  export * from './debounce';
7
+ export * from './event-guard';
4
8
  export * from './get-root';
5
9
  export * from './is-motion-reduced';
6
10
  export * from './sass-export';
7
11
  export * from './timeout';
12
+ export * from './environment';
@@ -1,3 +1,4 @@
1
+ import { IS_BROWSER } from "./environment";
1
2
  export function isMotionReduced() {
2
- return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
3
+ return IS_BROWSER ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : false;
3
4
  }
@@ -1,6 +1,10 @@
1
1
  import { EMPTY_VALUES } from "./constants";
2
- export function checkNonEmpty(value, error) {
2
+ export function checkNonEmpty(component, prop, customMessage) {
3
+ const componentName = component.host.localName;
4
+ const value = component[prop];
5
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
6
+ const message = customMessage || defaultMessage;
3
7
  if (EMPTY_VALUES.some(v => v === value)) {
4
- throw new Error(error);
8
+ throw new Error(message);
5
9
  }
6
10
  }
@@ -1,4 +1,9 @@
1
- export function checkOneOf(value, possibleValues, error) {
2
- if (!possibleValues.includes(value))
3
- throw new Error(error);
1
+ export function checkOneOf(component, prop, possibleValues, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
4
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
5
+ const message = customMessage || defaultMessage;
6
+ if (!possibleValues.includes(value)) {
7
+ throw new Error(message);
8
+ }
4
9
  }
@@ -1,4 +1,9 @@
1
- export function checkPattern(value, pattern, errorMessage) {
2
- if (typeof value !== 'string' || !pattern.test(value))
3
- throw new Error(errorMessage);
1
+ export function checkPattern(component, prop, pattern, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
4
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be follow the format \`${pattern}\`.`;
5
+ const message = customMessage || defaultMessage;
6
+ if (typeof value !== 'string' || !pattern.test(value)) {
7
+ throw new Error(message);
8
+ }
4
9
  }
@@ -1,12 +1,17 @@
1
- export function checkType(value, type, error) {
1
+ export function checkType(component, prop, type, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
2
4
  const typeIsArray = type === 'array';
3
5
  const valueIsArray = Array.isArray(value);
6
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
7
+ ${type}\`.`;
8
+ const message = customMessage || defaultMessage;
4
9
  if (typeIsArray || valueIsArray) {
5
- if (valueIsArray !== typeIsArray)
6
- throw new Error(error);
10
+ if (valueIsArray !== typeIsArray) {
11
+ throw new Error(message);
12
+ }
7
13
  }
8
- else {
9
- if (typeof value !== type)
10
- throw new Error(error);
14
+ else if (typeof value !== type) {
15
+ throw new Error(message);
11
16
  }
12
17
  }
@@ -1,10 +1,15 @@
1
- export function checkUrl(value, error) {
2
- if (typeof value !== 'string' && !(value instanceof URL))
3
- throw new Error(error);
1
+ export function checkUrl(component, prop, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
4
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is invalid.`;
5
+ const message = customMessage || defaultMessage;
6
+ if (typeof value !== 'string' && !(value instanceof URL)) {
7
+ throw new Error(message);
8
+ }
4
9
  try {
5
- new URL(value);
10
+ new URL(value, 'https://www.post.ch');
6
11
  }
7
- catch (e) {
8
- throw new Error(error);
12
+ catch {
13
+ throw new Error(message);
9
14
  }
10
15
  }
@@ -1,8 +1,11 @@
1
1
  import { EMPTY_VALUES } from "./constants";
2
2
  export function emptyOr(check) {
3
3
  return (...args) => {
4
- const value = args[0];
5
- if (!EMPTY_VALUES.some(v => v === value))
4
+ const component = args[0];
5
+ const prop = args[1];
6
+ const value = component[prop];
7
+ if (!EMPTY_VALUES.some(v => v === value)) {
6
8
  check(...args);
9
+ }
7
10
  };
8
11
  }
@@ -2,11 +2,14 @@ export function parse(scss) {
2
2
  return Object.entries(scss).reduce((object, [path, value]) => {
3
3
  let output = object;
4
4
  path.split('_').forEach((key, i, values) => {
5
- const pathKey = key;
6
- const normalized = /^\[.*\]$/.test(value) ? JSON.parse(value) : value;
7
- const pathValue = i >= values.length - 1 ? normalized : output[pathKey] || {};
8
- output[pathKey] = pathValue;
9
- output = output[pathKey];
5
+ const normalized = /^\[.*\]$/.test(value)
6
+ ? JSON.parse(value)
7
+ : value;
8
+ const pathValue = i >= values.length - 1 ? normalized : output[key] || {};
9
+ output[key] = pathValue;
10
+ if (i < values.length) {
11
+ output = output[key];
12
+ }
10
13
  });
11
14
  return object;
12
15
  }, {});
@@ -0,0 +1,56 @@
1
+ const IS_SERVER = typeof window === 'undefined';
2
+ const IS_BROWSER = !IS_SERVER;
3
+
4
+ class Breakpoint {
5
+ constructor() {
6
+ this.current = {
7
+ key: '',
8
+ name: '',
9
+ };
10
+ if (IS_BROWSER && !this.breakpointMap) {
11
+ const keys = this.getStyles('--post-breakpoint-keys');
12
+ const names = this.getStyles('--post-breakpoint-names');
13
+ const widths = this.getStyles('--post-breakpoint-widths');
14
+ this.breakpointMap = widths
15
+ .map((width, i) => ({
16
+ minWidth: Number(width),
17
+ key: keys[i],
18
+ name: names[i],
19
+ }))
20
+ .reverse();
21
+ window.addEventListener('resize', () => this.updateHandler(), { passive: true });
22
+ }
23
+ }
24
+ getStyles(propertyName) {
25
+ const styles = getComputedStyle(document.documentElement);
26
+ return (styles
27
+ .getPropertyValue(propertyName)
28
+ ?.split(',')
29
+ .map(w => w.trim()) ?? []);
30
+ }
31
+ updateHandler(emitEvents = true) {
32
+ const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
33
+ if (this.current.key !== calculated.key) {
34
+ this.current.key = calculated.key;
35
+ if (emitEvents)
36
+ this.dispatchEvent('key');
37
+ }
38
+ if (this.current.name !== calculated.name) {
39
+ this.current.name = calculated.name;
40
+ if (emitEvents)
41
+ this.dispatchEvent('name');
42
+ }
43
+ }
44
+ dispatchEvent(type) {
45
+ if (IS_BROWSER) {
46
+ window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
47
+ }
48
+ }
49
+ get(type) {
50
+ this.updateHandler(false);
51
+ return this.current[type];
52
+ }
53
+ }
54
+ const breakpoint = new Breakpoint();
55
+
56
+ export { IS_BROWSER as I, breakpoint as b };
@@ -1,8 +1,12 @@
1
1
  import { E as EMPTY_VALUES } from './constants.js';
2
2
 
3
- function checkNonEmpty(value, error) {
3
+ function checkNonEmpty(component, prop, customMessage) {
4
+ const componentName = component.host.localName;
5
+ const value = component[prop];
6
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component is required.`;
7
+ const message = customMessage || defaultMessage;
4
8
  if (EMPTY_VALUES.some(v => v === value)) {
5
- throw new Error(error);
9
+ throw new Error(message);
6
10
  }
7
11
  }
8
12
 
@@ -1,6 +1,11 @@
1
- function checkOneOf(value, possibleValues, error) {
2
- if (!possibleValues.includes(value))
3
- throw new Error(error);
1
+ function checkOneOf(component, prop, possibleValues, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
4
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be one of the following values: ${possibleValues.join(', ')}.`;
5
+ const message = customMessage || defaultMessage;
6
+ if (!possibleValues.includes(value)) {
7
+ throw new Error(message);
8
+ }
4
9
  }
5
10
 
6
11
  export { checkOneOf as c };
@@ -1,13 +1,18 @@
1
- function checkType(value, type, error) {
1
+ function checkType(component, prop, type, customMessage) {
2
+ const componentName = component.host.localName;
3
+ const value = component[prop];
2
4
  const typeIsArray = type === 'array';
3
5
  const valueIsArray = Array.isArray(value);
6
+ const defaultMessage = `The prop \`${String(prop)}\` of the \`${componentName}\` component must be of type \`
7
+ ${type}\`.`;
8
+ const message = customMessage || defaultMessage;
4
9
  if (typeIsArray || valueIsArray) {
5
- if (valueIsArray !== typeIsArray)
6
- throw new Error(error);
10
+ if (valueIsArray !== typeIsArray) {
11
+ throw new Error(message);
12
+ }
7
13
  }
8
- else {
9
- if (typeof value !== type)
10
- throw new Error(error);
14
+ else if (typeof value !== type) {
15
+ throw new Error(message);
11
16
  }
12
17
  }
13
18
 
@@ -0,0 +1,45 @@
1
+ function eventGuard(host, event, options, callback) {
2
+ const target = event.target;
3
+ if (!target)
4
+ return;
5
+ if (target.localName === options.targetLocalName) {
6
+ if (!options.delegatorSelector || shadowClosest(target, options.delegatorSelector) === host) {
7
+ callback();
8
+ }
9
+ }
10
+ }
11
+ /**
12
+ * Traverses up the DOM (including crossing shadow DOM boundaries) starting from the given element
13
+ * to find and return the closest ancestor that matches the specified CSS selector.
14
+ * If no matching element is found, returns null.
15
+ *
16
+ * @param element - The starting element from which the search begins.
17
+ * @param selector - The CSS selector used to test each ancestor element.
18
+ * @returns The closest matching ancestor element or null if none is found.
19
+ */
20
+ function shadowClosest(element, selector) {
21
+ let currentElement = element;
22
+ while (currentElement) {
23
+ if (currentElement.matches(selector)) {
24
+ return currentElement;
25
+ }
26
+ const parent = currentElement.parentElement;
27
+ if (parent) {
28
+ currentElement = parent;
29
+ }
30
+ else {
31
+ const parentNode = currentElement.parentNode;
32
+ // When no parentElement exists, check if the current element is inside a shadow DOM.
33
+ // If so, move up to the shadow host to continue the search outside the shadow boundary.
34
+ if (parentNode instanceof ShadowRoot) {
35
+ currentElement = parentNode.host;
36
+ }
37
+ else {
38
+ currentElement = null;
39
+ }
40
+ }
41
+ }
42
+ return null;
43
+ }
44
+
45
+ export { eventGuard as e };
@@ -1,7 +1,11 @@
1
1
  const fadeDuration = 200;
2
2
  const fadedOutKeyframe = { opacity: '0' };
3
3
  const fadedInKeyframe = { opacity: '1' };
4
- const fadeIn = (el) => el.animate([fadedOutKeyframe, fadedInKeyframe], { duration: fadeDuration });
5
- const fadeOut = (el) => el.animate([fadedInKeyframe, fadedOutKeyframe], { duration: fadeDuration });
4
+ function fadeIn(el) {
5
+ return el.animate([fadedOutKeyframe, fadedInKeyframe], { duration: fadeDuration });
6
+ }
7
+ function fadeOut(el) {
8
+ return el.animate([fadedInKeyframe, fadedOutKeyframe], { duration: fadeDuration });
9
+ }
6
10
 
7
11
  export { fadeIn as a, fadeOut as f };
@@ -0,0 +1,35 @@
1
+ const focusableSelector = `:where(${[
2
+ 'button',
3
+ 'input:not([type="hidden"])',
4
+ '[tabindex]',
5
+ 'select',
6
+ 'textarea',
7
+ '[contenteditable]',
8
+ 'a[href]',
9
+ 'iframe',
10
+ 'audio[controls]',
11
+ 'video[controls]',
12
+ 'area[href]',
13
+ 'details > summary:first-of-type',
14
+ ].join(',')})`;
15
+ const focusDisablingSelector = `:where(${[
16
+ '[inert]',
17
+ '[inert] *',
18
+ ':disabled',
19
+ 'dialog:not([open]) *',
20
+ '[popover]:not(:popover-open) *',
21
+ 'details:not([open]) > *:not(details > summary:first-of-type)',
22
+ 'details:not([open]) > *:not(details > summary:first-of-type) *',
23
+ '[tabindex^="-"]',
24
+ '[hidden]:not([hidden="false"])',
25
+ ].join(',')})`;
26
+ function getFocusableChildren(element) {
27
+ const focusableChildren = element.querySelectorAll(`${focusableSelector}:not(${focusDisablingSelector})`);
28
+ const visibleFocusableChildren = Array.from(focusableChildren).filter(child => {
29
+ const style = window.getComputedStyle(child.parentElement);
30
+ return style.display !== 'none' && style.visibility !== 'hidden';
31
+ });
32
+ return visibleFocusableChildren;
33
+ }
34
+
35
+ export { getFocusableChildren as g };
@@ -0,0 +1,15 @@
1
+ import { I as IS_BROWSER } from './breakpoints.js';
2
+
3
+ /**
4
+ * getRootNode() can only be used after the element has been attached to the document!
5
+ * So use it for example in the componentDidLoad lifecycle hook.
6
+ */
7
+ function getRoot(element) {
8
+ const root = IS_BROWSER ? element.getRootNode() : element;
9
+ if (root instanceof Document || root instanceof ShadowRoot) {
10
+ return root;
11
+ }
12
+ throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
13
+ }
14
+
15
+ export { getRoot as g };
@@ -0,0 +1,14 @@
1
+ const urlAlphabet =
2
+ 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
3
+
4
+ /* @ts-self-types="./index.d.ts" */
5
+ let nanoid = (size = 21) => {
6
+ let id = '';
7
+ let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
8
+ while (size--) {
9
+ id += urlAlphabet[bytes[size] & 63];
10
+ }
11
+ return id
12
+ };
13
+
14
+ export { nanoid as n };