@swisspost/design-system-components 9.0.0-next.1 → 9.0.0-next.10

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 (451) hide show
  1. package/dist/cjs/check-type-64af82a9.js +16 -0
  2. package/dist/cjs/check-url-3ffdd2fb.js +14 -0
  3. package/dist/cjs/debounce-1151afe3.js +12 -0
  4. package/dist/cjs/get-root-7a3498ef.js +11 -0
  5. package/dist/cjs/{index-01f30442.js → index-5d4e0aed.js} +4 -27
  6. package/dist/cjs/{index-c15bd800.js → index-f1b08cdb.js} +45 -16
  7. package/dist/cjs/index.browser-2f65f583.js +15 -0
  8. package/dist/cjs/index.cjs.js +51 -24
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/{package-c7d01968.js → package-aaec3cba.js} +1 -1
  11. package/dist/cjs/{post-accordion-e29956c4.js → post-accordion-85bf5e0a.js} +3 -3
  12. package/dist/cjs/post-accordion-item-957b3464.js +64 -0
  13. package/dist/cjs/post-accordion-item.cjs.entry.js +7 -4
  14. package/dist/cjs/post-accordion.cjs.entry.js +3 -3
  15. package/dist/cjs/post-avatar-58540591.js +148 -0
  16. package/dist/cjs/post-avatar.cjs.entry.js +13 -0
  17. package/dist/cjs/post-back-to-top-db5c7d01.js +75 -0
  18. package/dist/cjs/post-back-to-top.cjs.entry.js +15 -0
  19. package/dist/cjs/post-banner-727866d5.js +91 -0
  20. package/dist/cjs/post-banner.cjs.entry.js +19 -0
  21. package/dist/cjs/post-breadcrumb-cacca682.js +111 -0
  22. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +17 -0
  23. package/dist/cjs/post-breadcrumb.cjs.entry.js +13 -0
  24. package/dist/cjs/post-card-control-f5d72ddc.js +272 -0
  25. package/dist/cjs/post-card-control.cjs.entry.js +3 -3
  26. package/dist/cjs/post-closebutton_15.cjs.entry.js +34 -0
  27. package/dist/cjs/{post-collapsible-trigger-32549d33.js → post-collapsible-trigger-067d1f4c.js} +14 -26
  28. package/dist/cjs/post-collapsible_2.cjs.entry.js +8 -4
  29. package/dist/cjs/post-components.cjs.js +2 -2
  30. package/dist/cjs/post-footer-beeb36c8.js +84 -0
  31. package/dist/cjs/post-footer.cjs.entry.js +11 -0
  32. package/dist/cjs/post-menu-item-e0e214b9.js +69 -0
  33. package/dist/cjs/{post-popover-cfc1b31b.js → post-popover-7acbdf17.js} +4 -4
  34. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  35. package/dist/cjs/{post-rating-b9b8b6f3.js → post-rating-ac1b9b3c.js} +4 -4
  36. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  37. package/dist/cjs/post-tab-header-a3d28719.js +33 -0
  38. package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
  39. package/dist/cjs/{post-tab-panel-300a0618.js → post-tab-panel-4562e265.js} +5 -4
  40. package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
  41. package/dist/cjs/{post-tabs-b06f799b.js → post-tabs-80f65e1d.js} +9 -7
  42. package/dist/cjs/post-tabs.cjs.entry.js +3 -3
  43. package/dist/cjs/post-tag-5741a78d.js +47 -0
  44. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  45. package/dist/cjs/{post-popovercontainer-c0b86b11.js → post-togglebutton-245e33f1.js} +1082 -21
  46. package/dist/cjs/{post-tooltip-8d7e64f6.js → post-tooltip-cefce5e1.js} +31 -19
  47. package/dist/cjs/post-tooltip.cjs.entry.js +6 -4
  48. package/dist/cjs/slide-5d51abe8.js +28 -0
  49. package/dist/collection/animations/slide.js +23 -0
  50. package/dist/collection/collection-manifest.json +21 -3
  51. package/dist/collection/components/post-accordion/post-accordion.css +1 -1
  52. package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
  53. package/dist/collection/components/post-accordion-item/post-accordion-item.js +26 -9
  54. package/dist/collection/components/post-avatar/post-avatar.css +3 -0
  55. package/dist/collection/components/post-avatar/post-avatar.js +237 -0
  56. package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
  57. package/dist/collection/components/post-back-to-top/post-back-to-top.js +107 -0
  58. package/dist/collection/components/post-banner/banner-types.js +1 -0
  59. package/dist/collection/components/post-banner/post-banner.css +3 -0
  60. package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +41 -69
  61. package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +3 -0
  62. package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +161 -0
  63. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
  64. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +93 -0
  65. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  66. package/dist/collection/components/post-card-control/post-card-control.js +8 -8
  67. package/dist/collection/components/post-closebutton/post-closebutton.js +12 -0
  68. package/dist/collection/components/post-collapsible/post-collapsible.js +5 -3
  69. package/dist/collection/components/post-footer/post-footer.css +1 -0
  70. package/dist/collection/components/post-footer/post-footer.js +75 -0
  71. package/dist/collection/components/post-header/post-header.css +1 -0
  72. package/dist/collection/components/post-header/post-header.js +172 -0
  73. package/dist/collection/components/post-icon/post-icon.js +22 -30
  74. package/dist/collection/components/post-language-option/post-language-option.css +3 -0
  75. package/dist/collection/components/post-language-option/post-language-option.js +219 -0
  76. package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
  77. package/dist/collection/components/post-language-switch/post-language-switch.js +163 -0
  78. package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
  79. package/dist/collection/components/post-list/post-list.css +3 -0
  80. package/dist/collection/components/post-list/post-list.js +88 -0
  81. package/dist/collection/components/post-list-item/post-list-item.css +1 -0
  82. package/dist/collection/components/post-list-item/post-list-item.js +25 -0
  83. package/dist/collection/components/post-logo/post-logo.js +2 -2
  84. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
  85. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +52 -0
  86. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
  87. package/dist/collection/components/post-megadropdown/post-megadropdown.js +158 -0
  88. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
  89. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +104 -0
  90. package/dist/collection/components/post-menu/post-menu.css +3 -0
  91. package/dist/collection/components/post-menu/post-menu.js +280 -0
  92. package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
  93. package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
  94. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +114 -0
  95. package/dist/collection/components/post-popover/post-popover.css +1 -1
  96. package/dist/collection/components/post-popover/post-popover.js +1 -1
  97. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  98. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -6
  99. package/dist/collection/components/post-rating/post-rating.css +1 -1
  100. package/dist/collection/components/post-rating/post-rating.js +1 -1
  101. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  102. package/dist/collection/components/post-tab-header/post-tab-header.js +3 -2
  103. package/dist/collection/components/post-tab-panel/post-tab-panel.js +3 -2
  104. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  105. package/dist/collection/components/post-tabs/post-tabs.js +6 -4
  106. package/dist/collection/components/post-tag/post-tag.css +1 -1
  107. package/dist/collection/components/post-tag/post-tag.js +2 -2
  108. package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
  109. package/dist/collection/components/post-togglebutton/post-togglebutton.js +74 -0
  110. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  111. package/dist/collection/components/post-tooltip/post-tooltip.js +28 -12
  112. package/dist/collection/index.js +20 -2
  113. package/dist/collection/utils/breakpoints.js +46 -0
  114. package/dist/collection/utils/get-focusable-children.js +27 -0
  115. package/dist/components/debounce.js +10 -0
  116. package/dist/components/get-root.js +9 -0
  117. package/dist/components/index.browser.js +13 -0
  118. package/dist/components/index.js +20 -2
  119. package/dist/components/index2.js +1 -1
  120. package/dist/components/package.js +1 -1
  121. package/dist/components/post-accordion-item2.js +33 -13
  122. package/dist/components/post-accordion2.js +1 -1
  123. package/dist/components/post-avatar.d.ts +11 -0
  124. package/dist/components/post-avatar.js +6 -0
  125. package/dist/components/post-avatar2.js +173 -0
  126. package/dist/components/post-back-to-top.d.ts +11 -0
  127. package/dist/components/post-back-to-top.js +6 -0
  128. package/dist/components/post-back-to-top2.js +100 -0
  129. package/dist/components/post-banner.d.ts +11 -0
  130. package/dist/components/post-banner.js +6 -0
  131. package/dist/components/post-banner2.js +126 -0
  132. package/dist/components/post-breadcrumb-item.d.ts +11 -0
  133. package/dist/components/post-breadcrumb-item.js +6 -0
  134. package/dist/components/post-breadcrumb-item2.js +82 -0
  135. package/dist/components/post-breadcrumb.d.ts +11 -0
  136. package/dist/components/post-breadcrumb.js +6 -0
  137. package/dist/components/post-breadcrumb2.js +168 -0
  138. package/dist/components/post-card-control2.js +3 -3
  139. package/dist/components/post-closebutton.d.ts +11 -0
  140. package/dist/components/post-closebutton.js +6 -0
  141. package/dist/components/post-closebutton2.js +34 -0
  142. package/dist/components/post-collapsible-trigger2.js +2 -17
  143. package/dist/components/post-collapsible2.js +6 -4
  144. package/dist/components/post-footer.d.ts +11 -0
  145. package/dist/components/post-footer.js +6 -0
  146. package/dist/components/post-footer2.js +124 -0
  147. package/dist/components/post-header.d.ts +11 -0
  148. package/dist/components/post-header.js +6 -0
  149. package/dist/components/post-header2.js +279 -0
  150. package/dist/components/post-icon2.js +24 -28
  151. package/dist/components/post-language-option.d.ts +11 -0
  152. package/dist/components/post-language-option.js +6 -0
  153. package/dist/components/post-language-option2.js +98 -0
  154. package/dist/components/post-language-switch.d.ts +11 -0
  155. package/dist/components/post-language-switch.js +6 -0
  156. package/dist/components/post-language-switch2.js +135 -0
  157. package/dist/components/post-list-item.d.ts +11 -0
  158. package/dist/components/post-list-item.js +6 -0
  159. package/dist/components/post-list-item2.js +35 -0
  160. package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
  161. package/dist/components/post-list.js +6 -0
  162. package/dist/components/post-list2.js +54 -0
  163. package/dist/components/post-logo2.js +2 -2
  164. package/dist/components/post-mainnavigation.d.ts +11 -0
  165. package/dist/components/post-mainnavigation.js +6 -0
  166. package/dist/components/post-mainnavigation2.js +48 -0
  167. package/dist/components/post-megadropdown-trigger.d.ts +11 -0
  168. package/dist/components/post-megadropdown-trigger.js +6 -0
  169. package/dist/components/post-megadropdown-trigger2.js +91 -0
  170. package/dist/components/post-megadropdown.d.ts +11 -0
  171. package/dist/components/post-megadropdown.js +6 -0
  172. package/dist/components/post-megadropdown2.js +100 -0
  173. package/dist/components/post-menu-item.d.ts +11 -0
  174. package/dist/components/post-menu-item.js +6 -0
  175. package/dist/components/post-menu-item2.js +27 -0
  176. package/dist/components/post-menu-trigger.d.ts +11 -0
  177. package/dist/components/post-menu-trigger.js +6 -0
  178. package/dist/components/post-menu-trigger2.js +102 -0
  179. package/dist/components/post-menu.d.ts +11 -0
  180. package/dist/components/post-menu.js +6 -0
  181. package/dist/components/post-menu2.js +204 -0
  182. package/dist/components/post-popover2.js +2 -2
  183. package/dist/components/post-popovercontainer2.js +10 -7
  184. package/dist/components/post-rating2.js +2 -2
  185. package/dist/components/post-tab-header2.js +4 -3
  186. package/dist/components/post-tab-panel2.js +3 -2
  187. package/dist/components/post-tabs2.js +7 -5
  188. package/dist/components/post-tag2.js +2 -2
  189. package/dist/components/post-togglebutton.d.ts +11 -0
  190. package/dist/components/post-togglebutton.js +6 -0
  191. package/dist/components/post-togglebutton2.js +61 -0
  192. package/dist/components/post-tooltip2.js +29 -17
  193. package/dist/components/slide.js +25 -0
  194. package/dist/docs.json +1870 -283
  195. package/dist/esm/check-type-8828dbe4.js +14 -0
  196. package/dist/esm/check-url-a974431e.js +12 -0
  197. package/dist/esm/debounce-abe98cc2.js +10 -0
  198. package/dist/esm/get-root-7af2e0d1.js +9 -0
  199. package/dist/esm/{index-0b56fc28.js → index-6bfe6554.js} +45 -16
  200. package/dist/esm/index-b49c9904.js +24 -0
  201. package/dist/esm/index.browser-51485f85.js +13 -0
  202. package/dist/esm/index.js +28 -19
  203. package/dist/esm/loader.js +3 -3
  204. package/dist/esm/package-2ee42825.js +3 -0
  205. package/dist/esm/{post-accordion-3a7b3f3c.js → post-accordion-3bf30525.js} +3 -3
  206. package/dist/esm/post-accordion-item-6683fbed.js +62 -0
  207. package/dist/esm/post-accordion-item.entry.js +7 -4
  208. package/dist/esm/post-accordion.entry.js +3 -3
  209. package/dist/esm/post-avatar-3ddb4c79.js +146 -0
  210. package/dist/esm/post-avatar.entry.js +5 -0
  211. package/dist/esm/post-back-to-top-15ee2771.js +73 -0
  212. package/dist/esm/post-back-to-top.entry.js +7 -0
  213. package/dist/esm/post-banner-fc407f6e.js +89 -0
  214. package/dist/esm/post-banner.entry.js +11 -0
  215. package/dist/esm/post-breadcrumb-6252b112.js +109 -0
  216. package/dist/esm/post-breadcrumb-item_2.entry.js +8 -0
  217. package/dist/esm/post-breadcrumb.entry.js +5 -0
  218. package/dist/esm/post-card-control-cb3dfc60.js +270 -0
  219. package/dist/esm/post-card-control.entry.js +3 -3
  220. package/dist/esm/post-closebutton_15.entry.js +12 -0
  221. package/dist/esm/{post-collapsible-trigger-8d7e027b.js → post-collapsible-trigger-b727bf7e.js} +11 -23
  222. package/dist/esm/post-collapsible_2.entry.js +8 -4
  223. package/dist/esm/post-components.js +3 -3
  224. package/dist/esm/post-footer-7a03a9bb.js +82 -0
  225. package/dist/esm/post-footer.entry.js +3 -0
  226. package/dist/esm/post-menu-item-3e168ecd.js +66 -0
  227. package/dist/esm/{post-popover-972c5ea7.js → post-popover-bff5cffd.js} +4 -4
  228. package/dist/esm/post-popover.entry.js +3 -3
  229. package/dist/esm/{post-rating-cca784ae.js → post-rating-ce595a65.js} +4 -4
  230. package/dist/esm/post-rating.entry.js +3 -3
  231. package/dist/esm/post-tab-header-c864586f.js +31 -0
  232. package/dist/esm/post-tab-header.entry.js +4 -3
  233. package/dist/esm/{post-tab-panel-633a5e6b.js → post-tab-panel-800425b8.js} +5 -4
  234. package/dist/esm/post-tab-panel.entry.js +4 -3
  235. package/dist/esm/{post-tabs-74ded897.js → post-tabs-e5aa8b08.js} +9 -7
  236. package/dist/esm/post-tabs.entry.js +3 -3
  237. package/dist/esm/post-tag-fc3df50a.js +45 -0
  238. package/dist/esm/post-tag.entry.js +3 -3
  239. package/dist/esm/{post-popovercontainer-2485b7d9.js → post-togglebutton-101dd3bd.js} +1069 -22
  240. package/dist/esm/{post-tooltip-0457467f.js → post-tooltip-e8484aea.js} +31 -19
  241. package/dist/esm/post-tooltip.entry.js +6 -4
  242. package/dist/esm/slide-3422b8a3.js +25 -0
  243. package/dist/post-components/index.esm.js +1 -1
  244. package/dist/post-components/p-02bb5231.js +1 -0
  245. package/dist/post-components/p-0e216cc4.js +2 -0
  246. package/dist/post-components/p-11880d55.js +1 -0
  247. package/dist/post-components/p-1489d777.entry.js +1 -0
  248. package/dist/post-components/p-19707347.entry.js +1 -0
  249. package/dist/post-components/p-1d3acbfd.js +1 -0
  250. package/dist/post-components/p-24476696.js +1 -0
  251. package/dist/post-components/p-25f6efab.entry.js +1 -0
  252. package/dist/post-components/p-27ad2d1f.js +1 -0
  253. package/dist/post-components/p-29626238.entry.js +1 -0
  254. package/dist/post-components/p-339488ba.entry.js +1 -0
  255. package/dist/post-components/p-3de1151e.js +1 -0
  256. package/dist/post-components/p-413d1fff.js +1 -0
  257. package/dist/post-components/p-47095b84.entry.js +1 -0
  258. package/dist/post-components/p-4a3f67ab.js +1 -0
  259. package/dist/post-components/p-515e0f96.js +1 -0
  260. package/dist/post-components/p-5467b223.js +1 -0
  261. package/dist/post-components/p-5959f2bd.js +1 -0
  262. package/dist/post-components/p-5b0703a4.entry.js +1 -0
  263. package/dist/post-components/p-618b8929.js +1 -0
  264. package/dist/post-components/p-66c8d0a2.entry.js +1 -0
  265. package/dist/post-components/p-6e6e5447.entry.js +1 -0
  266. package/dist/post-components/p-80b282a2.js +1 -0
  267. package/dist/post-components/p-86a1ad40.js +1 -0
  268. package/dist/post-components/p-97647d03.entry.js +1 -0
  269. package/dist/post-components/p-98f1d284.js +1 -0
  270. package/dist/post-components/p-9e287cb5.js +1 -0
  271. package/dist/post-components/{p-41094063.js → p-a3694196.js} +1 -1
  272. package/dist/post-components/p-adc79d26.entry.js +1 -0
  273. package/dist/post-components/p-b22656b1.js +1 -0
  274. package/dist/post-components/p-bcf94111.entry.js +1 -0
  275. package/dist/post-components/p-bd87a2b5.entry.js +1 -0
  276. package/dist/post-components/p-bec07e51.js +1 -0
  277. package/dist/post-components/p-bec09df9.entry.js +1 -0
  278. package/dist/post-components/p-d1d9c9a5.js +1 -0
  279. package/dist/post-components/p-d4f93f2b.js +1 -0
  280. package/dist/post-components/p-db2ac0a2.entry.js +1 -0
  281. package/dist/post-components/p-e93a4bd0.entry.js +1 -0
  282. package/dist/post-components/p-eed26f43.js +1 -0
  283. package/dist/post-components/p-f35d5d4a.entry.js +1 -0
  284. package/dist/post-components/p-fa6c79b8.entry.js +1 -0
  285. package/dist/post-components/{p-01a8fe6a.js → p-faf15ec1.js} +3 -3
  286. package/dist/post-components/p-fc09ac69.js +1 -0
  287. package/dist/post-components/p-fc91cbc2.js +1 -0
  288. package/dist/post-components/p-ffcd735f.js +1 -0
  289. package/dist/post-components/post-components.esm.js +1 -1
  290. package/dist/types/animations/slide.d.ts +2 -0
  291. package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +7 -1
  292. package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
  293. package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +19 -0
  294. package/dist/types/components/post-banner/banner-types.d.ts +2 -0
  295. package/dist/types/components/post-banner/post-banner.d.ts +49 -0
  296. package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +30 -0
  297. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +16 -0
  298. package/dist/types/components/post-card-control/post-card-control.d.ts +7 -7
  299. package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
  300. package/dist/types/components/post-footer/post-footer.d.ts +23 -0
  301. package/dist/types/components/post-header/post-header.d.ts +33 -0
  302. package/dist/types/components/post-icon/post-icon.d.ts +3 -6
  303. package/dist/types/components/post-language-option/post-language-option.d.ts +45 -0
  304. package/dist/types/components/post-language-switch/post-language-switch.d.ts +31 -0
  305. package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
  306. package/dist/types/components/post-list/post-list.d.ts +24 -0
  307. package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
  308. package/dist/types/components/post-logo/post-logo.d.ts +1 -1
  309. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +19 -0
  310. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +36 -0
  311. package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +25 -0
  312. package/dist/types/components/post-menu/post-menu.d.ts +48 -0
  313. package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
  314. package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +27 -0
  315. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +4 -0
  316. package/dist/types/components/post-tag/post-tag.d.ts +1 -1
  317. package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
  318. package/dist/types/components.d.ts +570 -44
  319. package/dist/types/index.d.ts +20 -2
  320. package/dist/types/utils/breakpoints.d.ts +11 -0
  321. package/dist/types/utils/get-focusable-children.d.ts +1 -0
  322. package/dist/types/utils/get-root.d.ts +1 -1
  323. package/loaders/debounce.js +10 -0
  324. package/loaders/get-root.js +9 -0
  325. package/loaders/index.browser.js +13 -0
  326. package/loaders/index.d.ts +38 -2
  327. package/loaders/index.js +20 -2
  328. package/loaders/index2.js +1 -1
  329. package/loaders/package.js +1 -1
  330. package/loaders/post-accordion-item.js +1 -81
  331. package/loaders/post-accordion-item2.js +103 -0
  332. package/loaders/post-accordion.js +1 -1
  333. package/loaders/post-avatar.d.ts +11 -0
  334. package/loaders/post-avatar.js +176 -0
  335. package/loaders/post-back-to-top.d.ts +11 -0
  336. package/loaders/post-back-to-top.js +103 -0
  337. package/loaders/post-banner.d.ts +11 -0
  338. package/loaders/post-banner.js +129 -0
  339. package/loaders/post-breadcrumb-item.d.ts +11 -0
  340. package/loaders/post-breadcrumb-item.js +6 -0
  341. package/loaders/post-breadcrumb-item2.js +82 -0
  342. package/loaders/post-breadcrumb.d.ts +11 -0
  343. package/loaders/post-breadcrumb.js +171 -0
  344. package/loaders/post-card-control.js +3 -3
  345. package/loaders/post-closebutton.d.ts +11 -0
  346. package/loaders/post-closebutton.js +37 -0
  347. package/loaders/post-collapsible-trigger2.js +2 -17
  348. package/loaders/post-collapsible2.js +5 -3
  349. package/loaders/post-footer.d.ts +11 -0
  350. package/loaders/post-footer.js +127 -0
  351. package/loaders/post-header.d.ts +11 -0
  352. package/loaders/post-header.js +282 -0
  353. package/loaders/post-icon2.js +24 -28
  354. package/loaders/post-language-option.d.ts +11 -0
  355. package/loaders/post-language-option.js +101 -0
  356. package/loaders/post-language-switch.d.ts +11 -0
  357. package/loaders/post-language-switch.js +138 -0
  358. package/loaders/post-list-item.d.ts +11 -0
  359. package/loaders/post-list-item.js +38 -0
  360. package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
  361. package/loaders/post-list.js +57 -0
  362. package/loaders/post-logo.js +3 -3
  363. package/loaders/post-mainnavigation.d.ts +11 -0
  364. package/loaders/post-mainnavigation.js +51 -0
  365. package/loaders/post-megadropdown-trigger.d.ts +11 -0
  366. package/loaders/post-megadropdown-trigger.js +94 -0
  367. package/loaders/post-megadropdown.d.ts +11 -0
  368. package/loaders/post-megadropdown.js +103 -0
  369. package/loaders/post-menu-item.d.ts +11 -0
  370. package/loaders/post-menu-item.js +6 -0
  371. package/loaders/post-menu-item2.js +27 -0
  372. package/loaders/post-menu-trigger.d.ts +11 -0
  373. package/loaders/post-menu-trigger.js +6 -0
  374. package/loaders/post-menu-trigger2.js +102 -0
  375. package/loaders/post-menu.d.ts +11 -0
  376. package/loaders/post-menu.js +6 -0
  377. package/loaders/post-menu2.js +204 -0
  378. package/loaders/post-popover.js +2 -2
  379. package/loaders/post-popovercontainer2.js +10 -7
  380. package/loaders/post-rating.js +2 -2
  381. package/loaders/post-tab-header.js +4 -3
  382. package/loaders/post-tab-panel.js +3 -2
  383. package/loaders/post-tabs.js +7 -5
  384. package/loaders/post-tag.js +2 -2
  385. package/loaders/post-togglebutton.d.ts +11 -0
  386. package/loaders/post-togglebutton.js +64 -0
  387. package/loaders/post-tooltip.js +28 -16
  388. package/loaders/slide.js +25 -0
  389. package/package.json +9 -6
  390. package/dist/cjs/post-accordion-item-dc4d1801.js +0 -51
  391. package/dist/cjs/post-alert-106c34ac.js +0 -98
  392. package/dist/cjs/post-alert.cjs.entry.js +0 -16
  393. package/dist/cjs/post-card-control-69769d1a.js +0 -272
  394. package/dist/cjs/post-icon-221d976f.js +0 -104
  395. package/dist/cjs/post-icon.cjs.entry.js +0 -15
  396. package/dist/cjs/post-logo-e6cb079f.js +0 -39
  397. package/dist/cjs/post-logo.cjs.entry.js +0 -14
  398. package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
  399. package/dist/cjs/post-tab-header-43310d08.js +0 -32
  400. package/dist/cjs/post-tag-d7ac3cbb.js +0 -47
  401. package/dist/collection/components/post-alert/alert-types.js +0 -1
  402. package/dist/collection/components/post-alert/post-alert.css +0 -7
  403. package/dist/components/post-alert.js +0 -6
  404. package/dist/components/post-alert2.js +0 -136
  405. package/dist/esm/index-f41b763f.js +0 -46
  406. package/dist/esm/package-bc6404e2.js +0 -3
  407. package/dist/esm/post-accordion-item-55d1e771.js +0 -49
  408. package/dist/esm/post-alert-6c908130.js +0 -96
  409. package/dist/esm/post-alert.entry.js +0 -8
  410. package/dist/esm/post-card-control-9fff6efc.js +0 -270
  411. package/dist/esm/post-icon-d59ad345.js +0 -102
  412. package/dist/esm/post-icon.entry.js +0 -7
  413. package/dist/esm/post-logo-a1487634.js +0 -37
  414. package/dist/esm/post-logo.entry.js +0 -6
  415. package/dist/esm/post-popovercontainer.entry.js +0 -3
  416. package/dist/esm/post-tab-header-dd2cb68e.js +0 -30
  417. package/dist/esm/post-tag-f60a71fd.js +0 -45
  418. package/dist/post-components/p-0e0c11f9.entry.js +0 -1
  419. package/dist/post-components/p-124fe6c8.js +0 -1
  420. package/dist/post-components/p-15c6739e.entry.js +0 -1
  421. package/dist/post-components/p-2180e02d.entry.js +0 -1
  422. package/dist/post-components/p-22ec06ae.entry.js +0 -1
  423. package/dist/post-components/p-26bbd8e5.entry.js +0 -1
  424. package/dist/post-components/p-2b43665d.js +0 -1
  425. package/dist/post-components/p-2d1f85f4.js +0 -1
  426. package/dist/post-components/p-464ce10a.entry.js +0 -1
  427. package/dist/post-components/p-51eff367.js +0 -1
  428. package/dist/post-components/p-586f7f53.entry.js +0 -1
  429. package/dist/post-components/p-65031b20.entry.js +0 -1
  430. package/dist/post-components/p-6d9c46f4.js +0 -1
  431. package/dist/post-components/p-6f12f3e5.js +0 -1
  432. package/dist/post-components/p-718eb560.js +0 -1
  433. package/dist/post-components/p-78407640.entry.js +0 -1
  434. package/dist/post-components/p-79a40235.entry.js +0 -1
  435. package/dist/post-components/p-7ab513fc.js +0 -1
  436. package/dist/post-components/p-9cba7d2f.js +0 -1
  437. package/dist/post-components/p-9eb27378.entry.js +0 -1
  438. package/dist/post-components/p-a528acc4.js +0 -1
  439. package/dist/post-components/p-aa8e43c3.js +0 -1
  440. package/dist/post-components/p-b68c86a7.js +0 -1
  441. package/dist/post-components/p-b8db0e0a.entry.js +0 -1
  442. package/dist/post-components/p-bcd5843c.entry.js +0 -1
  443. package/dist/post-components/p-c21b810d.js +0 -1
  444. package/dist/post-components/p-c386219b.js +0 -1
  445. package/dist/post-components/p-d2f9de94.js +0 -2
  446. package/dist/post-components/p-deb4131c.js +0 -1
  447. package/dist/post-components/p-e7c67ff0.entry.js +0 -1
  448. package/dist/post-components/p-f10e2bb1.entry.js +0 -1
  449. package/dist/types/components/post-alert/alert-types.d.ts +0 -2
  450. package/dist/types/components/post-alert/post-alert.d.ts +0 -54
  451. package/loaders/post-alert.js +0 -139
@@ -0,0 +1,107 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { slideUp, slideDown } from "../../animations/slide";
3
+ import { version } from "../../../../package";
4
+ import { checkType, checkNonEmpty } from "../../utils/index";
5
+ export class PostBackToTop {
6
+ constructor() {
7
+ this.handleScroll = () => {
8
+ this.belowFold = this.isBelowFold();
9
+ };
10
+ this.label = undefined;
11
+ this.belowFold = false;
12
+ }
13
+ isBelowFold() {
14
+ return window.scrollY > window.innerHeight;
15
+ }
16
+ // Watch for changes in belowFold
17
+ watchBelowFold(newValue) {
18
+ if (newValue) {
19
+ slideUp(this.el, this.translateY);
20
+ }
21
+ else {
22
+ slideDown(this.el, this.translateY);
23
+ }
24
+ }
25
+ scrollToTop() {
26
+ window.scrollTo({
27
+ top: 0,
28
+ });
29
+ }
30
+ // Validate the label
31
+ validateLabel() {
32
+ checkType(this.label, 'string', 'The label property of the Back to Top component is required for accessibility purposes. Please ensure it is set.');
33
+ checkNonEmpty(this.label, 'The label property of the Back to Top component must not be empty. Please provide a proper text for the label');
34
+ }
35
+ // Set the initial state
36
+ componentWillLoad() {
37
+ this.belowFold = this.isBelowFold();
38
+ }
39
+ componentDidLoad() {
40
+ window.addEventListener('scroll', this.handleScroll, false);
41
+ this.translateY = window
42
+ .getComputedStyle(this.el)
43
+ .getPropertyValue('--post-floating-button-translate-y');
44
+ if (!this.belowFold) {
45
+ this.el.style.transform = `translateY(${this.translateY})`;
46
+ }
47
+ // Initial load
48
+ if (this.belowFold) {
49
+ slideUp(this.el, this.translateY);
50
+ }
51
+ this.validateLabel();
52
+ }
53
+ disconnectedCallback() {
54
+ window.removeEventListener('scroll', this.handleScroll);
55
+ }
56
+ render() {
57
+ return (h(Host, { key: '92d56ff9055c2af38ae47b28c3af20771eed9a39', "data-version": version }, h("button", { key: 'ae305dd5b5a3f8d97553945e547ad45e824e6b7d', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, h("post-icon", { key: '37792f99d6ef79df4260f6ad1c5780e545f7870a', "aria-hidden": "true", name: "3026" }), h("span", { key: '8768101a26e259c2bd0695a97e6bb4077ad31ae6', class: "visually-hidden" }, this.label))));
58
+ }
59
+ static get is() { return "post-back-to-top"; }
60
+ static get encapsulation() { return "shadow"; }
61
+ static get originalStyleUrls() {
62
+ return {
63
+ "$": ["post-back-to-top.scss"]
64
+ };
65
+ }
66
+ static get styleUrls() {
67
+ return {
68
+ "$": ["post-back-to-top.css"]
69
+ };
70
+ }
71
+ static get properties() {
72
+ return {
73
+ "label": {
74
+ "type": "string",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "string",
78
+ "resolved": "string",
79
+ "references": {}
80
+ },
81
+ "required": true,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "The label of the back-to-top button, intended solely for accessibility purposes.\nThis label is always hidden from view."
86
+ },
87
+ "attribute": "label",
88
+ "reflect": false
89
+ }
90
+ };
91
+ }
92
+ static get states() {
93
+ return {
94
+ "belowFold": {}
95
+ };
96
+ }
97
+ static get elementRef() { return "el"; }
98
+ static get watchers() {
99
+ return [{
100
+ "propName": "belowFold",
101
+ "methodName": "watchBelowFold"
102
+ }, {
103
+ "propName": "label",
104
+ "methodName": "validateLabel"
105
+ }];
106
+ }
107
+ }
@@ -0,0 +1 @@
1
+ export const BANNER_TYPES = ['neutral', 'success', 'warning', 'danger', 'info'];
@@ -0,0 +1,3 @@
1
+ .banner,.alert{min-height:calc(var(--post-device-sizing-notification-icon-2) + (2 * var(--post-device-spacing-padding-10)));box-sizing:border-box;box-shadow:var(--post-device-elevation-100);border-radius:var(--post-device-border-radius-2);padding:var(--post-device-spacing-padding-10) var(--post-device-spacing-padding-10);padding-inline-start:calc(var(--post-device-spacing-padding-10) + var(--post-device-sizing-notification-icon-2) + var(--post-device-spacing-gap-inline-6));font-weight:400;border-style:var(--post-core-border-style-solid);border-width:var(--post-device-border-width-default);position:relative;color:var(--post-scheme-color-surface-default-fg);background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner:not(.no-icon)::before,.alert:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner:not(.no-icon)::before,.alert:not(.no-icon)::before{color:CanvasText}}.banner:has(>post-icon)::before,.alert:has(>post-icon)::before{content:none}.banner>post-icon,.alert>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner::before,.alert::before{content:"";display:block}.banner::before,.banner>post-icon,.alert::before,.alert>post-icon{position:absolute;height:var(--post-device-sizing-notification-icon-2);width:var(--post-device-sizing-notification-icon-2);left:var(--post-device-spacing-padding-10);top:var(--post-device-spacing-padding-10)}.banner.no-icon,.alert.no-icon{min-height:calc(2*var(--post-device-spacing-padding-10) + var(--post-core-dimension-24));padding-inline-start:var(--post-device-spacing-padding-10)}.banner.no-icon::before,.alert.no-icon::before{content:unset}.banner.no-icon>post-icon,.alert.no-icon>post-icon{display:none}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner,.alert{filter:none !important;border:2px solid CanvasText}}.banner:not(.banner-action):not(.alert-action),.alert:not(.banner-action):not(.alert-action){display:flex;flex-direction:column;justify-content:center;gap:var(--post-core-dimension-4)}.banner:not(.banner-action):not(.alert-action) a,.alert:not(.banner-action):not(.alert-action) a{font-weight:400}.banner:not(.banner-action):not(.alert-action) hr,.alert:not(.banner-action):not(.alert-action) hr{margin-block:var(--post-core-dimension-8) var(--post-core-dimension-12) !important}.banner:not(.banner-action):not(.alert-action)>*,.alert:not(.banner-action):not(.alert-action)>*{margin:0}.banner-container{border:unset;background-color:rgba(0,0,0,0)}.banner-dismissible,.alert-dismissible{pointer-events:auto;position:relative}.banner-dismissible:not(.banner-action):not(.alert-action),.alert-dismissible:not(.banner-action):not(.alert-action){padding-inline-end:calc(var(--post-device-spacing-padding-10) + var(--post-device-spacing-gap-inline-6) + var(--post-core-dimension-24))}.banner-dismissible>.btn-close,.alert-dismissible>.btn-close{position:absolute;inset-block-start:1rem;inset-inline-end:var(--post-device-spacing-padding-10)}.banner-buttons,.alert-buttons{display:flex;align-items:center;justify-content:flex-start;flex-direction:row-reverse;margin-block-start:var(--post-device-spacing-padding-block-10);gap:var(--post-device-spacing-gap-1)}@media(max-width: 779.98px){.banner-buttons,.alert-buttons{flex-direction:column}}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{display:flex;flex-direction:column;justify-content:center;gap:var(--post-core-dimension-4)}.banner-action>.banner-content a,.banner-action>.alert-content a,.alert-action>.banner-content a,.alert-action>.alert-content a{font-weight:400}.banner-action>.banner-content hr,.banner-action>.alert-content hr,.alert-action>.banner-content hr,.alert-action>.alert-content hr{margin-block:var(--post-core-dimension-8) var(--post-core-dimension-12) !important}.banner-action>.banner-content>*,.banner-action>.alert-content>*,.alert-action>.banner-content>*,.alert-action>.alert-content>*{margin:0}@media(max-width: 779.98px){.banner-action,.alert-action{flex-direction:column;align-items:stretch}.banner-action>.banner-content,.banner-action>.alert-content,.alert-action>.banner-content,.alert-action>.alert-content{padding-inline-start:var(--post-device-spacing-gap-inline-6)var(--post-device-sizing-notification-icon-2);padding-inline-end:var(--post-device-spacing-gap-inline-6)var(--post-core-dimension-24)}.banner-action.no-icon>.banner-content,.banner-action.no-icon>.alert-content,.alert-action.no-icon>.banner-content,.alert-action.no-icon>.alert-content{padding-inline-start:0}.banner-action>.banner-buttons,.banner-action>.alert-buttons,.alert-action>.banner-buttons,.alert-action>.alert-buttons{display:flex}.banner-action>.banner-buttons>.btn,.banner-action>.banner-buttons>::slotted(.btn),.banner-action>.alert-buttons>.btn,.banner-action>.alert-buttons>::slotted(.btn),.alert-action>.banner-buttons>.btn,.alert-action>.banner-buttons>::slotted(.btn),.alert-action>.alert-buttons>.btn,.alert-action>.alert-buttons>::slotted(.btn){flex:1 0 0;width:100%}.banner-action>.banner-buttons>.btn:first-child,.banner-action>.banner-buttons>::slotted(.btn:first-child),.banner-action>.alert-buttons>.btn:first-child,.banner-action>.alert-buttons>::slotted(.btn:first-child),.alert-action>.banner-buttons>.btn:first-child,.alert-action>.banner-buttons>::slotted(.btn:first-child),.alert-action>.alert-buttons>.btn:first-child,.alert-action>.alert-buttons>::slotted(.btn:first-child){margin-inline-start:0}}.banner-neutral,.alert-neutral{background-color:var(--post-scheme-color-signal-neutral);border-color:var(--post-scheme-color-signal-neutral-dark);color-scheme:var(--post-core-bg-scheme-light)}.banner-neutral:not(.no-icon)::before,.alert-neutral:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.986 15.73c-.503.16-1.03.27-1.586.27a5.24 5.24 0 0 1-4.43-2.448c-.73.382-1.547.62-2.427.62a5.257 5.257 0 0 1-5.257-5.258c0-.88.237-1.698.62-2.427a5.24 5.24 0 0 1-2.449-4.43c0-.714.145-1.393.403-2.014C16.574.028 16.29 0 16 0 7.163 0 0 7.163 0 16s7.163 16 16 16 16-7.163 16-16c0-.091-.012-.18-.014-.27M16 30.667c-8.087 0-14.667-6.58-14.667-14.667 0-7.806 6.13-14.207 13.828-14.643a6.54 6.54 0 0 0 2.116 5.56 6.3 6.3 0 0 0-.325 1.997 6.6 6.6 0 0 0 6.59 6.59c.677 0 1.346-.108 1.998-.324a6.54 6.54 0 0 0 5.067 2.15C29.933 24.796 23.639 30.667 16 30.667M11.352 14.17a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 1 1 1.334 1.334 1.336 1.336 0 0 1-1.334-1.334m13.981 8.496a2.667 2.667 0 1 0-5.333 0 2.667 2.667 0 0 0 5.333 0m-4 0a1.335 1.335 0 0 1 2.667 0c0 .735-.598 1.333-1.333 1.333a1.335 1.335 0 0 1-1.334-1.333m-7.276-1.829a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.667a.667.667 0 1 1 .002-1.335.667.667 0 0 1-.002 1.335m7.772-6a2 2 0 1 0-4 0 2 2 0 0 0 4 0m-2 .666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M11.505 5.505a2 2 0 1 0 0 4 2 2 0 0 0 0-4m0 2.666a.667.667 0 1 1 .001-1.334.667.667 0 0 1-.001 1.334M28.93 18.548a13.2 13.2 0 0 1-4.335 7.357.663.663 0 0 1-.94-.073.666.666 0 0 1 .073-.94 11.84 11.84 0 0 0 3.894-6.61.668.668 0 0 1 1.307.266m-6.668 8.212a.667.667 0 0 1-.295.896c-.837.423-1.722.757-2.63.99a.665.665 0 1 1-.33-1.292 11.7 11.7 0 0 0 2.359-.888.67.67 0 0 1 .896.294M4 15.921a.666.666 0 1 1-1.333 0 13.13 13.13 0 0 1 4.597-9.984.666.666 0 1 1 .867 1.013A11.8 11.8 0 0 0 4 15.92'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-signal-neutral-dark)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-neutral:not(.no-icon)::before,.alert-neutral:not(.no-icon)::before{color:CanvasText}}.banner-neutral:has(>post-icon)::before,.alert-neutral:has(>post-icon)::before{content:none}.banner-neutral>post-icon,.alert-neutral>post-icon{background-color:var(--post-scheme-color-signal-neutral);color:var(--post-scheme-color-signal-neutral-dark)}.banner-success,.alert-success{background-color:var(--post-scheme-color-interactive-notification-success-bg);border-color:var(--post-scheme-color-interactive-notification-success-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-success:not(.no-icon)::before,.alert-success:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12.667 24.533-7.6-7.6 1.867-1.867 5.733 5.733 12.4-12.4 1.867 1.867z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-success-icon)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-success:not(.no-icon)::before,.alert-success:not(.no-icon)::before{color:CanvasText}}.banner-success:has(>post-icon)::before,.alert-success:has(>post-icon)::before{content:none}.banner-success>post-icon,.alert-success>post-icon{background-color:var(--post-scheme-color-interactive-notification-success-bg);color:var(--post-scheme-color-interactive-notification-success-icon)}.banner-warning,.alert-warning{background-color:var(--post-scheme-color-interactive-notification-warning-bg);border-color:var(--post-scheme-color-interactive-notification-warning-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-warning:not(.no-icon)::before,.alert-warning:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-warning-icon)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-warning:not(.no-icon)::before,.alert-warning:not(.no-icon)::before{color:CanvasText}}.banner-warning:has(>post-icon)::before,.alert-warning:has(>post-icon)::before{content:none}.banner-warning>post-icon,.alert-warning>post-icon{background-color:var(--post-scheme-color-interactive-notification-warning-bg);color:var(--post-scheme-color-interactive-notification-warning-icon)}.banner-error,.alert-error{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-error:not(.no-icon)::before,.alert-error:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-error:not(.no-icon)::before,.alert-error:not(.no-icon)::before{color:CanvasText}}.banner-error:has(>post-icon)::before,.alert-error:has(>post-icon)::before{content:none}.banner-error>post-icon,.alert-error>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.banner-info,.alert-info{background-color:var(--post-scheme-color-interactive-notification-info-bg);border-color:var(--post-scheme-color-interactive-notification-info-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-info:not(.no-icon)::before,.alert-info:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.33 25.33v-16h-4.67V12h2v13.33h-2V28h6.67v-2.67zM14.67 4h2.67v2.67h-2.67z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-info-icon)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-info:not(.no-icon)::before,.alert-info:not(.no-icon)::before{color:CanvasText}}.banner-info:has(>post-icon)::before,.alert-info:has(>post-icon)::before{content:none}.banner-info>post-icon,.alert-info>post-icon{background-color:var(--post-scheme-color-interactive-notification-info-bg);color:var(--post-scheme-color-interactive-notification-info-icon)}.banner-danger,.alert-danger{background-color:var(--post-scheme-color-interactive-notification-error-bg);border-color:var(--post-scheme-color-interactive-notification-error-stroke);color-scheme:var(--post-core-bg-scheme-light)}.banner-danger:not(.no-icon)::before,.alert-danger:not(.no-icon)::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.67 4h2.67v18.67h-2.67zm0 21.33h2.67V28h-2.67z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;color:var(--post-scheme-color-interactive-notification-error-icon)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.banner-danger:not(.no-icon)::before,.alert-danger:not(.no-icon)::before{color:CanvasText}}.banner-danger:has(>post-icon)::before,.alert-danger:has(>post-icon)::before{content:none}.banner-danger>post-icon,.alert-danger>post-icon{background-color:var(--post-scheme-color-interactive-notification-error-bg);color:var(--post-scheme-color-interactive-notification-error-icon)}.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{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}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{-webkit-mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:"";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:var(--post-gray-40)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}/*!
2
+ * Copyright 2021 by Swiss Post, Information Technology
3
+ */:host{display:block}:host ::slotted(*){margin:0 !important}.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}.visually-hidden:not(caption){position:absolute !important}
@@ -1,66 +1,59 @@
1
- import { h, Host, } from "@stencil/core";
1
+ import { Host, h, } from "@stencil/core";
2
2
  import { version } from "../../../../package";
3
3
  import { fadeOut } from "../../animations/index";
4
4
  import { checkEmptyOrOneOf, checkEmptyOrPattern, checkNonEmpty, checkType } from "../../utils/index";
5
- import { ALERT_TYPES } from "./alert-types";
5
+ import { BANNER_TYPES } from "./banner-types";
6
+ import { nanoid } from "nanoid";
6
7
  /**
7
- * @slot heading - Slot for placing custom content within the alert's heading.
8
- * @slot actions - Slot for placing custom actions (buttons, links, etc.) within the alert.
9
- * @slot default - Slot for placing the main content/message of the alert.
8
+ * @slot heading - Slot for placing custom content within the banner's heading.
9
+ * @slot actions - Slot for placing custom actions (buttons, links, etc.) within the banner.
10
+ * @slot default - Slot for placing the main content/message of the banner.
10
11
  */
11
- export class PostAlert {
12
+ export class PostBanner {
12
13
  constructor() {
13
- this.alertId = crypto.randomUUID();
14
+ this.bannerId = `p${nanoid(6)}`;
14
15
  this.classes = undefined;
15
16
  this.hasActions = undefined;
16
17
  this.hasHeading = undefined;
17
18
  this.onDismissButtonClick = () => this.dismiss();
18
19
  this.dismissible = false;
19
20
  this.dismissLabel = undefined;
20
- this.fixed = false;
21
21
  this.icon = undefined;
22
- this.type = 'primary';
22
+ this.type = 'neutral';
23
23
  }
24
24
  validateDismissible(isDismissible = this.dismissible) {
25
- checkType(isDismissible, 'boolean', 'The post-alert "dismissible" prop should be a boolean.');
25
+ checkType(isDismissible, 'boolean', 'The post-banner "dismissible" prop should be a boolean.');
26
26
  setTimeout(() => this.validateDismissLabel());
27
27
  }
28
28
  validateDismissLabel(dismissLabel = this.dismissLabel) {
29
29
  if (this.dismissible) {
30
- checkNonEmpty(dismissLabel, 'Dismissible post-alert\'s require a "dismiss-label" prop.');
30
+ checkNonEmpty(dismissLabel, 'Dismissible post-banner\'s require a "dismiss-label" prop.');
31
31
  }
32
32
  }
33
- validateFixed(isFixed = this.fixed) {
34
- checkType(isFixed, 'boolean', 'The post-alert "fixed" prop should be a boolean.');
35
- }
36
33
  validateIcon(icon = this.icon) {
37
- checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-alert "icon" prop should be a 4-digits string.');
34
+ checkEmptyOrPattern(icon, /\d{4}|none/, 'The post-banner "icon" prop should be a 4-digits string.');
38
35
  }
39
36
  validateType(type = this.type) {
40
- checkEmptyOrOneOf(type, ALERT_TYPES, `The post-alert requires a type form: ${ALERT_TYPES.join(', ')}`);
37
+ checkEmptyOrOneOf(type, BANNER_TYPES, `The post-banner requires a type form: ${BANNER_TYPES.join(', ')}`);
41
38
  }
42
- connectedCallback() {
39
+ componentDidLoad() {
43
40
  this.validateDismissible();
44
- this.validateFixed();
45
41
  this.validateIcon();
46
42
  this.validateType();
47
43
  }
48
44
  componentWillRender() {
49
- var _a;
50
45
  this.hasHeading = this.host.querySelectorAll('[slot=heading]').length > 0;
51
46
  this.hasActions = this.host.querySelectorAll('[slot=actions]').length > 0;
52
- this.classes = `alert alert-${(_a = this.type) !== null && _a !== void 0 ? _a : 'primary'}`;
47
+ this.classes = `banner ${this.type ? 'banner-' + this.type : ''}`;
53
48
  if (this.dismissible)
54
- this.classes += ' alert-dismissible';
49
+ this.classes += ' banner-dismissible';
55
50
  if (this.hasActions)
56
- this.classes += ' alert-action';
57
- if (this.fixed)
58
- this.classes += ' alert-fixed-bottom';
51
+ this.classes += ' banner-action';
59
52
  if (this.icon === 'none')
60
53
  this.classes += ' no-icon';
61
54
  }
62
55
  /**
63
- * Triggers alert dismissal programmatically (same as clicking on the close button (×)).
56
+ * Triggers banner dismissal programmatically (same as clicking on the close button (×)).
64
57
  */
65
58
  async dismiss() {
66
59
  const dismissal = fadeOut(this.host);
@@ -69,26 +62,26 @@ export class PostAlert {
69
62
  this.postDismissed.emit();
70
63
  }
71
64
  render() {
72
- const defaultAlertContent = [
73
- this.hasHeading && (h("div", { key: `${this.alertId}-heading`, class: "alert-heading" }, h("slot", { key: '928eeaedc9a897394ef064a218b43a780dc10f0d', name: "heading" }))),
74
- h("slot", { key: `${this.alertId}-message` }),
65
+ const defaultBannerContent = [
66
+ this.hasHeading && (h("div", { key: `${this.bannerId}-heading`, class: "banner-heading" }, h("slot", { key: 'ac8774db27af4057a85f04f5864534c14f387cd7', name: "heading" }))),
67
+ h("slot", { key: `${this.bannerId}-message` }),
75
68
  ];
76
- const actionAlertContent = [
77
- h("div", { key: `${this.alertId}-content`, class: "alert-content" }, defaultAlertContent),
78
- h("div", { key: `${this.alertId}-buttons`, class: "alert-buttons" }, h("slot", { key: '67bcd576fb17374be6e0f9b3633a19aaff884b6a', name: "actions" })),
69
+ const actionBannerContent = [
70
+ h("div", { key: `${this.bannerId}-content`, class: "banner-content" }, defaultBannerContent),
71
+ h("div", { key: `${this.bannerId}-buttons`, class: "banner-buttons" }, h("slot", { key: 'e3652af90a4b54bf1297e4c78a32d64305674ff7', name: "actions" })),
79
72
  ];
80
- return (h(Host, { key: 'df4452a660ba217ad57d5ad69ee224a686f5537e', "data-version": version }, h("div", { key: 'f1d346826fee4629356c9e722ac619d9c7a34c17', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '0deb48cddffd2288dd4e2999f291179ca6cdc6b5', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: 'd252736e70ee4213d7c36e622181b640a8b3c4cb', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.alertId}-icon`, name: this.icon })), this.hasActions ? actionAlertContent : defaultAlertContent)));
73
+ return (h(Host, { key: '21bfb98ce6f38c03dca18877cd99d5ac2ebbafaf', "data-version": version }, h("div", { key: '728c307293908b86d6951d9edc420d8cf9074bc8', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '6ac2f33805ae8dfc8f4a9444fa98153ce5009c72', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: 'ad9dd25cc1c43555115192ec04ce05ec54b793d4', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.bannerId}-icon`, name: this.icon })), this.hasActions ? actionBannerContent : defaultBannerContent)));
81
74
  }
82
- static get is() { return "post-alert"; }
75
+ static get is() { return "post-banner"; }
83
76
  static get encapsulation() { return "shadow"; }
84
77
  static get originalStyleUrls() {
85
78
  return {
86
- "$": ["post-alert.scss"]
79
+ "$": ["post-banner.scss"]
87
80
  };
88
81
  }
89
82
  static get styleUrls() {
90
83
  return {
91
- "$": ["post-alert.css"]
84
+ "$": ["post-banner.css"]
92
85
  };
93
86
  }
94
87
  static get properties() {
@@ -105,7 +98,7 @@ export class PostAlert {
105
98
  "optional": false,
106
99
  "docs": {
107
100
  "tags": [],
108
- "text": "If `true`, a close button (\u00D7) is displayed and the alert can be dismissed by the user."
101
+ "text": "If `true`, a close button (\u00D7) is displayed and the banner can be dismissed by the user."
109
102
  },
110
103
  "attribute": "dismissible",
111
104
  "reflect": false,
@@ -123,29 +116,11 @@ export class PostAlert {
123
116
  "optional": false,
124
117
  "docs": {
125
118
  "tags": [],
126
- "text": "The label to use for the close button of a dismissible alert."
119
+ "text": "The label to use for the close button of a dismissible banner."
127
120
  },
128
121
  "attribute": "dismiss-label",
129
122
  "reflect": false
130
123
  },
131
- "fixed": {
132
- "type": "boolean",
133
- "mutable": false,
134
- "complexType": {
135
- "original": "boolean",
136
- "resolved": "boolean",
137
- "references": {}
138
- },
139
- "required": false,
140
- "optional": false,
141
- "docs": {
142
- "tags": [],
143
- "text": "If `true`, the alert is positioned at the bottom of the window, from edge to edge."
144
- },
145
- "attribute": "fixed",
146
- "reflect": false,
147
- "defaultValue": "false"
148
- },
149
124
  "icon": {
150
125
  "type": "string",
151
126
  "mutable": false,
@@ -158,7 +133,7 @@ export class PostAlert {
158
133
  "optional": false,
159
134
  "docs": {
160
135
  "tags": [],
161
- "text": "The icon to display in the alert. By default, the icon depends on the alert type.\n\nIf `none`, no icon is displayed."
136
+ "text": "The icon to display in the banner. By default, the icon depends on the banner type.\n\nIf `none`, no icon is displayed."
162
137
  },
163
138
  "attribute": "icon",
164
139
  "reflect": false
@@ -167,13 +142,13 @@ export class PostAlert {
167
142
  "type": "string",
168
143
  "mutable": false,
169
144
  "complexType": {
170
- "original": "AlertType",
171
- "resolved": "\"danger\" | \"gray\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
145
+ "original": "BannerType",
146
+ "resolved": "\"danger\" | \"info\" | \"neutral\" | \"success\" | \"warning\"",
172
147
  "references": {
173
- "AlertType": {
148
+ "BannerType": {
174
149
  "location": "import",
175
- "path": "./alert-types",
176
- "id": "src/components/post-alert/alert-types.ts::AlertType"
150
+ "path": "./banner-types",
151
+ "id": "src/components/post-banner/banner-types.ts::BannerType"
177
152
  }
178
153
  }
179
154
  },
@@ -181,17 +156,17 @@ export class PostAlert {
181
156
  "optional": false,
182
157
  "docs": {
183
158
  "tags": [],
184
- "text": "The type of the alert."
159
+ "text": "The type of the banner."
185
160
  },
186
161
  "attribute": "type",
187
162
  "reflect": false,
188
- "defaultValue": "'primary'"
163
+ "defaultValue": "'neutral'"
189
164
  }
190
165
  };
191
166
  }
192
167
  static get states() {
193
168
  return {
194
- "alertId": {},
169
+ "bannerId": {},
195
170
  "classes": {},
196
171
  "hasActions": {},
197
172
  "hasHeading": {},
@@ -207,7 +182,7 @@ export class PostAlert {
207
182
  "composed": true,
208
183
  "docs": {
209
184
  "tags": [],
210
- "text": "An event emitted when the alert element is dismissed, after the transition.\nIt has no payload and only relevant for dismissible alerts."
185
+ "text": "An event emitted when the banner element is dismissed, after the transition.\nIt has no payload and only relevant for dismissible banners."
211
186
  },
212
187
  "complexType": {
213
188
  "original": "void",
@@ -231,7 +206,7 @@ export class PostAlert {
231
206
  "return": "Promise<void>"
232
207
  },
233
208
  "docs": {
234
- "text": "Triggers alert dismissal programmatically (same as clicking on the close button (\u00D7)).",
209
+ "text": "Triggers banner dismissal programmatically (same as clicking on the close button (\u00D7)).",
235
210
  "tags": []
236
211
  }
237
212
  }
@@ -245,9 +220,6 @@ export class PostAlert {
245
220
  }, {
246
221
  "propName": "dismissLabel",
247
222
  "methodName": "validateDismissLabel"
248
- }, {
249
- "propName": "fixed",
250
- "methodName": "validateFixed"
251
223
  }, {
252
224
  "propName": "icon",
253
225
  "methodName": "validateIcon"
@@ -0,0 +1,3 @@
1
+ /*!
2
+ * Copyright 2021 by Swiss Post, Information Technology
3
+ */:host{display:flex;align-items:center}.breadcrumbs-nav{display:flex;align-items:center}.hidden-items{gap:var(--post-device-spacing-gap-inline-4);position:absolute;height:0;overflow:hidden;white-space:nowrap}.breadcrumbs-list{display:flex;flex-wrap:nowrap;position:relative;margin:0;padding:0;list-style:none;align-items:center;height:100%;gap:var(--post-device-spacing-gap-inline-4)}post-icon{display:inline-block;box-sizing:border-box;color:var(--post-scheme-color-interactive-primary-enabled-fg1);height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.breadcrumb-item-icon{padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}li a{display:flex;align-items:center}li a{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}li a: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){li a:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){li a: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){li a:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}li a:focus{border-radius:var(--post-device-border-radius-focus)}li a .home-icon{padding-block:var(--post-device-spacing-padding-4);padding-inline:var(--post-device-spacing-padding-4)}li a .home-icon:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){li a .home-icon a,li a .home-icon:focus,li a .home-icon:hover{color:CanvasText !important}}.menu-trigger-wrapper{display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}.actual-menu{display:flex;align-items:center}post-menu-trigger{display:flex;align-items:center;padding-block:var(--post-device-spacing-padding-block-7)}post-menu-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-menu-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-menu-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-menu-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-menu-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-menu-trigger:focus{border-radius:var(--post-device-border-radius-focus)}post-menu-trigger button{background:none;border:none;line-height:150%;font-size:var(--post-device-font-size-6);cursor:pointer;padding:0;color:var(--post-scheme-color-interactive-primary-enabled-fg1)}post-menu-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-trigger button a,post-menu-trigger button:focus,post-menu-trigger button:hover{color:LinkText !important}}post-menu::part(popover-container){display:flex;flex-direction:column;align-items:start;padding:.6rem;gap:var(--post-device-spacing-gap-inline-4)}post-menu::part(popover-container) ::slotted(post-menu-item:not(:last-child)){margin-bottom:var(--post-device-spacing-gap-inline-4)}.breadcrumb-item{display:flex;align-items:center;justify-content:center;gap:var(--post-device-spacing-gap-inline-5)}.breadcrumb-item a{text-decoration:none;color:inherit;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);font-size:var(--post-device-font-size-6)}.breadcrumb-item a{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}.breadcrumb-item a: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){.breadcrumb-item a:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item a: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){.breadcrumb-item a:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item a:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item a:focus-visible{border-radius:var(--post-device-border-radius-focus)}.breadcrumb-item span:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item span:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item a,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}post-breadcrumb-item:last-of-type{pointer-events:none;color:var(--post-scheme-color-interactive-primary-selected-fg1);font-weight:var(--post-device-font-weight-bold);text-decoration:var(--post-core-text-decoration-none)}post-breadcrumb-item:last-of-type:hover{color:var(--post-scheme-color-interactive-primary-selected-fg1);text-decoration:none}.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}.visually-hidden:not(caption){position:absolute !important}
@@ -0,0 +1,161 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { version } from "../../../../package";
3
+ import { checkUrl, debounce } from "../../utils/index";
4
+ export class PostBreadcrumb {
5
+ constructor() {
6
+ // Waits for breadcrumb navigation reference to be available
7
+ this.waitForBreadcrumbRef = debounce(() => {
8
+ var _a;
9
+ if (((_a = this.breadcrumbNavRef) === null || _a === void 0 ? void 0 : _a.clientWidth) > 0) {
10
+ this.checkConcatenation();
11
+ }
12
+ else {
13
+ this.waitForBreadcrumbRef();
14
+ }
15
+ }, 50);
16
+ // Handles resizing to check concatenation
17
+ this.handleResize = () => {
18
+ if (window.innerWidth === this.lastWindowWidth)
19
+ return;
20
+ this.lastWindowWidth = window.innerWidth;
21
+ this.checkConcatenation();
22
+ };
23
+ this.homeUrl = undefined;
24
+ this.homeText = 'Home';
25
+ this.breadcrumbItems = [];
26
+ this.isConcatenated = undefined;
27
+ this.lastWindowWidth = undefined;
28
+ }
29
+ validateUrl() {
30
+ checkUrl(this.homeUrl, 'The "url" property of the home-icon is invalid');
31
+ }
32
+ componentWillLoad() {
33
+ this.updateBreadcrumbItems();
34
+ }
35
+ componentDidLoad() {
36
+ window.addEventListener('resize', this.handleResize);
37
+ this.waitForBreadcrumbRef();
38
+ }
39
+ disconnectedCallback() {
40
+ window.removeEventListener('resize', this.handleResize);
41
+ }
42
+ // Updates breadcrumb items and sets the last item
43
+ updateBreadcrumbItems() {
44
+ this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map((item) => ({
45
+ text: item.textContent || '',
46
+ url: item.getAttribute('url') || '',
47
+ }));
48
+ this.lastItem = this.breadcrumbItems[this.breadcrumbItems.length - 1];
49
+ }
50
+ // Determines parent width for concatenation logic
51
+ getParentWidth() {
52
+ let parent = this.host.parentNode;
53
+ while (parent && !(parent instanceof HTMLElement)) {
54
+ parent = parent.parentNode;
55
+ }
56
+ return parent instanceof HTMLElement ? parent.clientWidth : window.innerWidth;
57
+ }
58
+ checkConcatenation() {
59
+ var _a;
60
+ if (!this.breadcrumbNavRef)
61
+ return;
62
+ const visibleWidth = this.getParentWidth();
63
+ // Measure all hidden breadcrumb items
64
+ const hiddenItems = Array.from(((_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.hidden-breadcrumb-item')) || []);
65
+ const totalWidth = hiddenItems.reduce((accum, element) => {
66
+ const rect = element.getBoundingClientRect();
67
+ return accum + rect.width;
68
+ }, 0);
69
+ this.isConcatenated = totalWidth > visibleWidth;
70
+ }
71
+ // Handles breadcrumb item click to open the menu
72
+ handleBreadcrumbItemClick() {
73
+ var _a, _b;
74
+ if (this.host.shadowRoot) {
75
+ const menuTrigger = (_b = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.menu-trigger-wrapper')) === null || _b === void 0 ? void 0 : _b.querySelector('button');
76
+ if (menuTrigger) {
77
+ menuTrigger.click();
78
+ }
79
+ }
80
+ }
81
+ render() {
82
+ const visibleItems = this.breadcrumbItems.slice(0, -1);
83
+ return (h(Host, { key: '1baffcf05840127383931baec809e2b94e402e5e', "data-version": version }, h("nav", { key: 'c6725b8aa970f35f15f31ecc56280e7518b2dba9', "aria-label": "Breadcrumb", class: "breadcrumbs-nav", ref: (el) => (this.breadcrumbNavRef = el) }, h("ol", { key: '3166f345dde9f7003b23f5e7a1ddbe587b3fb4be', class: "no-list breadcrumbs-list" }, h("li", { key: '2efcbd6502cc5245ee63fd344a28c8aea4561cde' }, h("a", { key: 'b727c3d880ca9ebb7fc8527263a142662e4d42fd', href: this.homeUrl, class: "breadcrumb-link" }, h("span", { key: 'd683d05bce032759aa224e7a36ef5d7fb3883187', class: "visually-hidden" }, this.homeText), h("post-icon", { key: 'f17d5f56a49f0525d64414c079968d80b0c7eca3', name: "home", class: "home-icon" }))), this.isConcatenated ? (h("div", { class: "menu-trigger-wrapper", "aria-label": "More breadcrumbs", onKeyDown: (e) => {
84
+ if (e.key === 'Enter' || e.key === ' ') {
85
+ e.preventDefault();
86
+ this.handleBreadcrumbItemClick();
87
+ }
88
+ } }, h("post-icon", { name: "2111", class: "breadcrumb-item-icon" }), h("div", { class: "actual-menu" }, h("post-menu-trigger", { for: "breadcrumb-menu", tabIndex: 0 }, h("button", { class: "btn test", tabIndex: -1 }, "...")), h("post-menu", { id: "breadcrumb-menu" }, visibleItems.map((item) => (h("post-menu-item", { key: item.url || item.text, class: "breadcrumb-item", onKeyDown: (e) => {
89
+ if (e.key === 'Enter' || e.key === ' ') {
90
+ const linkElement = e.currentTarget.querySelector('a');
91
+ linkElement === null || linkElement === void 0 ? void 0 : linkElement.click();
92
+ e.preventDefault();
93
+ }
94
+ } }, item.url ? h("a", { href: item.url }, item.text) : h("span", null, item.text)))))))) : (visibleItems.map((item) => (h("post-breadcrumb-item", { url: item.url, key: item.url || item.text }, item.text)))), this.lastItem && (h("post-breadcrumb-item", { key: '674dd84e23c325f874f57b92b0171b47d600d463', url: this.lastItem.url, "aria-current": "page", tabindex: -1 }, this.lastItem.text))), h("div", { key: 'b4131833874403a8166446991510a36003a21aed', class: "hidden-items" }, h("a", { key: 'aa31950651d486afdb97974c24929cc80e0c3f53', href: this.homeUrl, class: "hidden-breadcrumb-item" }, h("span", { key: 'e9d1f5e225220a5942f8844dc26014f1278f935f', class: "visually-hidden" }, this.homeText), h("post-icon", { key: '493a91739d10c3e536da52d636aca4b305f88273', name: "home", class: "home-icon" })), this.breadcrumbItems.map((item) => (h("post-breadcrumb-item", { url: item.url, key: `hidden-${item.url || item.text}`, class: "hidden-breadcrumb-item" }, item.text)))))));
95
+ }
96
+ static get is() { return "post-breadcrumb"; }
97
+ static get encapsulation() { return "shadow"; }
98
+ static get originalStyleUrls() {
99
+ return {
100
+ "$": ["post-breadcrumb.scss"]
101
+ };
102
+ }
103
+ static get styleUrls() {
104
+ return {
105
+ "$": ["post-breadcrumb.css"]
106
+ };
107
+ }
108
+ static get properties() {
109
+ return {
110
+ "homeUrl": {
111
+ "type": "string",
112
+ "mutable": false,
113
+ "complexType": {
114
+ "original": "string",
115
+ "resolved": "string",
116
+ "references": {}
117
+ },
118
+ "required": false,
119
+ "optional": false,
120
+ "docs": {
121
+ "tags": [],
122
+ "text": "The URL for the home breadcrumb item."
123
+ },
124
+ "attribute": "home-url",
125
+ "reflect": false
126
+ },
127
+ "homeText": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": "The text label for the home breadcrumb item."
140
+ },
141
+ "attribute": "home-text",
142
+ "reflect": false,
143
+ "defaultValue": "'Home'"
144
+ }
145
+ };
146
+ }
147
+ static get states() {
148
+ return {
149
+ "breadcrumbItems": {},
150
+ "isConcatenated": {},
151
+ "lastWindowWidth": {}
152
+ };
153
+ }
154
+ static get elementRef() { return "host"; }
155
+ static get watchers() {
156
+ return [{
157
+ "propName": "homeUrl",
158
+ "methodName": "validateUrl"
159
+ }];
160
+ }
161
+ }
@@ -0,0 +1 @@
1
+ :host{display:flex;align-items:center;justify-content:start;gap:var(--post-device-spacing-gap-inline-5)}:host post-icon{box-sizing:border-box;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}.breadcrumb-item{white-space:nowrap;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item{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}.breadcrumb-item: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){.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item: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){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}