@swisspost/design-system-components 10.0.0-next.75 → 10.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 (333) hide show
  1. package/dist/cjs/{create-validator-decorator-Bimhl6Ib.js → create-validator-decorator-4dRrOF30.js} +1 -1
  2. package/dist/cjs/{index-CyeY2muT.js → index-BqngpwGa.js} +11 -15
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/{one-of-BVQP1dR3.js → one-of-D1veqtsm.js} +1 -1
  5. package/dist/cjs/{package-JSyXVavg.js → package-Bwdl-T-w.js} +1 -1
  6. package/dist/cjs/{pattern-BDKu8-v6.js → pattern-B7VKOu5m.js} +1 -1
  7. package/dist/cjs/post-accordion_2.cjs.entry.js +10 -12
  8. package/dist/cjs/post-autocomplete.cjs.entry.js +6 -6
  9. package/dist/cjs/post-avatar.cjs.entry.js +7 -7
  10. package/dist/cjs/post-back-to-top.cjs.entry.js +6 -6
  11. package/dist/cjs/post-banner.cjs.entry.js +5 -5
  12. package/dist/cjs/post-breadcrumb-item.cjs.entry.js +7 -7
  13. package/dist/cjs/post-breadcrumbs.cjs.entry.js +7 -7
  14. package/dist/cjs/post-closebutton_14.cjs.entry.js +41 -35
  15. package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -6
  16. package/dist/cjs/post-components.cjs.js +2 -2
  17. package/dist/cjs/post-date-picker.cjs.entry.js +427 -257
  18. package/dist/cjs/post-footer.cjs.entry.js +6 -6
  19. package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
  20. package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
  21. package/dist/cjs/post-listbox.cjs.entry.js +3 -3
  22. package/dist/cjs/post-number-input.cjs.entry.js +5 -4
  23. package/dist/cjs/post-pagination.cjs.entry.js +5 -5
  24. package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -5
  25. package/dist/cjs/post-popover.cjs.entry.js +11 -12
  26. package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
  27. package/dist/cjs/post-rating.cjs.entry.js +6 -6
  28. package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +7 -7
  29. package/dist/cjs/post-side-navigation.cjs.entry.js +18 -7
  30. package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
  31. package/dist/cjs/post-stepper.cjs.entry.js +7 -7
  32. package/dist/cjs/post-tab-item.cjs.entry.js +15 -14
  33. package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
  34. package/dist/cjs/post-tabs.cjs.entry.js +196 -74
  35. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -9
  36. package/dist/cjs/post-tooltip.cjs.entry.js +9 -10
  37. package/dist/cjs/{required-BsZuSJAl.js → required-Bkz8MOYa.js} +1 -1
  38. package/dist/cjs/{type-DXpEWY0w.js → type-D8eD1JMd.js} +1 -1
  39. package/dist/cjs/{url-D-EbWRlF.js → url-C7MnIIZ_.js} +1 -1
  40. package/dist/collection/collection-manifest.json +1 -2
  41. package/dist/collection/components/post-accordion/post-accordion.js +1 -1
  42. package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -36
  43. package/dist/collection/components/post-autocomplete/post-autocomplete.js +1 -1
  44. package/dist/collection/components/post-avatar/post-avatar.js +1 -1
  45. package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
  46. package/dist/collection/components/post-banner/post-banner.js +1 -1
  47. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +1 -1
  48. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  49. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  50. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
  51. package/dist/collection/components/post-date-picker/accessibility-utils.js +59 -0
  52. package/dist/collection/components/post-date-picker/date-utils.js +102 -0
  53. package/dist/collection/components/post-date-picker/native-mask-element.js +36 -0
  54. package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
  55. package/dist/collection/components/post-date-picker/post-date-picker.js +224 -301
  56. package/dist/collection/components/post-footer/post-footer.js +1 -1
  57. package/dist/collection/components/post-header/post-header.js +6 -5
  58. package/dist/collection/components/post-icon/post-icon.js +1 -1
  59. package/dist/collection/components/post-language-menu/post-language-menu.js +7 -5
  60. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  61. package/dist/collection/components/post-listbox/post-listbox.js +1 -1
  62. package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
  63. package/dist/collection/components/post-logo/post-logo.js +1 -1
  64. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  65. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  66. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  67. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  68. package/dist/collection/components/post-menu/post-menu.js +9 -12
  69. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  70. package/dist/collection/components/post-number-input/post-number-input.js +3 -2
  71. package/dist/collection/components/post-popover/post-popover.js +12 -22
  72. package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
  73. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +13 -9
  74. package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
  75. package/dist/collection/components/post-rating/post-rating.js +1 -1
  76. package/dist/collection/components/post-side-navigation/post-side-navigation.css +1 -1
  77. package/dist/collection/components/post-side-navigation/post-side-navigation.js +38 -2
  78. package/dist/collection/components/post-side-navigation/side-navigation-styles.js +1 -0
  79. package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.css +1 -1
  80. package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
  81. package/dist/collection/components/post-stepper/post-stepper.js +1 -1
  82. package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
  83. package/dist/collection/components/post-tab-item/post-tab-item.js +36 -19
  84. package/dist/collection/components/post-tab-panel/post-tab-panel.js +3 -2
  85. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  86. package/dist/collection/components/post-tabs/post-tabs.js +255 -84
  87. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  88. package/dist/collection/components/post-tooltip/post-tooltip.js +12 -22
  89. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -4
  90. package/dist/collection/types/element-api.js +3 -0
  91. package/dist/component-names.json +0 -1
  92. package/dist/components/index.d.ts +0 -2
  93. package/dist/components/index.js +1 -1
  94. package/dist/components/package.js +1 -1
  95. package/dist/components/post-accordion-item2.js +1 -1
  96. package/dist/components/post-accordion2.js +1 -1
  97. package/dist/components/post-autocomplete.js +1 -1
  98. package/dist/components/post-avatar.js +1 -1
  99. package/dist/components/post-back-to-top.js +1 -1
  100. package/dist/components/post-banner.js +1 -1
  101. package/dist/components/post-breadcrumbs.js +1 -1
  102. package/dist/components/post-closebutton2.js +1 -1
  103. package/dist/components/post-collapsible-trigger2.js +1 -1
  104. package/dist/components/post-collapsible2.js +1 -1
  105. package/dist/components/post-date-picker.js +1 -1
  106. package/dist/components/post-footer.js +1 -1
  107. package/dist/components/post-header.js +1 -1
  108. package/dist/components/post-icon2.js +1 -1
  109. package/dist/components/post-language-menu.js +1 -1
  110. package/dist/components/post-linkarea.js +1 -1
  111. package/dist/components/post-listbox-option.js +1 -1
  112. package/dist/components/post-listbox.js +1 -1
  113. package/dist/components/post-logo.js +1 -1
  114. package/dist/components/post-mainnavigation.js +1 -1
  115. package/dist/components/post-megadropdown-trigger.js +1 -1
  116. package/dist/components/post-megadropdown.js +1 -1
  117. package/dist/components/post-menu-trigger2.js +1 -1
  118. package/dist/components/post-menu2.js +1 -1
  119. package/dist/components/post-number-input.js +1 -1
  120. package/dist/components/post-popover-trigger.js +1 -1
  121. package/dist/components/post-popover.js +1 -1
  122. package/dist/components/post-popovercontainer2.js +1 -1
  123. package/dist/components/post-progressbar.js +1 -1
  124. package/dist/components/post-rating.js +1 -1
  125. package/dist/components/post-side-navigation-trigger.js +1 -1
  126. package/dist/components/post-side-navigation.js +1 -1
  127. package/dist/components/post-stepper-item.js +1 -1
  128. package/dist/components/post-stepper.js +1 -1
  129. package/dist/components/post-tab-item.js +1 -1
  130. package/dist/components/post-tab-panel.js +1 -1
  131. package/dist/components/post-tabs.js +1 -1
  132. package/dist/components/post-togglebutton2.js +1 -1
  133. package/dist/components/post-tooltip-trigger.js +1 -1
  134. package/dist/components/post-tooltip.js +1 -1
  135. package/dist/components/react/index.js +1 -1
  136. package/dist/components/react/{p-DNddZV_h.js → p-Auha71WU.js} +1 -1
  137. package/dist/components/react/{p-ztiqEfbC.js → p-Bpwt-eYO.js} +1 -1
  138. package/dist/components/react/p-C6wtG9yO.js +1 -0
  139. package/dist/components/react/{p-DU4XzTGt.js → p-C7jOKUzv.js} +1 -1
  140. package/dist/components/react/{p-CbU3QFNG.js → p-Cjo8Ke7t.js} +1 -1
  141. package/dist/components/react/{p-BUAS73l8.js → p-ClF2qF9A.js} +1 -1
  142. package/dist/components/react/{p-BUSQG9af.js → p-CyNGpewj.js} +1 -1
  143. package/dist/components/react/{p-DTg2SXJj.js → p-DvVypwYO.js} +1 -1
  144. package/dist/components/react/p-SEWFpJgA.js +1 -0
  145. package/dist/components/react/p-bAeGAkWL.js +1 -0
  146. package/dist/components/react/{p-B3ZJPCU0.js → p-i1ZFHprG.js} +1 -1
  147. package/dist/components/react/p-znfTjqEZ.js +1 -0
  148. package/dist/components/react/post-accordion-item.js +1 -1
  149. package/dist/components/react/post-accordion.js +1 -1
  150. package/dist/components/react/post-autocomplete.js +1 -1
  151. package/dist/components/react/post-avatar.js +1 -1
  152. package/dist/components/react/post-back-to-top.js +1 -1
  153. package/dist/components/react/post-banner.js +1 -1
  154. package/dist/components/react/post-breadcrumb-item.js +1 -1
  155. package/dist/components/react/post-breadcrumbs.js +1 -1
  156. package/dist/components/react/post-closebutton.js +1 -1
  157. package/dist/components/react/post-collapsible-trigger.js +1 -1
  158. package/dist/components/react/post-collapsible.js +1 -1
  159. package/dist/components/react/post-date-picker.js +1 -1
  160. package/dist/components/react/post-footer.js +1 -1
  161. package/dist/components/react/post-header.js +1 -1
  162. package/dist/components/react/post-icon.js +1 -1
  163. package/dist/components/react/post-language-menu-item.js +1 -1
  164. package/dist/components/react/post-language-menu.js +1 -1
  165. package/dist/components/react/post-linkarea.js +1 -1
  166. package/dist/components/react/post-listbox-option.js +1 -1
  167. package/dist/components/react/post-listbox.js +1 -1
  168. package/dist/components/react/post-logo.js +1 -1
  169. package/dist/components/react/post-mainnavigation.js +1 -1
  170. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  171. package/dist/components/react/post-megadropdown.js +1 -1
  172. package/dist/components/react/post-menu-item.js +1 -1
  173. package/dist/components/react/post-menu-trigger.js +1 -1
  174. package/dist/components/react/post-menu.js +1 -1
  175. package/dist/components/react/post-number-input.js +1 -1
  176. package/dist/components/react/post-pagination.js +1 -1
  177. package/dist/components/react/post-popover-trigger.js +1 -1
  178. package/dist/components/react/post-popover.js +1 -1
  179. package/dist/components/react/post-popovercontainer.js +1 -1
  180. package/dist/components/react/post-progressbar.js +1 -1
  181. package/dist/components/react/post-rating.js +1 -1
  182. package/dist/components/react/post-side-navigation-trigger.js +1 -1
  183. package/dist/components/react/post-side-navigation.js +1 -1
  184. package/dist/components/react/post-stepper-item.js +1 -1
  185. package/dist/components/react/post-stepper.js +1 -1
  186. package/dist/components/react/post-tab-item.js +1 -1
  187. package/dist/components/react/post-tab-panel.js +1 -1
  188. package/dist/components/react/post-tabs.js +1 -1
  189. package/dist/components/react/post-togglebutton.js +1 -1
  190. package/dist/components/react/post-tooltip-trigger.js +1 -1
  191. package/dist/components/react/post-tooltip.js +1 -1
  192. package/dist/docs.json +287 -473
  193. package/dist/esm/{create-validator-decorator-BNkS_yAb.js → create-validator-decorator-CYYTw0AS.js} +1 -1
  194. package/dist/esm/{index-BGeKgZqi.js → index-DE1aWdqx.js} +11 -15
  195. package/dist/esm/loader.js +3 -3
  196. package/dist/esm/{one-of-4BD_5pKR.js → one-of-Ug1_Xoes.js} +1 -1
  197. package/dist/esm/package-SEWFpJgA.js +3 -0
  198. package/dist/esm/{pattern-D7tnGo1u.js → pattern-WLk4tOqI.js} +1 -1
  199. package/dist/esm/post-accordion_2.entry.js +10 -12
  200. package/dist/esm/post-autocomplete.entry.js +6 -6
  201. package/dist/esm/post-avatar.entry.js +7 -7
  202. package/dist/esm/post-back-to-top.entry.js +6 -6
  203. package/dist/esm/post-banner.entry.js +5 -5
  204. package/dist/esm/post-breadcrumb-item.entry.js +7 -7
  205. package/dist/esm/post-breadcrumbs.entry.js +7 -7
  206. package/dist/esm/post-closebutton_14.entry.js +41 -35
  207. package/dist/esm/post-collapsible_2.entry.js +6 -6
  208. package/dist/esm/post-components.js +3 -3
  209. package/dist/esm/post-date-picker.entry.js +427 -257
  210. package/dist/esm/post-footer.entry.js +6 -6
  211. package/dist/esm/post-linkarea.entry.js +3 -3
  212. package/dist/esm/post-listbox-option.entry.js +4 -4
  213. package/dist/esm/post-listbox.entry.js +3 -3
  214. package/dist/esm/post-number-input.entry.js +5 -4
  215. package/dist/esm/post-pagination.entry.js +5 -5
  216. package/dist/esm/post-popover-trigger.entry.js +5 -5
  217. package/dist/esm/post-popover.entry.js +11 -12
  218. package/dist/esm/post-progressbar.entry.js +4 -4
  219. package/dist/esm/post-rating.entry.js +6 -6
  220. package/dist/esm/post-side-navigation-trigger.entry.js +7 -7
  221. package/dist/esm/post-side-navigation.entry.js +18 -7
  222. package/dist/esm/post-stepper-item.entry.js +3 -3
  223. package/dist/esm/post-stepper.entry.js +7 -7
  224. package/dist/esm/post-tab-item.entry.js +15 -14
  225. package/dist/esm/post-tab-panel.entry.js +6 -6
  226. package/dist/esm/post-tabs.entry.js +196 -74
  227. package/dist/esm/post-tooltip-trigger.entry.js +7 -9
  228. package/dist/esm/post-tooltip.entry.js +9 -10
  229. package/dist/esm/{required-DhBxDSbP.js → required-DeOhRbtk.js} +1 -1
  230. package/dist/esm/{type-icZlikjf.js → type-S-4aPMGU.js} +1 -1
  231. package/dist/esm/{url-B_2x2YCy.js → url-C8KSrmWc.js} +1 -1
  232. package/dist/post-components/{p-aff9dd5e.entry.js → p-01b5539a.entry.js} +1 -1
  233. package/dist/post-components/{p-0a08ae23.entry.js → p-04e29502.entry.js} +1 -1
  234. package/dist/post-components/p-0b7f4169.entry.js +1 -0
  235. package/dist/post-components/p-13e1fdbd.entry.js +1 -0
  236. package/dist/post-components/{p-84c8d952.entry.js → p-1edcfc9e.entry.js} +1 -1
  237. package/dist/post-components/{p-15fa7e60.entry.js → p-21c83ccd.entry.js} +1 -1
  238. package/dist/post-components/{p-9ec32e7b.entry.js → p-261e2ffa.entry.js} +1 -1
  239. package/dist/post-components/{p-fac58cbd.entry.js → p-360d6bf1.entry.js} +1 -1
  240. package/dist/post-components/{p-D2ex14Ye.js → p-4-_BhJWV.js} +1 -1
  241. package/dist/post-components/{p-eca119d2.entry.js → p-44461143.entry.js} +1 -1
  242. package/dist/post-components/p-52e7344c.entry.js +1 -0
  243. package/dist/post-components/p-6d4be9dd.entry.js +1 -0
  244. package/dist/post-components/p-6dbe7870.entry.js +1 -0
  245. package/dist/post-components/{p-97c1f070.entry.js → p-751a949d.entry.js} +1 -1
  246. package/dist/post-components/{p-e54a6be0.entry.js → p-8e2427d4.entry.js} +1 -1
  247. package/dist/post-components/{p-3e83aa1f.entry.js → p-8fbbc68f.entry.js} +1 -1
  248. package/dist/post-components/{p-41b5dbfc.entry.js → p-91948813.entry.js} +1 -1
  249. package/dist/post-components/p-94064d19.entry.js +1 -0
  250. package/dist/post-components/{p-6cbb2e7f.entry.js → p-95ad4d06.entry.js} +1 -1
  251. package/dist/post-components/p-978e4664.entry.js +1 -0
  252. package/dist/post-components/p-B6uZASBE.js +1 -0
  253. package/dist/post-components/{p-CIbyqT6u.js → p-BDW1XHCO.js} +1 -1
  254. package/dist/post-components/p-CiOyV6Mo.js +1 -0
  255. package/dist/post-components/p-DE1aWdqx.js +2 -0
  256. package/dist/post-components/{p-8SvFxSp6.js → p-DMiERazc.js} +1 -1
  257. package/dist/post-components/{p-DH5JdN6V.js → p-NPUljV0P.js} +1 -1
  258. package/dist/post-components/p-SEWFpJgA.js +1 -0
  259. package/dist/post-components/{p-923439d1.entry.js → p-b7d6c951.entry.js} +1 -1
  260. package/dist/post-components/p-c152efb7.entry.js +1 -0
  261. package/dist/post-components/p-c9461efa.entry.js +1 -0
  262. package/dist/post-components/p-ddc585e6.entry.js +1 -0
  263. package/dist/post-components/{p-7ee4b829.entry.js → p-e5172886.entry.js} +1 -1
  264. package/dist/post-components/{p-9e240299.entry.js → p-e9484492.entry.js} +1 -1
  265. package/dist/post-components/p-ee1309c9.entry.js +1 -0
  266. package/dist/post-components/p-f1602e56.entry.js +1 -0
  267. package/dist/post-components/{p-5d20cbcb.entry.js → p-f1bf80d4.entry.js} +1 -1
  268. package/dist/post-components/p-fedcbf2d.entry.js +1 -0
  269. package/dist/post-components/post-components.css +2 -2
  270. package/dist/post-components/post-components.esm.js +1 -1
  271. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +0 -8
  272. package/dist/types/components/post-date-picker/accessibility-utils.d.ts +19 -0
  273. package/dist/types/components/post-date-picker/date-utils.d.ts +48 -0
  274. package/dist/types/components/post-date-picker/native-mask-element.d.ts +12 -0
  275. package/dist/types/components/post-date-picker/post-date-picker.d.ts +23 -62
  276. package/dist/types/components/post-header/post-header.d.ts +2 -1
  277. package/dist/types/components/post-language-menu/post-language-menu.d.ts +2 -1
  278. package/dist/types/components/post-menu/post-menu.d.ts +4 -4
  279. package/dist/types/components/post-popover/post-popover.d.ts +4 -5
  280. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +2 -2
  281. package/dist/types/components/post-side-navigation/post-side-navigation.d.ts +6 -0
  282. package/dist/types/components/post-side-navigation/side-navigation-styles.d.ts +2 -0
  283. package/dist/types/components/post-tab-item/post-tab-item.d.ts +8 -4
  284. package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +1 -1
  285. package/dist/types/components/post-tabs/post-tabs.d.ts +37 -17
  286. package/dist/types/components/post-tooltip/post-tooltip.d.ts +4 -5
  287. package/dist/types/components.d.ts +90 -164
  288. package/dist/types/types/element-api.d.ts +3 -0
  289. package/hydrate/index.js +812 -596
  290. package/hydrate/index.mjs +812 -596
  291. package/package.json +11 -12
  292. package/dist/cjs/long-press-event-Dx21Ojod.js +0 -276
  293. package/dist/cjs/post-login-widget.cjs.entry.js +0 -92
  294. package/dist/collection/components/post-accordion-item/heading-levels.js +0 -1
  295. package/dist/collection/components/post-login-widget/post-login-widget.css +0 -1
  296. package/dist/collection/components/post-login-widget/post-login-widget.js +0 -218
  297. package/dist/collection/components/post-tab-item/post-tab-item.css +0 -1
  298. package/dist/components/long-press-event.js +0 -8
  299. package/dist/components/post-avatar2.js +0 -1
  300. package/dist/components/post-login-widget.d.ts +0 -11
  301. package/dist/components/post-login-widget.js +0 -1
  302. package/dist/components/react/p-BNgqqRsB.js +0 -8
  303. package/dist/components/react/p-C7aYEQh5.js +0 -1
  304. package/dist/components/react/p-CdhbouMD.js +0 -1
  305. package/dist/components/react/p-Ci08Eesw.js +0 -1
  306. package/dist/components/react/p-DWlDkwjY.js +0 -1
  307. package/dist/components/react/p-wqJxIo5L.js +0 -1
  308. package/dist/components/react/post-login-widget.d.ts +0 -11
  309. package/dist/components/react/post-login-widget.js +0 -1
  310. package/dist/esm/long-press-event-BNgqqRsB.js +0 -274
  311. package/dist/esm/package-CdhbouMD.js +0 -3
  312. package/dist/esm/post-login-widget.entry.js +0 -90
  313. package/dist/post-components/p-001f58d8.entry.js +0 -1
  314. package/dist/post-components/p-12c8b073.entry.js +0 -1
  315. package/dist/post-components/p-1839276a.entry.js +0 -1
  316. package/dist/post-components/p-28eeb5d8.entry.js +0 -1
  317. package/dist/post-components/p-6a1c4897.entry.js +0 -1
  318. package/dist/post-components/p-6d14f78a.entry.js +0 -1
  319. package/dist/post-components/p-6e8b6249.entry.js +0 -1
  320. package/dist/post-components/p-71918d59.entry.js +0 -1
  321. package/dist/post-components/p-8139b0cc.entry.js +0 -1
  322. package/dist/post-components/p-87ebb213.entry.js +0 -1
  323. package/dist/post-components/p-89da6378.entry.js +0 -1
  324. package/dist/post-components/p-8caaa149.entry.js +0 -1
  325. package/dist/post-components/p-BGeKgZqi.js +0 -2
  326. package/dist/post-components/p-BNgqqRsB.js +0 -8
  327. package/dist/post-components/p-CdhbouMD.js +0 -1
  328. package/dist/post-components/p-DiBqDD4N.js +0 -1
  329. package/dist/post-components/p-I6rSjhbA.js +0 -1
  330. package/dist/post-components/p-c905a97c.entry.js +0 -1
  331. package/dist/post-components/p-f9529d40.entry.js +0 -1
  332. package/dist/types/components/post-accordion-item/heading-levels.d.ts +0 -2
  333. package/dist/types/components/post-login-widget/post-login-widget.d.ts +0 -45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-components",
3
- "version": "10.0.0-next.75",
3
+ "version": "10.0.0",
4
4
  "description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
5
5
  "author": "Swiss Post <design-system@post.ch>",
6
6
  "license": "Apache-2.0",
@@ -22,9 +22,9 @@
22
22
  "hydrate/"
23
23
  ],
24
24
  "sideEffects": [
25
- "./dist/esm/post-components.js",
25
+ "./dist/esm/*.js",
26
26
  "./dist/cjs/post-components.cjs.js",
27
- "./dist/components/index.js",
27
+ "./dist/components/*.js",
28
28
  "./dist/loader/index.js",
29
29
  "./dist/loader/index.cjs.js",
30
30
  "./cypress/**",
@@ -80,12 +80,11 @@
80
80
  "@floating-ui/dom": "1.7.6",
81
81
  "@oddbird/popover-polyfill": "0.6.0",
82
82
  "@stencil/core": "4.43.3",
83
- "@swisspost/design-system-icons": "10.0.0-next.75",
84
- "@swisspost/design-system-styles": "10.0.0-next.75",
83
+ "@swisspost/design-system-icons": "10.0.0",
84
+ "@swisspost/design-system-styles": "10.0.0",
85
85
  "air-datepicker": "3.6.0",
86
86
  "ally.js": "1.4.1",
87
- "imask": "7.6.1",
88
- "long-press-event": "2.5.2"
87
+ "imask": "7.6.1"
89
88
  },
90
89
  "devDependencies": {
91
90
  "@eslint/compat": "1.2.5",
@@ -97,7 +96,7 @@
97
96
  "@stencil/angular-output-target": "1.1.1",
98
97
  "@stencil/react-output-target": "1.2.0",
99
98
  "@stencil/sass": "3.0.12",
100
- "@swisspost/design-system-eslint": "10.0.0-next.75",
99
+ "@swisspost/design-system-eslint": "10.0.0",
101
100
  "@types/jest": "29.5.14",
102
101
  "@types/node": "24.0.0",
103
102
  "@typescript-eslint/parser": "7.18.0",
@@ -121,8 +120,8 @@
121
120
  "throttle-debounce": "5.0.2",
122
121
  "ts-jest": "29.4.9",
123
122
  "ts-node": "10.9.2",
124
- "typescript": "5.9.3",
125
- "typescript-eslint": "8.59.2"
123
+ "typescript": "6.0.3",
124
+ "typescript-eslint": "8.62.0"
126
125
  },
127
126
  "keywords": [
128
127
  "components",
@@ -138,7 +137,7 @@
138
137
  "prebuild": "pnpm clean && pnpm prebuild:script",
139
138
  "build": "stencil build --docs-readme",
140
139
  "postbuild": "pnpm copy:hydrate-stub & pnpm copy:component-names & pnpm copy:styles:components-react & pnpm copy:styles:components-angular",
141
- "clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated src/_generated ../components-react/**/stencil-generated/ ../components-angular/projects/components/src/lib/stencil-generated/",
140
+ "clean": "rimraf --glob dist hydrate loader loaders www src/styles/generated src/_generated ../components-react/**/stencil-generated/ ../components-angular/**/stencil-generated/",
142
141
  "unit": "stencil test --spec",
143
142
  "unit:watch": "stencil test --spec --watchAll --silent",
144
143
  "unit:updatesnapshot": "stencil test --spec --updateSnapshot",
@@ -158,6 +157,6 @@
158
157
  "copy:hydrate-stub": "copyfiles -f src/hydrate-stub/* hydrate/",
159
158
  "copy:component-names": "copyfiles -f src/_generated/component-names.json dist/",
160
159
  "copy:styles:components-react": "copyfiles -f www/build/post-components.css ../components-react/src/stencil-generated/",
161
- "copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/projects/components/src/lib/stencil-generated/"
160
+ "copy:styles:components-angular": "copyfiles -f www/build/post-components.css ../components-angular/src/stencil-generated/"
162
161
  }
163
162
  }
@@ -1,276 +0,0 @@
1
- 'use strict';
2
-
3
- /*!
4
- * long-press-event - v@version@
5
- * Pure JavaScript long-press-event
6
- * https://github.com/john-doherty/long-press-event
7
- * @author John Doherty <www.johndoherty.info>
8
- * @license MIT
9
- */
10
- (function (window, document) {
11
-
12
- // local timer object based on rAF
13
- var timer = null;
14
-
15
- // check if we're using a touch screen
16
- var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
17
- var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
18
-
19
- // switch to pointer events or touch events if using a touch screen
20
- var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
21
- var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
22
- var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
23
- var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
24
-
25
- // track number of pixels the mouse moves during long press
26
- var startX = 0; // mouse x position when timer started
27
- var startY = 0; // mouse y position when timer started
28
- var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
29
- var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
30
-
31
- // patch CustomEvent to allow constructor creation (IE/Chrome)
32
- if (typeof window.CustomEvent !== 'function') {
33
-
34
- window.CustomEvent = function (event, params) {
35
-
36
- params = params || { bubbles: false, cancelable: false, detail: undefined };
37
-
38
- var evt = document.createEvent('CustomEvent');
39
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
40
- return evt;
41
- };
42
-
43
- window.CustomEvent.prototype = window.Event.prototype;
44
- }
45
-
46
- // requestAnimationFrame() shim by Paul Irish
47
- window.requestAnimFrame = (function () {
48
- return window.requestAnimationFrame ||
49
- window.webkitRequestAnimationFrame ||
50
- window.mozRequestAnimationFrame ||
51
- window.oRequestAnimationFrame ||
52
- window.msRequestAnimationFrame || function (callback) {
53
- window.setTimeout(callback, 1000 / 60);
54
- };
55
- })();
56
-
57
- /**
58
- * Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
59
- * @param {function} fn The callback function
60
- * @param {int} delay The delay in milliseconds
61
- * @returns {object} handle to the timeout object
62
- */
63
- function requestTimeout(fn, delay) {
64
-
65
- if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
66
- !(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
67
- !window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
68
-
69
- var start = new Date().getTime();
70
- var handle = {};
71
-
72
- var loop = function () {
73
- var current = new Date().getTime();
74
- var delta = current - start;
75
-
76
- if (delta >= delay) {
77
- fn.call();
78
- }
79
- else {
80
- handle.value = requestAnimFrame(loop);
81
- }
82
- };
83
-
84
- handle.value = requestAnimFrame(loop);
85
-
86
- return handle;
87
- }
88
-
89
- /**
90
- * Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
91
- * @param {object} handle The callback function
92
- * @returns {void}
93
- */
94
- function clearRequestTimeout(handle) {
95
- if (handle) {
96
- window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
97
- window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
98
- window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
99
- window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
100
- window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
101
- window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
102
- clearTimeout(handle);
103
- }
104
- }
105
-
106
- /**
107
- * Fires the 'long-press' event on element
108
- * @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
109
- * @returns {void}
110
- */
111
- function fireLongPressEvent(originalEvent) {
112
-
113
- clearLongPressTimer();
114
-
115
- originalEvent = unifyEvent(originalEvent);
116
-
117
- // fire the long-press event
118
- var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
119
- bubbles: true,
120
- cancelable: true,
121
-
122
- // custom event data (legacy)
123
- detail: {
124
- clientX: originalEvent.clientX,
125
- clientY: originalEvent.clientY,
126
- offsetX: originalEvent.offsetX,
127
- offsetY: originalEvent.offsetY,
128
- pageX: originalEvent.pageX,
129
- pageY: originalEvent.pageY
130
- },
131
-
132
- // add coordinate data that would typically acompany a touch/click event
133
- clientX: originalEvent.clientX,
134
- clientY: originalEvent.clientY,
135
- offsetX: originalEvent.offsetX,
136
- offsetY: originalEvent.offsetY,
137
- pageX: originalEvent.pageX,
138
- pageY: originalEvent.pageY,
139
- screenX: originalEvent.screenX,
140
- screenY: originalEvent.screenY
141
- }));
142
-
143
- if (!allowClickEvent) {
144
- // suppress the next click event if e.preventDefault() was called in long-press handler
145
- document.addEventListener('click', function suppressEvent(e) {
146
- document.removeEventListener('click', suppressEvent, true);
147
- cancelEvent(e);
148
- }, true);
149
- }
150
- }
151
-
152
- /**
153
- * consolidates mouse, touch, and Pointer events
154
- * @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
155
- * @returns {MouseEvent|PointerEvent|Touch}
156
- */
157
- function unifyEvent(e) {
158
- if (e.changedTouches !== undefined) {
159
- return e.changedTouches[0];
160
- }
161
- return e;
162
- }
163
-
164
- /**
165
- * method responsible for starting the long press timer
166
- * @param {event} e - event object
167
- * @returns {void}
168
- */
169
- function startLongPressTimer(e) {
170
-
171
- clearLongPressTimer();
172
-
173
- var el = e.target;
174
-
175
- // get delay from html attribute if it exists, otherwise default to 1500
176
- var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
177
-
178
- // start the timer
179
- timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
180
- }
181
-
182
- /**
183
- * method responsible for clearing a pending long press timer
184
- * @param {event} e - event object
185
- * @returns {void}
186
- */
187
- function clearLongPressTimer(e) {
188
- clearRequestTimeout(timer);
189
- timer = null;
190
- }
191
-
192
- /**
193
- * Cancels the current event
194
- * @param {object} e - browser event object
195
- * @returns {void}
196
- */
197
- function cancelEvent(e) {
198
- e.stopImmediatePropagation();
199
- e.preventDefault();
200
- e.stopPropagation();
201
- }
202
-
203
- /**
204
- * Starts the timer on mouse down and logs current position
205
- * @param {object} e - browser event object
206
- * @returns {void}
207
- */
208
- function mouseDownHandler(e) {
209
- startX = e.clientX;
210
- startY = e.clientY;
211
- startLongPressTimer(e);
212
- }
213
-
214
- /**
215
- * If the mouse moves n pixels during long-press, cancel the timer
216
- * @param {object} e - browser event object
217
- * @returns {void}
218
- */
219
- function mouseMoveHandler(e) {
220
-
221
- // calculate total number of pixels the pointer has moved
222
- var diffX = Math.abs(startX - e.clientX);
223
- var diffY = Math.abs(startY - e.clientY);
224
-
225
- // if pointer has moved more than allowed, cancel the long-press timer and therefore the event
226
- if (diffX >= maxDiffX || diffY >= maxDiffY) {
227
- clearLongPressTimer();
228
- }
229
- }
230
-
231
- /**
232
- * Gets attribute off HTML element or nearest parent
233
- * @param {object} el - HTML element to retrieve attribute from
234
- * @param {string} attributeName - name of the attribute
235
- * @param {any} defaultValue - default value to return if no match found
236
- * @returns {any} attribute value or defaultValue
237
- */
238
- function getNearestAttribute(el, attributeName, defaultValue) {
239
-
240
- // walk up the dom tree looking for data-action and data-trigger
241
- while (el && el !== document.documentElement) {
242
-
243
- var attributeValue = el.getAttribute(attributeName);
244
-
245
- if (attributeValue) {
246
- return attributeValue;
247
- }
248
-
249
- el = el.parentNode;
250
- }
251
-
252
- return defaultValue;
253
- }
254
-
255
- // hook events that clear a pending long press event
256
- document.addEventListener(mouseUp, clearLongPressTimer, true);
257
- document.addEventListener(mouseLeave, clearLongPressTimer, true);
258
- document.addEventListener(mouseMove, mouseMoveHandler, true);
259
- document.addEventListener('wheel', clearLongPressTimer, true);
260
- document.addEventListener('scroll', clearLongPressTimer, true);
261
- document.addEventListener('contextmenu', function(e) {
262
-
263
- // on touch devices, prevent the native context menu and keep the long-press timer running
264
- if (isTouch) {
265
- e.preventDefault();
266
- return;
267
- }
268
-
269
- // on non-touch devices, clear timer
270
- clearLongPressTimer();
271
- }, true);
272
-
273
- // hook events that can trigger a long press event
274
- document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
275
-
276
- }(window, document));
@@ -1,92 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-CyeY2muT.js');
4
- require('./breakpoints-B0Olgvgc.js');
5
- var _package = require('./package-JSyXVavg.js');
6
- var required = require('./required-BsZuSJAl.js');
7
- var type = require('./type-DXpEWY0w.js');
8
- require('./create-validator-decorator-Bimhl6Ib.js');
9
-
10
- const postLoginWidgetCss = () => `:host post-menu-trigger button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-1);gap:var(--post-device-spacing-gap-inline-10);padding:0 var(--post-device-spacing-padding-inline-6)}:host post-menu-trigger button:not(:disabled):hover{text-decoration:none}:host post-menu-trigger button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}:host post-menu-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(a){color:LinkText;border:unset}:host post-menu-trigger button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host post-menu-trigger button>post-icon{width:var(--post-device-sizing-interactive-button-icon-4);height:var(--post-device-sizing-interactive-button-icon-4)}:host post-menu-trigger button{border-radius:var(--post-device-border-radius-round) !important;border:0 none;min-height:0;padding:0}:host post-menu-trigger .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
11
-
12
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
13
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
14
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
15
- r = Reflect.decorate(decorators, target, key, desc);
16
- else
17
- for (var i = decorators.length - 1; i >= 0; i--)
18
- if (d = decorators[i])
19
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21
- };
22
- const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
23
- const PostLoginWidget = class {
24
- constructor(hostRef) {
25
- index.registerInstance(this, hostRef);
26
- this.postChange = index.createEvent(this, "postChange");
27
- this.authenticated = null;
28
- this.user = null;
29
- }
30
- async componentWillLoad() {
31
- {
32
- await this.fetchAuthState();
33
- }
34
- }
35
- /**
36
- * Returns the current authentication state:
37
- * `null` when the component is still loading, `true` when authenticated, `false` when not.
38
- */
39
- async isAuthenticated() {
40
- return this.authenticated;
41
- }
42
- /**
43
- * Re-fetches the authentication state from the session API and updates
44
- * the component rendering accordingly.
45
- */
46
- async refresh() {
47
- await this.fetchAuthState();
48
- }
49
- async fetchAuthState() {
50
- try {
51
- const response = await fetch(SESSION_URL, {
52
- credentials: 'include',
53
- });
54
- if (!response.ok) {
55
- this.setAuthState(false);
56
- return;
57
- }
58
- const json = await response.json();
59
- const isAuthenticated = json?.data?.email !== undefined;
60
- this.user = json?.data;
61
- this.setAuthState(isAuthenticated);
62
- }
63
- catch {
64
- this.setAuthState(false);
65
- }
66
- }
67
- setAuthState(next) {
68
- if (this.authenticated === next)
69
- return;
70
- this.authenticated = next;
71
- this.postChange.emit({ authenticated: next });
72
- }
73
- render() {
74
- return (index.h(index.Host, { key: '74d00f53d1de12c739242183cb4551fe5127eb29', "data-version": _package.version }, this.authenticated === true ? (index.h("div", null, index.h("post-menu-trigger", { for: "user-menu-default" }, index.h("button", { class: "btn btn-link", type: "button" }, index.h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, description: this.textCurrentUser.replace('{user}', `${this.user.name} ${this.user.surname}`) }), index.h("span", { class: "visually-hidden" }, this.textUserMenuTrigger))), index.h("post-menu", { label: this.textUserMenu, id: "user-menu-default" }, index.h("div", { slot: "header" }, index.h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, email: this.user.email, "aria-hidden": "true" }), this.user.name, " ", this.user.surname), index.h("slot", { name: "user-links" })))) : (index.h("div", null, index.h("slot", { name: "login-link" })))));
75
- }
76
- get host() { return index.getElement(this); }
77
- };
78
- __decorate([
79
- required.Required(),
80
- type.Type('string')
81
- ], PostLoginWidget.prototype, "textCurrentUser", void 0);
82
- __decorate([
83
- required.Required(),
84
- type.Type('string')
85
- ], PostLoginWidget.prototype, "textUserMenu", void 0);
86
- __decorate([
87
- required.Required(),
88
- type.Type('string')
89
- ], PostLoginWidget.prototype, "textUserMenuTrigger", void 0);
90
- PostLoginWidget.style = postLoginWidgetCss();
91
-
92
- exports.post_login_widget = PostLoginWidget;
@@ -1 +0,0 @@
1
- export const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
@@ -1 +0,0 @@
1
- :host post-menu-trigger button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-1);gap:var(--post-device-spacing-gap-inline-10);padding:0 var(--post-device-spacing-padding-inline-6)}:host post-menu-trigger button:not(:disabled):hover{text-decoration:none}:host post-menu-trigger button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}:host post-menu-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host post-menu-trigger button:is(a){color:LinkText;border:unset}:host post-menu-trigger button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host post-menu-trigger button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host post-menu-trigger button>post-icon{width:var(--post-device-sizing-interactive-button-icon-4);height:var(--post-device-sizing-interactive-button-icon-4)}:host post-menu-trigger button{border-radius:var(--post-device-border-radius-round) !important;border:0 none;min-height:0;padding:0}:host post-menu-trigger .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@@ -1,218 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
4
- r = Reflect.decorate(decorators, target, key, desc);
5
- else
6
- for (var i = decorators.length - 1; i >= 0; i--)
7
- if (d = decorators[i])
8
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9
- return c > 3 && r && Object.defineProperty(target, key, r), r;
10
- };
11
- import { Required, Type } from "../../utils/index";
12
- import { version } from "../../../../package";
13
- import { Build, h, Host, } from "@stencil/core";
14
- const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
15
- /**
16
- * @slot user-links - Links to show in the user menu when the user is authenticated.
17
- * @slot login-link - Content rendered when the user is not authenticated.
18
- */
19
- export class PostLoginWidget {
20
- constructor() {
21
- this.authenticated = null;
22
- this.user = null;
23
- }
24
- async componentWillLoad() {
25
- if (Build.isBrowser) {
26
- await this.fetchAuthState();
27
- }
28
- }
29
- /**
30
- * Returns the current authentication state:
31
- * `null` when the component is still loading, `true` when authenticated, `false` when not.
32
- */
33
- async isAuthenticated() {
34
- return this.authenticated;
35
- }
36
- /**
37
- * Re-fetches the authentication state from the session API and updates
38
- * the component rendering accordingly.
39
- */
40
- async refresh() {
41
- await this.fetchAuthState();
42
- }
43
- async fetchAuthState() {
44
- try {
45
- const response = await fetch(SESSION_URL, {
46
- credentials: 'include',
47
- });
48
- if (!response.ok) {
49
- this.setAuthState(false);
50
- return;
51
- }
52
- const json = await response.json();
53
- const isAuthenticated = json?.data?.email !== undefined;
54
- this.user = json?.data;
55
- this.setAuthState(isAuthenticated);
56
- }
57
- catch {
58
- this.setAuthState(false);
59
- }
60
- }
61
- setAuthState(next) {
62
- if (this.authenticated === next)
63
- return;
64
- this.authenticated = next;
65
- this.postChange.emit({ authenticated: next });
66
- }
67
- render() {
68
- return (h(Host, { key: '74d00f53d1de12c739242183cb4551fe5127eb29', "data-version": version }, this.authenticated === true ? (h("div", null, h("post-menu-trigger", { for: "user-menu-default" }, h("button", { class: "btn btn-link", type: "button" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, description: this.textCurrentUser.replace('{user}', `${this.user.name} ${this.user.surname}`) }), h("span", { class: "visually-hidden" }, this.textUserMenuTrigger))), h("post-menu", { label: this.textUserMenu, id: "user-menu-default" }, h("div", { slot: "header" }, h("post-avatar", { firstname: this.user.name, lastname: this.user.surname, email: this.user.email, "aria-hidden": "true" }), this.user.name, " ", this.user.surname), h("slot", { name: "user-links" })))) : (h("div", null, h("slot", { name: "login-link" })))));
69
- }
70
- static get is() { return "post-login-widget"; }
71
- static get encapsulation() { return "shadow"; }
72
- static get originalStyleUrls() {
73
- return {
74
- "$": ["post-login-widget.scss"]
75
- };
76
- }
77
- static get styleUrls() {
78
- return {
79
- "$": ["post-login-widget.css"]
80
- };
81
- }
82
- static get properties() {
83
- return {
84
- "textCurrentUser": {
85
- "type": "string",
86
- "mutable": false,
87
- "complexType": {
88
- "original": "string",
89
- "resolved": "string",
90
- "references": {}
91
- },
92
- "required": true,
93
- "optional": false,
94
- "docs": {
95
- "tags": [],
96
- "text": "Label for the \"Current user is {user}\" accessibility description.\nUse `{user}` as a placeholder \u2014 it will be replaced with the current user's name at runtime."
97
- },
98
- "getter": false,
99
- "setter": false,
100
- "reflect": true,
101
- "attribute": "text-current-user"
102
- },
103
- "textUserMenu": {
104
- "type": "string",
105
- "mutable": false,
106
- "complexType": {
107
- "original": "string",
108
- "resolved": "string",
109
- "references": {}
110
- },
111
- "required": true,
112
- "optional": false,
113
- "docs": {
114
- "tags": [],
115
- "text": "Accessible label for the dropdown menu"
116
- },
117
- "getter": false,
118
- "setter": false,
119
- "reflect": true,
120
- "attribute": "text-user-menu"
121
- },
122
- "textUserMenuTrigger": {
123
- "type": "string",
124
- "mutable": false,
125
- "complexType": {
126
- "original": "string",
127
- "resolved": "string",
128
- "references": {}
129
- },
130
- "required": true,
131
- "optional": false,
132
- "docs": {
133
- "tags": [],
134
- "text": "Hidden label for the user menu trigger button, for accessibility purposes. It should describe the purpose of the button (e.g. \"Access user links\")."
135
- },
136
- "getter": false,
137
- "setter": false,
138
- "reflect": true,
139
- "attribute": "text-user-menu-trigger"
140
- }
141
- };
142
- }
143
- static get states() {
144
- return {
145
- "authenticated": {},
146
- "user": {}
147
- };
148
- }
149
- static get events() {
150
- return [{
151
- "method": "postChange",
152
- "name": "postChange",
153
- "bubbles": true,
154
- "cancelable": true,
155
- "composed": true,
156
- "docs": {
157
- "tags": [],
158
- "text": "Emitted when the authentication state changes.\nThe event payload is an object with an `authenticated` property:\n`true` when the user is logged in, `false` when the user is not logged in or the API request failed."
159
- },
160
- "complexType": {
161
- "original": "{ authenticated: boolean }",
162
- "resolved": "{ authenticated: boolean; }",
163
- "references": {}
164
- }
165
- }];
166
- }
167
- static get methods() {
168
- return {
169
- "isAuthenticated": {
170
- "complexType": {
171
- "signature": "() => Promise<boolean | null>",
172
- "parameters": [],
173
- "references": {
174
- "Promise": {
175
- "location": "global",
176
- "id": "global::Promise"
177
- }
178
- },
179
- "return": "Promise<boolean>"
180
- },
181
- "docs": {
182
- "text": "Returns the current authentication state:\n`null` when the component is still loading, `true` when authenticated, `false` when not.",
183
- "tags": []
184
- }
185
- },
186
- "refresh": {
187
- "complexType": {
188
- "signature": "() => Promise<void>",
189
- "parameters": [],
190
- "references": {
191
- "Promise": {
192
- "location": "global",
193
- "id": "global::Promise"
194
- }
195
- },
196
- "return": "Promise<void>"
197
- },
198
- "docs": {
199
- "text": "Re-fetches the authentication state from the session API and updates\nthe component rendering accordingly.",
200
- "tags": []
201
- }
202
- }
203
- };
204
- }
205
- static get elementRef() { return "host"; }
206
- }
207
- __decorate([
208
- Required(),
209
- Type('string')
210
- ], PostLoginWidget.prototype, "textCurrentUser", void 0);
211
- __decorate([
212
- Required(),
213
- Type('string')
214
- ], PostLoginWidget.prototype, "textUserMenu", void 0);
215
- __decorate([
216
- Required(),
217
- Type('string')
218
- ], PostLoginWidget.prototype, "textUserMenuTrigger", void 0);