@swisspost/design-system-components 9.0.0-next.9 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/dist/cjs/{index-5d4e0aed.js → index-824d2b71.js} +12 -2
  2. package/dist/cjs/{index-010dc207.js → index-e1f32cce.js} +17 -30
  3. package/dist/cjs/index.cjs.js +26 -50
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{package-8e810a59.js → package-3ed88bb9.js} +1 -1
  6. package/dist/cjs/{post-accordion-b9df8522.js → post-accordion-9ef382e8.js} +3 -3
  7. package/dist/cjs/post-accordion-item-5f685bee.js +52 -0
  8. package/dist/cjs/post-accordion-item.cjs.entry.js +4 -5
  9. package/dist/cjs/post-accordion.cjs.entry.js +3 -3
  10. package/dist/cjs/post-alert-88adc668.js +99 -0
  11. package/dist/cjs/{post-banner.cjs.entry.js → post-alert.cjs.entry.js} +5 -6
  12. package/dist/cjs/post-card-control-c6e5c427.js +272 -0
  13. package/dist/cjs/post-card-control.cjs.entry.js +3 -3
  14. package/dist/cjs/{post-collapsible-trigger-143cf84a.js → post-collapsible-trigger-1764e6dc.js} +24 -11
  15. package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -7
  16. package/dist/cjs/post-components.cjs.js +2 -2
  17. package/dist/cjs/post-icon-f735da00.js +139 -0
  18. package/dist/cjs/post-icon.cjs.entry.js +16 -0
  19. package/dist/cjs/post-logo-2cd8ae98.js +39 -0
  20. package/dist/cjs/post-logo.cjs.entry.js +15 -0
  21. package/dist/cjs/post-popover-36c854a4.js +131 -0
  22. package/dist/cjs/post-popover.cjs.entry.js +3 -4
  23. package/dist/cjs/{post-togglebutton-0984a694.js → post-popovercontainer-cb4793c1.js} +148 -1106
  24. package/dist/cjs/post-popovercontainer.cjs.entry.js +11 -0
  25. package/dist/cjs/post-rating-d5073d8d.js +88 -0
  26. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  27. package/dist/cjs/post-tab-header-b756d9b1.js +32 -0
  28. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  29. package/dist/cjs/{post-tab-panel-60f211a5.js → post-tab-panel-97b79ecd.js} +3 -3
  30. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  31. package/dist/cjs/{post-tabs-1f797ce4.js → post-tabs-834497f2.js} +5 -5
  32. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  33. package/dist/cjs/post-tag-c70fb945.js +47 -0
  34. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  35. package/dist/cjs/post-tooltip-20ebe011.js +69 -0
  36. package/dist/cjs/{post-tooltip-38c839a4.js → post-tooltip-trigger-6f4c9748.js} +507 -557
  37. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +12 -0
  38. package/dist/cjs/post-tooltip.cjs.entry.js +3 -8
  39. package/dist/collection/collection-manifest.json +4 -21
  40. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  41. package/dist/collection/components/post-accordion/post-accordion.js +2 -2
  42. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  43. package/dist/collection/components/post-accordion-item/post-accordion-item.js +10 -24
  44. package/dist/collection/components/post-alert/alert-types.js +1 -0
  45. package/dist/collection/components/post-alert/post-alert.css +35 -0
  46. package/dist/collection/components/{post-banner/post-banner.js → post-alert/post-alert.js} +68 -39
  47. package/dist/collection/components/post-card-control/post-card-control.css +30 -2
  48. package/dist/collection/components/post-card-control/post-card-control.js +8 -8
  49. package/dist/collection/components/post-collapsible/post-collapsible.js +2 -4
  50. package/dist/collection/components/post-icon/post-icon.css +1 -1
  51. package/dist/collection/components/post-icon/post-icon.js +52 -13
  52. package/dist/collection/components/post-logo/post-logo.js +1 -1
  53. package/dist/collection/components/post-popover/post-popover.css +30 -2
  54. package/dist/collection/components/post-popover/post-popover.js +10 -6
  55. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +31 -1
  56. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +180 -52
  57. package/dist/collection/components/post-rating/post-rating.css +29 -1
  58. package/dist/collection/components/post-rating/post-rating.js +1 -1
  59. package/dist/collection/components/post-tab-header/post-tab-header.css +29 -1
  60. package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
  61. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  62. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  63. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  64. package/dist/collection/components/post-tag/post-tag.css +29 -1
  65. package/dist/collection/components/post-tag/post-tag.js +2 -2
  66. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  67. package/dist/collection/components/post-tooltip/post-tooltip.js +60 -213
  68. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.css +1 -0
  69. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +230 -0
  70. package/dist/collection/index.js +3 -20
  71. package/dist/components/index.js +3 -20
  72. package/dist/components/index2.js +1 -1
  73. package/dist/components/package.js +1 -1
  74. package/dist/components/post-accordion-item2.js +12 -30
  75. package/dist/components/post-accordion2.js +1 -1
  76. package/dist/components/{post-list.d.ts → post-alert.d.ts} +4 -4
  77. package/dist/components/post-alert.js +6 -0
  78. package/dist/components/post-alert2.js +136 -0
  79. package/dist/components/post-card-control2.js +3 -3
  80. package/dist/components/post-collapsible-trigger2.js +17 -2
  81. package/dist/components/post-collapsible2.js +3 -5
  82. package/dist/components/post-icon2.js +54 -15
  83. package/dist/components/post-logo2.js +1 -1
  84. package/dist/components/post-popover2.js +35 -8
  85. package/dist/components/post-popovercontainer2.js +136 -41
  86. package/dist/components/post-rating2.js +2 -2
  87. package/dist/components/post-tab-header2.js +2 -2
  88. package/dist/components/post-tab-panel2.js +1 -1
  89. package/dist/components/post-tabs2.js +3 -3
  90. package/dist/components/post-tag2.js +2 -2
  91. package/dist/components/{post-breadcrumb-item.d.ts → post-tooltip-trigger.d.ts} +4 -4
  92. package/dist/components/post-tooltip-trigger.js +6 -0
  93. package/dist/components/post-tooltip-trigger2.js +4968 -0
  94. package/dist/components/post-tooltip2.js +32 -4962
  95. package/dist/docs.json +401 -1776
  96. package/dist/esm/{index-b49c9904.js → index-69587a51.js} +12 -2
  97. package/dist/esm/{index-fb8d6be7.js → index-e1b64755.js} +17 -30
  98. package/dist/esm/index.js +20 -27
  99. package/dist/esm/loader.js +3 -3
  100. package/dist/esm/package-983f957d.js +3 -0
  101. package/dist/esm/{post-accordion-ee54a3ef.js → post-accordion-ad570427.js} +3 -3
  102. package/dist/esm/post-accordion-item-4db0aa2a.js +50 -0
  103. package/dist/esm/post-accordion-item.entry.js +4 -5
  104. package/dist/esm/post-accordion.entry.js +3 -3
  105. package/dist/esm/post-alert-1e9fbdfa.js +97 -0
  106. package/dist/esm/post-alert.entry.js +9 -0
  107. package/dist/esm/post-card-control-ccb189a8.js +270 -0
  108. package/dist/esm/post-card-control.entry.js +3 -3
  109. package/dist/esm/{post-collapsible-trigger-1c7833f8.js → post-collapsible-trigger-45fe328a.js} +22 -9
  110. package/dist/esm/post-collapsible_2.entry.js +4 -7
  111. package/dist/esm/post-components.js +3 -3
  112. package/dist/esm/post-icon-3fc4dd7d.js +137 -0
  113. package/dist/esm/post-icon.entry.js +8 -0
  114. package/dist/esm/post-logo-e6cdea13.js +37 -0
  115. package/dist/esm/post-logo.entry.js +7 -0
  116. package/dist/esm/post-popover-afdf4906.js +129 -0
  117. package/dist/esm/post-popover.entry.js +3 -4
  118. package/dist/esm/{post-togglebutton-395bf3f0.js → post-popovercontainer-b19b7606.js} +149 -1093
  119. package/dist/esm/post-popovercontainer.entry.js +3 -0
  120. package/dist/esm/post-rating-f60024fa.js +86 -0
  121. package/dist/esm/post-rating.entry.js +3 -3
  122. package/dist/esm/post-tab-header-333e15d5.js +30 -0
  123. package/dist/esm/post-tab-header.entry.js +3 -3
  124. package/dist/esm/{post-tab-panel-cafd9e04.js → post-tab-panel-0ddb05a2.js} +3 -3
  125. package/dist/esm/post-tab-panel.entry.js +3 -3
  126. package/dist/esm/{post-tabs-beef8eae.js → post-tabs-ab7853cf.js} +5 -5
  127. package/dist/esm/post-tabs.entry.js +3 -3
  128. package/dist/esm/post-tag-4a7d14b9.js +45 -0
  129. package/dist/esm/post-tag.entry.js +3 -3
  130. package/dist/esm/post-tooltip-c03cd719.js +67 -0
  131. package/dist/esm/{post-tooltip-b298039a.js → post-tooltip-trigger-1fefc8ad.js} +507 -557
  132. package/dist/esm/post-tooltip-trigger.entry.js +4 -0
  133. package/dist/esm/post-tooltip.entry.js +3 -8
  134. package/dist/post-components/index.esm.js +1 -1
  135. package/dist/post-components/p-0a45da5e.entry.js +1 -0
  136. package/dist/post-components/p-12e82863.entry.js +1 -0
  137. package/dist/post-components/p-1386b77d.js +1 -0
  138. package/dist/post-components/p-1528b798.js +1 -0
  139. package/dist/post-components/p-18dc1299.entry.js +1 -0
  140. package/dist/post-components/p-1a8f6c84.entry.js +1 -0
  141. package/dist/post-components/p-256453ca.js +1 -0
  142. package/dist/post-components/p-3272ebad.js +1 -0
  143. package/dist/post-components/p-3596035e.js +1 -0
  144. package/dist/post-components/p-3668f4fa.entry.js +1 -0
  145. package/dist/post-components/p-375845d4.js +1 -0
  146. package/dist/post-components/p-381de59d.entry.js +1 -0
  147. package/dist/post-components/{p-c0ae9886.js → p-3eab790d.js} +1 -1
  148. package/dist/post-components/p-4e68c514.js +1 -0
  149. package/dist/post-components/p-4eb5d9a1.entry.js +1 -0
  150. package/dist/post-components/p-61a7d216.js +1 -0
  151. package/dist/post-components/p-788e64fb.js +1 -0
  152. package/dist/post-components/p-7d5b41d1.js +1 -0
  153. package/dist/post-components/p-82ea24e7.js +1 -0
  154. package/dist/post-components/p-85c4d04f.js +1 -0
  155. package/dist/post-components/p-85c6d001.entry.js +1 -0
  156. package/dist/post-components/p-8e555dda.js +15 -0
  157. package/dist/post-components/p-962a6f36.entry.js +1 -0
  158. package/dist/post-components/p-a76c71bc.js +1 -0
  159. package/dist/post-components/p-a7e8fd41.entry.js +1 -0
  160. package/dist/post-components/p-ac216bd0.entry.js +1 -0
  161. package/dist/post-components/p-b17ecbee.entry.js +1 -0
  162. package/dist/post-components/p-bb4227ad.entry.js +1 -0
  163. package/dist/post-components/p-bc294d0b.js +1 -0
  164. package/dist/post-components/p-d0b3c5d3.entry.js +1 -0
  165. package/dist/post-components/p-d4e148d8.entry.js +1 -0
  166. package/dist/post-components/p-d9809281.js +1 -0
  167. package/dist/post-components/p-eb1e7a49.js +1 -0
  168. package/dist/post-components/p-f35291d5.entry.js +1 -0
  169. package/dist/post-components/p-fc3bfe08.js +1 -0
  170. package/dist/post-components/post-components.esm.js +1 -1
  171. package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
  172. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +1 -7
  173. package/dist/types/components/post-alert/alert-types.d.ts +2 -0
  174. package/dist/types/components/post-alert/post-alert.d.ts +54 -0
  175. package/dist/types/components/post-card-control/post-card-control.d.ts +7 -7
  176. package/dist/types/components/post-icon/post-icon.d.ts +1 -1
  177. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +31 -13
  178. package/dist/types/components/post-tag/post-tag.d.ts +1 -1
  179. package/dist/types/components/post-tooltip/post-tooltip.d.ts +20 -34
  180. package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +47 -0
  181. package/dist/types/components.d.ts +124 -590
  182. package/dist/types/index.d.ts +3 -20
  183. package/loaders/index.d.ts +4 -38
  184. package/loaders/index.js +4 -21
  185. package/loaders/index2.js +1 -1
  186. package/loaders/package.js +1 -1
  187. package/loaders/post-accordion-item.js +82 -1
  188. package/loaders/post-accordion.js +1 -1
  189. package/loaders/{post-list.d.ts → post-alert.d.ts} +4 -4
  190. package/loaders/post-alert.js +139 -0
  191. package/loaders/post-card-control.js +3 -3
  192. package/loaders/post-collapsible-trigger2.js +17 -2
  193. package/loaders/post-collapsible2.js +3 -5
  194. package/loaders/post-icon2.js +54 -15
  195. package/loaders/post-logo.js +2 -2
  196. package/loaders/post-popover.js +35 -8
  197. package/loaders/post-popovercontainer2.js +136 -41
  198. package/loaders/post-rating.js +2 -2
  199. package/loaders/post-tab-header.js +2 -2
  200. package/loaders/post-tab-panel.js +1 -1
  201. package/loaders/post-tabs.js +3 -3
  202. package/loaders/post-tag.js +2 -2
  203. package/loaders/{post-avatar.d.ts → post-tooltip-trigger.d.ts} +4 -4
  204. package/loaders/post-tooltip-trigger.js +4971 -0
  205. package/loaders/post-tooltip.js +32 -4962
  206. package/package.json +6 -9
  207. package/dist/cjs/attribute-observer-10f08c04.js +0 -27
  208. package/dist/cjs/check-url-3ffdd2fb.js +0 -14
  209. package/dist/cjs/debounce-1151afe3.js +0 -12
  210. package/dist/cjs/get-root-7a3498ef.js +0 -11
  211. package/dist/cjs/post-accordion-item-ecc6749f.js +0 -63
  212. package/dist/cjs/post-avatar-f7236084.js +0 -148
  213. package/dist/cjs/post-avatar.cjs.entry.js +0 -13
  214. package/dist/cjs/post-back-to-top-60762f8e.js +0 -75
  215. package/dist/cjs/post-back-to-top.cjs.entry.js +0 -15
  216. package/dist/cjs/post-banner-9662f22c.js +0 -90
  217. package/dist/cjs/post-breadcrumb-b40732fc.js +0 -111
  218. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +0 -17
  219. package/dist/cjs/post-breadcrumb.cjs.entry.js +0 -13
  220. package/dist/cjs/post-card-control-039c9a4b.js +0 -272
  221. package/dist/cjs/post-closebutton_15.cjs.entry.js +0 -33
  222. package/dist/cjs/post-footer-5f7fdf96.js +0 -84
  223. package/dist/cjs/post-footer.cjs.entry.js +0 -11
  224. package/dist/cjs/post-menu-item-bb0b0b9e.js +0 -74
  225. package/dist/cjs/post-popover-d0ce9dc6.js +0 -104
  226. package/dist/cjs/post-rating-1082197c.js +0 -88
  227. package/dist/cjs/post-tab-header-4b6d8d54.js +0 -32
  228. package/dist/cjs/post-tag-ddaaaedc.js +0 -47
  229. package/dist/cjs/slide-5d51abe8.js +0 -28
  230. package/dist/collection/animations/slide.js +0 -23
  231. package/dist/collection/components/post-avatar/post-avatar.css +0 -3
  232. package/dist/collection/components/post-avatar/post-avatar.js +0 -237
  233. package/dist/collection/components/post-back-to-top/post-back-to-top.css +0 -1
  234. package/dist/collection/components/post-back-to-top/post-back-to-top.js +0 -107
  235. package/dist/collection/components/post-banner/banner-types.js +0 -1
  236. package/dist/collection/components/post-banner/post-banner.css +0 -3
  237. package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +0 -3
  238. package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +0 -161
  239. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +0 -1
  240. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -93
  241. package/dist/collection/components/post-closebutton/post-closebutton.js +0 -12
  242. package/dist/collection/components/post-footer/post-footer.css +0 -1
  243. package/dist/collection/components/post-footer/post-footer.js +0 -75
  244. package/dist/collection/components/post-header/post-header.css +0 -1
  245. package/dist/collection/components/post-header/post-header.js +0 -160
  246. package/dist/collection/components/post-language-option/post-language-option.css +0 -3
  247. package/dist/collection/components/post-language-option/post-language-option.js +0 -215
  248. package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
  249. package/dist/collection/components/post-language-switch/post-language-switch.js +0 -163
  250. package/dist/collection/components/post-language-switch/switch-variants.js +0 -1
  251. package/dist/collection/components/post-list/post-list.css +0 -3
  252. package/dist/collection/components/post-list/post-list.js +0 -87
  253. package/dist/collection/components/post-list-item/post-list-item.css +0 -1
  254. package/dist/collection/components/post-list-item/post-list-item.js +0 -25
  255. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +0 -1
  256. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +0 -52
  257. package/dist/collection/components/post-megadropdown/post-megadropdown.css +0 -1
  258. package/dist/collection/components/post-megadropdown/post-megadropdown.js +0 -151
  259. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +0 -1
  260. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +0 -104
  261. package/dist/collection/components/post-menu/post-menu.css +0 -3
  262. package/dist/collection/components/post-menu/post-menu.js +0 -280
  263. package/dist/collection/components/post-menu-item/post-menu-item.css +0 -1
  264. package/dist/collection/components/post-menu-item/post-menu-item.js +0 -20
  265. package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +0 -1
  266. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +0 -114
  267. package/dist/collection/components/post-togglebutton/post-togglebutton.css +0 -1
  268. package/dist/collection/components/post-togglebutton/post-togglebutton.js +0 -74
  269. package/dist/collection/utils/breakpoints.js +0 -46
  270. package/dist/collection/utils/is-focusable.js +0 -26
  271. package/dist/components/attribute-observer.js +0 -25
  272. package/dist/components/debounce.js +0 -10
  273. package/dist/components/get-root.js +0 -9
  274. package/dist/components/post-avatar.d.ts +0 -11
  275. package/dist/components/post-avatar.js +0 -6
  276. package/dist/components/post-avatar2.js +0 -173
  277. package/dist/components/post-back-to-top.d.ts +0 -11
  278. package/dist/components/post-back-to-top.js +0 -6
  279. package/dist/components/post-back-to-top2.js +0 -100
  280. package/dist/components/post-banner.d.ts +0 -11
  281. package/dist/components/post-banner.js +0 -6
  282. package/dist/components/post-banner2.js +0 -125
  283. package/dist/components/post-breadcrumb-item.js +0 -6
  284. package/dist/components/post-breadcrumb-item2.js +0 -82
  285. package/dist/components/post-breadcrumb.d.ts +0 -11
  286. package/dist/components/post-breadcrumb.js +0 -6
  287. package/dist/components/post-breadcrumb2.js +0 -168
  288. package/dist/components/post-closebutton.d.ts +0 -11
  289. package/dist/components/post-closebutton.js +0 -6
  290. package/dist/components/post-closebutton2.js +0 -34
  291. package/dist/components/post-footer.d.ts +0 -11
  292. package/dist/components/post-footer.js +0 -6
  293. package/dist/components/post-footer2.js +0 -124
  294. package/dist/components/post-header.d.ts +0 -11
  295. package/dist/components/post-header.js +0 -6
  296. package/dist/components/post-header2.js +0 -276
  297. package/dist/components/post-language-option.d.ts +0 -11
  298. package/dist/components/post-language-option.js +0 -6
  299. package/dist/components/post-language-option2.js +0 -94
  300. package/dist/components/post-language-switch.d.ts +0 -11
  301. package/dist/components/post-language-switch.js +0 -6
  302. package/dist/components/post-language-switch2.js +0 -146
  303. package/dist/components/post-list-item.d.ts +0 -11
  304. package/dist/components/post-list-item.js +0 -6
  305. package/dist/components/post-list-item2.js +0 -35
  306. package/dist/components/post-list.js +0 -6
  307. package/dist/components/post-list2.js +0 -53
  308. package/dist/components/post-mainnavigation.d.ts +0 -11
  309. package/dist/components/post-mainnavigation.js +0 -6
  310. package/dist/components/post-mainnavigation2.js +0 -48
  311. package/dist/components/post-megadropdown-trigger.d.ts +0 -11
  312. package/dist/components/post-megadropdown-trigger.js +0 -6
  313. package/dist/components/post-megadropdown-trigger2.js +0 -91
  314. package/dist/components/post-megadropdown.d.ts +0 -11
  315. package/dist/components/post-megadropdown.js +0 -6
  316. package/dist/components/post-megadropdown2.js +0 -93
  317. package/dist/components/post-menu-item.d.ts +0 -11
  318. package/dist/components/post-menu-item.js +0 -6
  319. package/dist/components/post-menu-item2.js +0 -33
  320. package/dist/components/post-menu-trigger.d.ts +0 -11
  321. package/dist/components/post-menu-trigger.js +0 -6
  322. package/dist/components/post-menu-trigger2.js +0 -102
  323. package/dist/components/post-menu.d.ts +0 -11
  324. package/dist/components/post-menu.js +0 -6
  325. package/dist/components/post-menu2.js +0 -203
  326. package/dist/components/post-togglebutton.d.ts +0 -11
  327. package/dist/components/post-togglebutton.js +0 -6
  328. package/dist/components/post-togglebutton2.js +0 -61
  329. package/dist/components/slide.js +0 -25
  330. package/dist/esm/attribute-observer-37fa950a.js +0 -25
  331. package/dist/esm/check-url-a974431e.js +0 -12
  332. package/dist/esm/debounce-abe98cc2.js +0 -10
  333. package/dist/esm/get-root-7af2e0d1.js +0 -9
  334. package/dist/esm/package-4d81f3c2.js +0 -3
  335. package/dist/esm/post-accordion-item-e10452dc.js +0 -61
  336. package/dist/esm/post-avatar-5572fa73.js +0 -146
  337. package/dist/esm/post-avatar.entry.js +0 -5
  338. package/dist/esm/post-back-to-top-1d823c43.js +0 -73
  339. package/dist/esm/post-back-to-top.entry.js +0 -7
  340. package/dist/esm/post-banner-78480475.js +0 -88
  341. package/dist/esm/post-banner.entry.js +0 -10
  342. package/dist/esm/post-breadcrumb-aaa77f74.js +0 -109
  343. package/dist/esm/post-breadcrumb-item_2.entry.js +0 -8
  344. package/dist/esm/post-breadcrumb.entry.js +0 -5
  345. package/dist/esm/post-card-control-862aa961.js +0 -270
  346. package/dist/esm/post-closebutton_15.entry.js +0 -11
  347. package/dist/esm/post-footer-b18875e7.js +0 -82
  348. package/dist/esm/post-footer.entry.js +0 -3
  349. package/dist/esm/post-menu-item-2906384b.js +0 -71
  350. package/dist/esm/post-popover-2432bb3f.js +0 -102
  351. package/dist/esm/post-rating-95cbdbb8.js +0 -86
  352. package/dist/esm/post-tab-header-dfea00ea.js +0 -30
  353. package/dist/esm/post-tag-a77e7af6.js +0 -45
  354. package/dist/esm/slide-3422b8a3.js +0 -25
  355. package/dist/post-components/p-0711f76d.entry.js +0 -1
  356. package/dist/post-components/p-095a06f6.entry.js +0 -1
  357. package/dist/post-components/p-0b5a5f32.js +0 -1
  358. package/dist/post-components/p-135fa60f.js +0 -1
  359. package/dist/post-components/p-18e38d8a.js +0 -1
  360. package/dist/post-components/p-2e1ec074.entry.js +0 -1
  361. package/dist/post-components/p-4202b433.entry.js +0 -1
  362. package/dist/post-components/p-45773f59.js +0 -1
  363. package/dist/post-components/p-4953de7e.js +0 -1
  364. package/dist/post-components/p-4f67c5f5.entry.js +0 -1
  365. package/dist/post-components/p-4f9746f6.js +0 -15
  366. package/dist/post-components/p-5075c672.entry.js +0 -1
  367. package/dist/post-components/p-515e0f96.js +0 -1
  368. package/dist/post-components/p-5467b223.js +0 -1
  369. package/dist/post-components/p-67036798.entry.js +0 -1
  370. package/dist/post-components/p-6adeaa6c.js +0 -1
  371. package/dist/post-components/p-6d953fb2.js +0 -1
  372. package/dist/post-components/p-6edb0ac5.js +0 -1
  373. package/dist/post-components/p-6f8f39ca.js +0 -1
  374. package/dist/post-components/p-7503a623.js +0 -1
  375. package/dist/post-components/p-761b24c7.entry.js +0 -1
  376. package/dist/post-components/p-77c4c1d2.js +0 -1
  377. package/dist/post-components/p-7cf0c2ad.js +0 -1
  378. package/dist/post-components/p-856c14d6.entry.js +0 -1
  379. package/dist/post-components/p-866bf50a.entry.js +0 -1
  380. package/dist/post-components/p-8d621781.js +0 -1
  381. package/dist/post-components/p-8fe2d72c.entry.js +0 -1
  382. package/dist/post-components/p-9ad5088f.entry.js +0 -1
  383. package/dist/post-components/p-a1d2b90e.js +0 -1
  384. package/dist/post-components/p-a521419d.entry.js +0 -1
  385. package/dist/post-components/p-aa538648.js +0 -1
  386. package/dist/post-components/p-afdbee2f.js +0 -1
  387. package/dist/post-components/p-b02817f2.entry.js +0 -1
  388. package/dist/post-components/p-b157dcba.entry.js +0 -1
  389. package/dist/post-components/p-b22656b1.js +0 -1
  390. package/dist/post-components/p-bdbd11cb.js +0 -1
  391. package/dist/post-components/p-c537e196.entry.js +0 -1
  392. package/dist/post-components/p-d4f93f2b.js +0 -1
  393. package/dist/post-components/p-dca4246a.entry.js +0 -1
  394. package/dist/post-components/p-f319b026.js +0 -1
  395. package/dist/post-components/p-f4b7b379.js +0 -1
  396. package/dist/post-components/p-fac66087.entry.js +0 -1
  397. package/dist/post-components/p-fc91cbc2.js +0 -1
  398. package/dist/types/animations/slide.d.ts +0 -2
  399. package/dist/types/components/post-avatar/post-avatar.d.ts +0 -51
  400. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +0 -19
  401. package/dist/types/components/post-banner/banner-types.d.ts +0 -2
  402. package/dist/types/components/post-banner/post-banner.d.ts +0 -49
  403. package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +0 -30
  404. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +0 -16
  405. package/dist/types/components/post-closebutton/post-closebutton.d.ts +0 -7
  406. package/dist/types/components/post-footer/post-footer.d.ts +0 -23
  407. package/dist/types/components/post-header/post-header.d.ts +0 -24
  408. package/dist/types/components/post-language-option/post-language-option.d.ts +0 -45
  409. package/dist/types/components/post-language-switch/post-language-switch.d.ts +0 -31
  410. package/dist/types/components/post-language-switch/switch-variants.d.ts +0 -2
  411. package/dist/types/components/post-list/post-list.d.ts +0 -24
  412. package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
  413. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +0 -19
  414. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +0 -35
  415. package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +0 -25
  416. package/dist/types/components/post-menu/post-menu.d.ts +0 -48
  417. package/dist/types/components/post-menu-item/post-menu-item.d.ts +0 -4
  418. package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +0 -27
  419. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +0 -15
  420. package/dist/types/utils/breakpoints.d.ts +0 -11
  421. package/dist/types/utils/is-focusable.d.ts +0 -1
  422. package/loaders/attribute-observer.js +0 -25
  423. package/loaders/debounce.js +0 -10
  424. package/loaders/get-root.js +0 -9
  425. package/loaders/post-accordion-item2.js +0 -102
  426. package/loaders/post-avatar.js +0 -176
  427. package/loaders/post-back-to-top.d.ts +0 -11
  428. package/loaders/post-back-to-top.js +0 -103
  429. package/loaders/post-banner.d.ts +0 -11
  430. package/loaders/post-banner.js +0 -128
  431. package/loaders/post-breadcrumb-item.d.ts +0 -11
  432. package/loaders/post-breadcrumb-item.js +0 -6
  433. package/loaders/post-breadcrumb-item2.js +0 -82
  434. package/loaders/post-breadcrumb.d.ts +0 -11
  435. package/loaders/post-breadcrumb.js +0 -171
  436. package/loaders/post-closebutton.d.ts +0 -11
  437. package/loaders/post-closebutton.js +0 -37
  438. package/loaders/post-footer.d.ts +0 -11
  439. package/loaders/post-footer.js +0 -127
  440. package/loaders/post-header.d.ts +0 -11
  441. package/loaders/post-header.js +0 -279
  442. package/loaders/post-language-option.d.ts +0 -11
  443. package/loaders/post-language-option.js +0 -97
  444. package/loaders/post-language-switch.d.ts +0 -11
  445. package/loaders/post-language-switch.js +0 -149
  446. package/loaders/post-list-item.d.ts +0 -11
  447. package/loaders/post-list-item.js +0 -38
  448. package/loaders/post-list.js +0 -56
  449. package/loaders/post-mainnavigation.d.ts +0 -11
  450. package/loaders/post-mainnavigation.js +0 -51
  451. package/loaders/post-megadropdown-trigger.d.ts +0 -11
  452. package/loaders/post-megadropdown-trigger.js +0 -94
  453. package/loaders/post-megadropdown.d.ts +0 -11
  454. package/loaders/post-megadropdown.js +0 -96
  455. package/loaders/post-menu-item.d.ts +0 -11
  456. package/loaders/post-menu-item.js +0 -6
  457. package/loaders/post-menu-item2.js +0 -33
  458. package/loaders/post-menu-trigger.d.ts +0 -11
  459. package/loaders/post-menu-trigger.js +0 -6
  460. package/loaders/post-menu-trigger2.js +0 -102
  461. package/loaders/post-menu.d.ts +0 -11
  462. package/loaders/post-menu.js +0 -6
  463. package/loaders/post-menu2.js +0 -203
  464. package/loaders/post-togglebutton.d.ts +0 -11
  465. package/loaders/post-togglebutton.js +0 -64
  466. package/loaders/slide.js +0 -25
@@ -1,160 +0,0 @@
1
- import { h, Host } from "@stencil/core";
2
- import { throttle } from "throttle-debounce";
3
- import { version } from "../../../../package";
4
- import { slideDown, slideUp } from "../../animations/slide";
5
- export class PostHeader {
6
- constructor() {
7
- this.scrollParent = null;
8
- this.throttledScroll = () => this.handleScrollEvent();
9
- this.throttledResize = throttle(50, () => this.handleResize());
10
- this.device = null;
11
- this.mobileMenuExtended = false;
12
- }
13
- componentWillRender() {
14
- this.scrollParent = this.getScrollParent(this.host);
15
- this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
16
- window.addEventListener('resize', this.throttledResize, { passive: true });
17
- this.handleResize();
18
- this.handleScrollEvent();
19
- }
20
- frozeBody(isMobileMenuExtended) {
21
- document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
22
- }
23
- /**
24
- * Toggles the mobile navigation.
25
- */
26
- async toggleMobileMenu() {
27
- if (this.device === 'desktop')
28
- return;
29
- this.mobileMenuAnimation = this.mobileMenuExtended
30
- ? slideUp(this.mobileMenu)
31
- : slideDown(this.mobileMenu);
32
- // Update the state of the toggle button
33
- const menuButton = this.host.querySelector('post-togglebutton');
34
- menuButton.toggled = !this.mobileMenuExtended;
35
- // Toggle menu visibility before it slides down and after it slides back up
36
- if (this.mobileMenuExtended)
37
- await this.mobileMenuAnimation.finished;
38
- this.mobileMenuExtended = !this.mobileMenuExtended;
39
- if (!this.mobileMenuExtended)
40
- await this.mobileMenuAnimation.finished;
41
- }
42
- handleScrollEvent() {
43
- // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
44
- const st = Math.max(0, this.scrollParent instanceof Document
45
- ? this.scrollParent.documentElement.scrollTop
46
- : this.scrollParent.scrollTop);
47
- this.host.style.setProperty('--header-scroll-top', `${st}px`);
48
- }
49
- getScrollParent(node) {
50
- let currentParent = node.parentElement;
51
- while (currentParent) {
52
- if (currentParent.nodeName === 'BODY') {
53
- return document;
54
- }
55
- if (this.isScrollable(currentParent)) {
56
- return currentParent;
57
- }
58
- currentParent = currentParent.parentElement;
59
- }
60
- return document;
61
- }
62
- isScrollable(node) {
63
- if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
64
- return false;
65
- }
66
- const style = getComputedStyle(node);
67
- return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
68
- const value = style.getPropertyValue(propertyName);
69
- return value === 'auto' || value === 'scroll';
70
- });
71
- }
72
- handleResize() {
73
- const previousDevice = this.device;
74
- let newDevice;
75
- const width = window === null || window === void 0 ? void 0 : window.innerWidth;
76
- if (width >= 1024) {
77
- newDevice = 'desktop';
78
- }
79
- else if (width >= 600) {
80
- newDevice = 'tablet';
81
- }
82
- else {
83
- newDevice = 'mobile';
84
- }
85
- // Close any open mobile menu
86
- if (newDevice === 'desktop' && this.mobileMenuExtended) {
87
- this.toggleMobileMenu();
88
- this.mobileMenuAnimation.finish(); // no animation
89
- }
90
- // Apply only on change for doing work only when necessary
91
- if (newDevice !== previousDevice) {
92
- this.device = newDevice;
93
- window.requestAnimationFrame(() => {
94
- this.switchLanguageSwitchMode();
95
- });
96
- }
97
- }
98
- switchLanguageSwitchMode() {
99
- var _a;
100
- const variant = this.device === 'desktop' ? 'dropdown' : 'list';
101
- (_a = this.host.querySelector('post-language-switch')) === null || _a === void 0 ? void 0 : _a.setAttribute('variant', variant);
102
- }
103
- render() {
104
- const navigationClasses = ['navigation'];
105
- if (this.mobileMenuExtended) {
106
- navigationClasses.push('extended');
107
- }
108
- return (h(Host, { key: 'd96b46b64946ef425059463d127fa1188c99ea58', version: version }, h("div", { key: '831ebc53d0f598a99e72d46a1530c2c34c196948', class: "global-header" }, h("div", { key: '69f3b3bc47a61810eea3ae60d7b2423af1750416', class: "global-sub" }, h("div", { key: 'ad6d36c7e7f029edfdee223ab1df664a1b7002f8', class: "logo" }, h("slot", { key: '95adfc2ad9e63fde9eef3cc71b63247e140fba3d', name: "post-logo" }))), h("div", { key: '741e62693a4df8558213c85d7a837efb8b0cfa6d', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '992844b617955cb77079a175fcaaf54943a6eef2', name: "meta-navigation" }), h("slot", { key: '4384ae4c04d239bf1b1947ba6d1457ae6879a5cf', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'c5b33b6bfb8c00d44710ec997a80d56720aab760', name: "post-language-switch" }), h("div", { key: '25a629a419c94fc4789eb374b87cf7c159b746c6', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '3f3078832237abc5a6df79b4a57fe20fae926aa3', name: "post-togglebutton" })))), h("div", { key: 'e11ca83bc108d4677e849b7386ad7bd09d8c9331', class: "title-header d-flex space-between align-center" }, h("slot", { key: '87430ad15ab09f800b714be45be00a50e5b7dc0a', name: "title" }), h("div", { key: '494a198d3ee8185a26b16fce97a85bed01d6b3f7', class: "global-sub" }, h("slot", { key: '8a54e3d1366d39c11d64c0de90f35a4330836428', name: "local-controls" }), h("slot", { key: '63f841457e0f7b7722a3f8b1ea83ff0d78d9c08e' }))), h("div", { key: '90cf667c412d90f8e466e7e7925fa4a2f8223ad8', ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { key: 'a046286cb6cc770bfb8fb4439cdacac7c351001b', name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { key: '6e0ad5841ef53daf0c0885b75efdf12d69f4a72d', class: "navigation-footer" }, h("slot", { key: '1eaebace0d5e37794867ae2a317a104726bb873a', name: "meta-navigation" }), h("slot", { key: '79217cd6fd16d4c6ef3e8aaa656e6dc0a8842b23', name: "post-language-switch" }))))));
109
- }
110
- static get is() { return "post-header"; }
111
- static get encapsulation() { return "shadow"; }
112
- static get originalStyleUrls() {
113
- return {
114
- "$": ["./post-header.scss"]
115
- };
116
- }
117
- static get styleUrls() {
118
- return {
119
- "$": ["post-header.css"]
120
- };
121
- }
122
- static get states() {
123
- return {
124
- "device": {},
125
- "mobileMenuExtended": {}
126
- };
127
- }
128
- static get methods() {
129
- return {
130
- "toggleMobileMenu": {
131
- "complexType": {
132
- "signature": "() => Promise<void>",
133
- "parameters": [],
134
- "references": {
135
- "Promise": {
136
- "location": "global",
137
- "id": "global::Promise"
138
- },
139
- "HTMLPostTogglebuttonElement": {
140
- "location": "global",
141
- "id": "global::HTMLPostTogglebuttonElement"
142
- }
143
- },
144
- "return": "Promise<void>"
145
- },
146
- "docs": {
147
- "text": "Toggles the mobile navigation.",
148
- "tags": []
149
- }
150
- }
151
- };
152
- }
153
- static get elementRef() { return "host"; }
154
- static get watchers() {
155
- return [{
156
- "propName": "mobileMenuExtended",
157
- "methodName": "frozeBody"
158
- }];
159
- }
160
- }
@@ -1,3 +0,0 @@
1
- /*!
2
- * Copyright 2021 by Swiss Post, Information Technology
3
- */:host{display:inline-block;width:fit-content}button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button}a{color:inherit;text-decoration:none}:is(a,button){cursor:pointer;display:flex;align-items:center;justify-content:center;height:100%;width:100%;padding:var(--post-language-option-padding)}.post-language-option-list{border-radius:2px;width:40px;height:40px}.post-language-option-list{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-list: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-list:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-option-list: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-list:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-option-list[aria-current=true],.post-language-option-list[aria-current=page]{background-color:#050400;color:#fff}.post-language-option-dropdown{padding-block:13px;padding-inline:24px;box-sizing:border-box;position:relative}.post-language-option-dropdown[aria-current=true]::after,.post-language-option-dropdown[aria-current=page]::after{content:"";left:-2px;height:3px;background-color:#504f4b;width:calc(100% + 4px);display:block;position:absolute;bottom:3px}.post-language-option-dropdown[aria-current=true]:focus::after,.post-language-option-dropdown[aria-current=page]:focus::after{width:calc(100% - 5px);left:2px}
@@ -1,215 +0,0 @@
1
- import { Host, h, } from "@stencil/core";
2
- import { checkEmptyOrType, checkType } from "../../utils/index";
3
- import { version } from "../../../../package";
4
- /**
5
- * @slot default - Slot for placing the content inside the anchor or button.
6
- */
7
- export class PostLanguageOption {
8
- constructor() {
9
- this.code = undefined;
10
- this.active = undefined;
11
- this.variant = undefined;
12
- this.name = undefined;
13
- this.url = undefined;
14
- }
15
- validateCode(value = this.code) {
16
- checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
17
- }
18
- validateActiveProp(value = this.active) {
19
- checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
20
- }
21
- validateName(value = this.name) {
22
- checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
23
- }
24
- validateUrl(value = this.url) {
25
- checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
26
- }
27
- componentDidLoad() {
28
- this.validateCode();
29
- this.validateActiveProp();
30
- this.validateName();
31
- this.validateUrl();
32
- if (!this.name && this.isNameRequired()) {
33
- throw new Error('The "name" property of the post-language-option component is required when the full language name is not displayed.');
34
- }
35
- }
36
- /**
37
- * Selects the language option programmatically.
38
- */
39
- async select() {
40
- this.active = true;
41
- this.emitChange();
42
- }
43
- emitChange() {
44
- this.postChange.emit(this.code);
45
- }
46
- isNameRequired() {
47
- return this.host.textContent.toLowerCase() === this.code.toLowerCase();
48
- }
49
- render() {
50
- const lang = this.code.toLowerCase();
51
- return (h(Host, { key: '9a3f49ee993b69393ea8f81b671cd5482049ff1c', "data-version": version, role: "listitem" }, this.url ? (h("a", { class: this.variant ? `post-language-option-${this.variant}` : '', "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange() }, h("slot", null))) : (h("button", { class: this.variant ? `post-language-option-${this.variant}` : '', "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange() }, h("slot", null)))));
52
- }
53
- static get is() { return "post-language-option"; }
54
- static get encapsulation() { return "shadow"; }
55
- static get originalStyleUrls() {
56
- return {
57
- "$": ["post-language-option.scss"]
58
- };
59
- }
60
- static get styleUrls() {
61
- return {
62
- "$": ["post-language-option.css"]
63
- };
64
- }
65
- static get properties() {
66
- return {
67
- "code": {
68
- "type": "string",
69
- "mutable": false,
70
- "complexType": {
71
- "original": "string",
72
- "resolved": "string",
73
- "references": {}
74
- },
75
- "required": true,
76
- "optional": false,
77
- "docs": {
78
- "tags": [],
79
- "text": "The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, \"de\"."
80
- },
81
- "attribute": "code",
82
- "reflect": false
83
- },
84
- "active": {
85
- "type": "boolean",
86
- "mutable": true,
87
- "complexType": {
88
- "original": "boolean",
89
- "resolved": "boolean",
90
- "references": {}
91
- },
92
- "required": false,
93
- "optional": false,
94
- "docs": {
95
- "tags": [],
96
- "text": "If set to `true`, the language option is considered the current language for the page."
97
- },
98
- "attribute": "active",
99
- "reflect": true
100
- },
101
- "variant": {
102
- "type": "string",
103
- "mutable": false,
104
- "complexType": {
105
- "original": "SwitchVariant | null",
106
- "resolved": "\"dropdown\" | \"list\"",
107
- "references": {
108
- "SwitchVariant": {
109
- "location": "import",
110
- "path": "../post-language-switch/switch-variants",
111
- "id": "src/components/post-language-switch/switch-variants.ts::SwitchVariant"
112
- }
113
- }
114
- },
115
- "required": false,
116
- "optional": true,
117
- "docs": {
118
- "tags": [],
119
- "text": "The variant of the post-language-switch parent (dynamically set by the parent)"
120
- },
121
- "attribute": "variant",
122
- "reflect": false
123
- },
124
- "name": {
125
- "type": "string",
126
- "mutable": false,
127
- "complexType": {
128
- "original": "string",
129
- "resolved": "string",
130
- "references": {}
131
- },
132
- "required": false,
133
- "optional": false,
134
- "docs": {
135
- "tags": [],
136
- "text": "The full name of the language. For example, \"Deutsch\"."
137
- },
138
- "attribute": "name",
139
- "reflect": false
140
- },
141
- "url": {
142
- "type": "string",
143
- "mutable": false,
144
- "complexType": {
145
- "original": "string",
146
- "resolved": "string",
147
- "references": {}
148
- },
149
- "required": false,
150
- "optional": false,
151
- "docs": {
152
- "tags": [],
153
- "text": "The URL used for the href attribute of the internal anchor.\nThis field is optional; if not provided, a button will be used internally instead of an anchor."
154
- },
155
- "attribute": "url",
156
- "reflect": false
157
- }
158
- };
159
- }
160
- static get events() {
161
- return [{
162
- "method": "postChange",
163
- "name": "postChange",
164
- "bubbles": true,
165
- "cancelable": true,
166
- "composed": true,
167
- "docs": {
168
- "tags": [],
169
- "text": "An event emitted when the language option is clicked. The payload is the ISO 639 code of the language."
170
- },
171
- "complexType": {
172
- "original": "string",
173
- "resolved": "string",
174
- "references": {}
175
- }
176
- }];
177
- }
178
- static get methods() {
179
- return {
180
- "select": {
181
- "complexType": {
182
- "signature": "() => Promise<void>",
183
- "parameters": [],
184
- "references": {
185
- "Promise": {
186
- "location": "global",
187
- "id": "global::Promise"
188
- }
189
- },
190
- "return": "Promise<void>"
191
- },
192
- "docs": {
193
- "text": "Selects the language option programmatically.",
194
- "tags": []
195
- }
196
- }
197
- };
198
- }
199
- static get elementRef() { return "host"; }
200
- static get watchers() {
201
- return [{
202
- "propName": "code",
203
- "methodName": "validateCode"
204
- }, {
205
- "propName": "active",
206
- "methodName": "validateActiveProp"
207
- }, {
208
- "propName": "name",
209
- "methodName": "validateName"
210
- }, {
211
- "propName": "url",
212
- "methodName": "validateUrl"
213
- }];
214
- }
215
- }
@@ -1 +0,0 @@
1
- :host{display:block}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{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-switch-trigger: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-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger: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-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}
@@ -1,163 +0,0 @@
1
- import { Host, h } from "@stencil/core";
2
- import { checkEmptyOrOneOf, checkType } from "../../utils/index";
3
- import { version } from "../../../../package";
4
- import { SWITCH_VARIANTS } from "./switch-variants";
5
- import { nanoid } from "nanoid";
6
- export class PostLanguageSwitch {
7
- constructor() {
8
- this.menuId = `p${nanoid(11)}`;
9
- this.caption = undefined;
10
- this.description = undefined;
11
- this.variant = 'list';
12
- this.activeLang = undefined;
13
- }
14
- validateCaption(value = this.caption) {
15
- checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
16
- }
17
- validateDescription(value = this.description) {
18
- checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
19
- }
20
- validateVariant(value = this.variant) {
21
- checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
22
- }
23
- connectedCallback() {
24
- this.updateChildrenVariant();
25
- // Get the active language based on children's active state
26
- this.activeLang = Array.from(this.host.querySelectorAll('post-language-option'))
27
- .find(el => el.getAttribute('active') == 'true')
28
- .getAttribute('code');
29
- }
30
- // Update post-language-option variant to have the correct style
31
- updateChildrenVariant() {
32
- this.host.querySelectorAll('post-language-option').forEach(el => {
33
- el.setAttribute('variant', this.variant);
34
- });
35
- }
36
- componentShouldUpdate() {
37
- this.updateChildrenVariant();
38
- }
39
- componentDidLoad() {
40
- this.validateCaption();
41
- this.validateDescription();
42
- this.validateVariant();
43
- // Detects a change in the active language
44
- this.host.addEventListener('postChange', (el) => {
45
- this.activeLang = el.detail;
46
- // Update the active state in the children post-language-option components
47
- this.host.querySelectorAll('post-language-option').forEach(lang => {
48
- if (lang.code && lang.code === this.activeLang) {
49
- lang.setAttribute('active', 'true');
50
- }
51
- else {
52
- lang.setAttribute('active', 'false');
53
- }
54
- });
55
- // Hides the dropdown when an option has been clicked
56
- if (this.variant === 'dropdown') {
57
- const menu = this.host.shadowRoot.querySelector('post-menu');
58
- menu.toggle(menu);
59
- }
60
- });
61
- }
62
- renderList() {
63
- return (h(Host, { "data-version": version, "aria-label": `${this.caption}, ${this.description}`, "aria-role": "list" }, h("slot", null)));
64
- }
65
- renderDropdown() {
66
- return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-switch-trigger", "aria-label": `${this.caption}, ${this.description}` }, this.activeLang.toUpperCase(), h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { id: this.menuId }, h("div", { class: "post-language-switch-dropdown-container" }, h("slot", null)))));
67
- }
68
- render() {
69
- return this.variant === 'list' ? this.renderList() : this.renderDropdown();
70
- }
71
- static get is() { return "post-language-switch"; }
72
- static get encapsulation() { return "shadow"; }
73
- static get originalStyleUrls() {
74
- return {
75
- "$": ["post-language-switch.scss"]
76
- };
77
- }
78
- static get styleUrls() {
79
- return {
80
- "$": ["post-language-switch.css"]
81
- };
82
- }
83
- static get properties() {
84
- return {
85
- "caption": {
86
- "type": "string",
87
- "mutable": false,
88
- "complexType": {
89
- "original": "string",
90
- "resolved": "string",
91
- "references": {}
92
- },
93
- "required": false,
94
- "optional": false,
95
- "docs": {
96
- "tags": [],
97
- "text": "A title for the list of language options"
98
- },
99
- "attribute": "caption",
100
- "reflect": false
101
- },
102
- "description": {
103
- "type": "string",
104
- "mutable": false,
105
- "complexType": {
106
- "original": "string",
107
- "resolved": "string",
108
- "references": {}
109
- },
110
- "required": false,
111
- "optional": false,
112
- "docs": {
113
- "tags": [],
114
- "text": "A descriptive text for the list of language options"
115
- },
116
- "attribute": "description",
117
- "reflect": false
118
- },
119
- "variant": {
120
- "type": "string",
121
- "mutable": false,
122
- "complexType": {
123
- "original": "SwitchVariant",
124
- "resolved": "\"dropdown\" | \"list\"",
125
- "references": {
126
- "SwitchVariant": {
127
- "location": "import",
128
- "path": "./switch-variants",
129
- "id": "src/components/post-language-switch/switch-variants.ts::SwitchVariant"
130
- }
131
- }
132
- },
133
- "required": false,
134
- "optional": false,
135
- "docs": {
136
- "tags": [],
137
- "text": "Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)"
138
- },
139
- "attribute": "variant",
140
- "reflect": false,
141
- "defaultValue": "'list'"
142
- }
143
- };
144
- }
145
- static get states() {
146
- return {
147
- "activeLang": {}
148
- };
149
- }
150
- static get elementRef() { return "host"; }
151
- static get watchers() {
152
- return [{
153
- "propName": "caption",
154
- "methodName": "validateCaption"
155
- }, {
156
- "propName": "description",
157
- "methodName": "validateDescription"
158
- }, {
159
- "propName": "variant",
160
- "methodName": "validateVariant"
161
- }];
162
- }
163
- }
@@ -1 +0,0 @@
1
- export const SWITCH_VARIANTS = ['list', 'dropdown'];
@@ -1,3 +0,0 @@
1
- /*!
2
- * Copyright 2021 by Swiss Post, Information Technology
3
- */post-list{display:flex;flex-direction:column;gap:var(--post-list-title-gap, 0)}post-list>[role=list]{display:flex;flex-direction:column;gap:var(--post-list-item-gap, 0)}post-list:where([horizontal]:not([horizontal=false])){flex-direction:row;align-items:center}post-list:where([horizontal]:not([horizontal=false]))>[role=list]{flex-direction:row;align-items:center}post-list>.list-title.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}post-list>.list-title.visually-hidden:not(caption){position:absolute !important}
@@ -1,87 +0,0 @@
1
- import { Host, h } from "@stencil/core";
2
- import { version } from "../../../../package";
3
- /**
4
- * @slot default - Slot for placing the list title.
5
- * @slot post-list-item - Slot for placing post-list-item components.
6
- */
7
- export class PostList {
8
- constructor() {
9
- this.titleId = undefined;
10
- this.titleHidden = false;
11
- this.horizontal = false;
12
- }
13
- componentWillLoad() {
14
- /**
15
- * Get the id set on the host element or use a random id by default
16
- */
17
- this.titleId = `title-${this.host.id || crypto.randomUUID()}`;
18
- }
19
- componentDidLoad() {
20
- this.checkTitle();
21
- }
22
- checkTitle() {
23
- if (!this.titleEl.textContent.trim()) {
24
- throw new Error('Please provide a title to the list component. Title is mandatory for accessibility purposes.');
25
- }
26
- }
27
- render() {
28
- return (h(Host, { key: '4f982e717530514589c5528553b70463d678b676', "data-version": version }, h("div", { key: 'cc65ed208f48e7a22482af96fd069d05363f2617', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: '0f8bbeade50b59e53767ce2169dd57bb79644705' })), h("div", { key: '7fa5de37a169e6f76928c2088c46ee747427887e', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '86b4d71b83671babb61dd12e842710d67350a09e', name: "post-list-item" }))));
29
- }
30
- static get is() { return "post-list"; }
31
- static get originalStyleUrls() {
32
- return {
33
- "$": ["post-list.scss"]
34
- };
35
- }
36
- static get styleUrls() {
37
- return {
38
- "$": ["post-list.css"]
39
- };
40
- }
41
- static get properties() {
42
- return {
43
- "titleHidden": {
44
- "type": "boolean",
45
- "mutable": false,
46
- "complexType": {
47
- "original": "boolean",
48
- "resolved": "boolean",
49
- "references": {}
50
- },
51
- "required": false,
52
- "optional": false,
53
- "docs": {
54
- "tags": [],
55
- "text": "If `true`, the list title will be hidden. Otherwise, it will be displayed.`"
56
- },
57
- "attribute": "title-hidden",
58
- "reflect": false,
59
- "defaultValue": "false"
60
- },
61
- "horizontal": {
62
- "type": "boolean",
63
- "mutable": false,
64
- "complexType": {
65
- "original": "boolean",
66
- "resolved": "boolean",
67
- "references": {}
68
- },
69
- "required": false,
70
- "optional": false,
71
- "docs": {
72
- "tags": [],
73
- "text": "The list can become horizontal by setting `horizontal=\"true\"` or just `horizontal`"
74
- },
75
- "attribute": "horizontal",
76
- "reflect": true,
77
- "defaultValue": "false"
78
- }
79
- };
80
- }
81
- static get states() {
82
- return {
83
- "titleId": {}
84
- };
85
- }
86
- static get elementRef() { return "host"; }
87
- }
@@ -1 +0,0 @@
1
- :host{display:flex}