@swisspost/design-system-components 10.0.0-next.69 → 10.0.0-next.71

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 (342) hide show
  1. package/dist/cjs/breakpoints-B0Olgvgc.js +206 -0
  2. package/dist/cjs/component-on-ready-CifOTqw1.js +24 -0
  3. package/dist/cjs/{focusable-ZqET_zrB.js → focusable-COT2uiEV.js} +25 -4
  4. package/dist/cjs/{index-DPdHkdGf.js → index-CCteMCnR.js} +13 -13
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/nanoid-CmjyF1Cm.js +20 -0
  7. package/dist/cjs/{package-CzSn3NmD.js → package-CscM89A7.js} +1 -1
  8. package/dist/cjs/post-accordion_2.cjs.entry.js +7 -7
  9. package/dist/cjs/post-autocomplete.cjs.entry.js +3 -3
  10. package/dist/cjs/post-avatar.cjs.entry.js +6 -24
  11. package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
  12. package/dist/cjs/post-banner.cjs.entry.js +3 -3
  13. package/dist/cjs/post-breadcrumb-item.cjs.entry.js +30 -33
  14. package/dist/cjs/post-breadcrumbs.cjs.entry.js +82 -80
  15. package/dist/cjs/post-closebutton_14.cjs.entry.js +36 -33
  16. package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
  17. package/dist/cjs/post-components.cjs.js +2 -2
  18. package/dist/cjs/post-date-picker.cjs.entry.js +31 -23
  19. package/dist/cjs/post-footer.cjs.entry.js +6 -6
  20. package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
  21. package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
  22. package/dist/cjs/post-listbox.cjs.entry.js +4 -4
  23. package/dist/cjs/post-login-widget.cjs.entry.js +36 -3
  24. package/dist/cjs/post-number-input.cjs.entry.js +6 -6
  25. package/dist/cjs/post-pagination.cjs.entry.js +5 -5
  26. package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -5
  27. package/dist/cjs/post-popover.cjs.entry.js +4 -4
  28. package/dist/cjs/post-rating.cjs.entry.js +4 -4
  29. package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
  30. package/dist/cjs/post-stepper.cjs.entry.js +4 -4
  31. package/dist/cjs/post-tab-item.cjs.entry.js +6 -6
  32. package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
  33. package/dist/cjs/post-tabs.cjs.entry.js +7 -27
  34. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +16 -12
  35. package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
  36. package/dist/collection/components/post-accordion-item/post-accordion-item.js +3 -4
  37. package/dist/collection/components/post-avatar/avatar-utils.js +2 -2
  38. package/dist/collection/components/post-avatar/post-avatar.js +3 -40
  39. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
  40. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +79 -39
  41. package/dist/collection/components/post-breadcrumb-item/variants.js +1 -0
  42. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
  43. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +84 -83
  44. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  45. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  46. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
  47. package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
  48. package/dist/collection/components/post-date-picker/post-date-picker.js +2 -2
  49. package/dist/collection/components/post-footer/post-footer.css +1 -1
  50. package/dist/collection/components/post-footer/post-footer.js +2 -1
  51. package/dist/collection/components/post-header/post-header.js +4 -4
  52. package/dist/collection/components/post-icon/post-icon.js +3 -2
  53. package/dist/collection/components/post-language-menu/post-language-menu.js +2 -3
  54. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  55. package/dist/collection/components/post-listbox/post-listbox.js +1 -1
  56. package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
  57. package/dist/collection/components/post-login-widget/post-login-widget.css +1 -0
  58. package/dist/collection/components/post-login-widget/post-login-widget.js +106 -4
  59. package/dist/collection/components/post-logo/post-logo.js +1 -1
  60. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  61. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  62. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  63. package/dist/collection/components/post-menu/post-menu.js +5 -2
  64. package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
  65. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  66. package/dist/collection/components/post-number-input/post-number-input.js +2 -2
  67. package/dist/collection/components/post-pagination/post-pagination.js +1 -2
  68. package/dist/collection/components/post-popover/post-popover.js +1 -1
  69. package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
  70. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  71. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +5 -6
  72. package/dist/collection/components/post-rating/post-rating.js +1 -1
  73. package/dist/collection/components/post-stepper/post-stepper.js +1 -1
  74. package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
  75. package/dist/collection/components/post-tab-item/post-tab-item.js +2 -3
  76. package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
  77. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  78. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  79. package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
  80. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +15 -9
  81. package/dist/collection/hydrate-stub/index.stub.js +5 -0
  82. package/dist/collection/test-setup.js +7 -0
  83. package/dist/collection/utils/index.js +2 -0
  84. package/dist/collection/utils/locales.js +9 -2
  85. package/dist/collection/utils/nanoid.js +16 -0
  86. package/dist/collection/utils/property-decorators/array-of.js +22 -0
  87. package/dist/collection/utils/property-decorators/create-validator-decorator.js +187 -0
  88. package/dist/collection/utils/property-decorators/date.js +21 -0
  89. package/dist/collection/utils/property-decorators/index.js +9 -0
  90. package/dist/collection/utils/property-decorators/iso-date.js +21 -0
  91. package/dist/collection/utils/property-decorators/one-of.js +22 -0
  92. package/dist/collection/utils/property-decorators/pattern.js +22 -0
  93. package/dist/collection/utils/property-decorators/required.js +24 -0
  94. package/dist/collection/utils/property-decorators/type.js +25 -0
  95. package/dist/collection/utils/property-decorators/url.js +29 -0
  96. package/dist/components/breakpoints.js +1 -0
  97. package/dist/components/component-on-ready.js +1 -0
  98. package/dist/components/focusable.js +1 -1
  99. package/dist/components/index2.js +1 -1
  100. package/dist/components/nanoid.js +1 -0
  101. package/dist/components/package.js +1 -1
  102. package/dist/components/post-accordion-item2.js +1 -1
  103. package/dist/components/post-accordion2.js +1 -1
  104. package/dist/components/post-autocomplete.js +1 -1
  105. package/dist/components/post-avatar.js +1 -1
  106. package/dist/components/post-avatar2.js +1 -0
  107. package/dist/components/post-back-to-top.js +1 -1
  108. package/dist/components/post-banner.js +1 -1
  109. package/dist/components/post-breadcrumb-item.js +1 -1
  110. package/dist/components/post-breadcrumbs.js +1 -1
  111. package/dist/components/post-closebutton2.js +1 -1
  112. package/dist/components/post-collapsible-trigger2.js +1 -1
  113. package/dist/components/post-collapsible2.js +1 -1
  114. package/dist/components/post-date-picker.js +1 -1
  115. package/dist/components/post-footer.js +1 -1
  116. package/dist/components/post-header.js +1 -1
  117. package/dist/components/post-icon2.js +1 -1
  118. package/dist/components/post-language-menu-item.js +1 -1
  119. package/dist/components/post-language-menu.js +1 -1
  120. package/dist/components/post-linkarea.js +1 -1
  121. package/dist/components/post-listbox-option.js +1 -1
  122. package/dist/components/post-listbox.js +1 -1
  123. package/dist/components/post-login-widget.js +1 -1
  124. package/dist/components/post-logo.js +1 -1
  125. package/dist/components/post-mainnavigation.js +1 -1
  126. package/dist/components/post-megadropdown-trigger.js +1 -1
  127. package/dist/components/post-megadropdown.js +1 -1
  128. package/dist/components/post-menu-item2.js +1 -1
  129. package/dist/components/post-menu-trigger2.js +1 -1
  130. package/dist/components/post-menu2.js +1 -1
  131. package/dist/components/post-number-input.js +1 -1
  132. package/dist/components/post-pagination.js +1 -1
  133. package/dist/components/post-popover-trigger.js +1 -1
  134. package/dist/components/post-popover.js +1 -1
  135. package/dist/components/post-popovercontainer2.js +1 -1
  136. package/dist/components/post-rating.js +1 -1
  137. package/dist/components/post-stepper-item.js +1 -1
  138. package/dist/components/post-stepper.js +1 -1
  139. package/dist/components/post-tab-item.js +1 -1
  140. package/dist/components/post-tab-panel.js +1 -1
  141. package/dist/components/post-tabs.js +1 -1
  142. package/dist/components/post-togglebutton2.js +1 -1
  143. package/dist/components/post-tooltip-trigger.js +1 -1
  144. package/dist/components/post-tooltip.js +1 -1
  145. package/dist/components/react/index.js +1 -1
  146. package/dist/components/react/p-8LXe8Zt_.js +1 -0
  147. package/dist/components/react/p-BC0-M_SK.js +1 -0
  148. package/dist/components/react/p-BQ3HlJPr.js +1 -0
  149. package/dist/components/react/p-BrY4VWTQ.js +1 -0
  150. package/dist/components/react/p-C7s9oglQ.js +1 -0
  151. package/dist/components/react/{p-Bj33xnuq.js → p-CTgZ8DGr.js} +1 -1
  152. package/dist/components/react/{p-DwJ5SwpN.js → p-CVtlwDsT.js} +1 -1
  153. package/dist/components/react/p-CaLwTf3T.js +1 -0
  154. package/dist/components/react/p-ClJyTIVM.js +1 -0
  155. package/dist/components/react/{p-B2BDAeHI.js → p-DGr-hfLq.js} +1 -1
  156. package/dist/components/react/{p-BYfHrHCb.js → p-DJxdj9pa.js} +1 -1
  157. package/dist/components/react/p-DKDEtjQe.js +1 -0
  158. package/dist/components/react/p-DPKR_4uI.js +1 -0
  159. package/dist/components/react/p-DcEDGaFs.js +1 -0
  160. package/dist/components/react/{p-DRtzK3cr.js → p-DipfA69b.js} +1 -1
  161. package/dist/components/react/{p-BbOp03Tv.js → p-DwZxAC2u.js} +1 -1
  162. package/dist/components/react/p-lpWRZjJp.js +1 -0
  163. package/dist/components/react/p-x3kxyWSZ.js +1 -0
  164. package/dist/components/react/post-accordion-item.js +1 -1
  165. package/dist/components/react/post-accordion.js +1 -1
  166. package/dist/components/react/post-autocomplete.js +1 -1
  167. package/dist/components/react/post-avatar.js +1 -1
  168. package/dist/components/react/post-back-to-top.js +1 -1
  169. package/dist/components/react/post-banner.js +1 -1
  170. package/dist/components/react/post-breadcrumb-item.js +1 -1
  171. package/dist/components/react/post-breadcrumbs.js +1 -1
  172. package/dist/components/react/post-closebutton.js +1 -1
  173. package/dist/components/react/post-collapsible-trigger.js +1 -1
  174. package/dist/components/react/post-collapsible.js +1 -1
  175. package/dist/components/react/post-date-picker.js +1 -1
  176. package/dist/components/react/post-footer.js +1 -1
  177. package/dist/components/react/post-header.js +1 -1
  178. package/dist/components/react/post-icon.js +1 -1
  179. package/dist/components/react/post-language-menu-item.js +1 -1
  180. package/dist/components/react/post-language-menu.js +1 -1
  181. package/dist/components/react/post-linkarea.js +1 -1
  182. package/dist/components/react/post-listbox-option.js +1 -1
  183. package/dist/components/react/post-listbox.js +1 -1
  184. package/dist/components/react/post-login-widget.js +1 -1
  185. package/dist/components/react/post-logo.js +1 -1
  186. package/dist/components/react/post-mainnavigation.js +1 -1
  187. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  188. package/dist/components/react/post-megadropdown.js +1 -1
  189. package/dist/components/react/post-menu-item.js +1 -1
  190. package/dist/components/react/post-menu-trigger.js +1 -1
  191. package/dist/components/react/post-menu.js +1 -1
  192. package/dist/components/react/post-number-input.js +1 -1
  193. package/dist/components/react/post-pagination.js +1 -1
  194. package/dist/components/react/post-popover-trigger.js +1 -1
  195. package/dist/components/react/post-popover.js +1 -1
  196. package/dist/components/react/post-popovercontainer.js +1 -1
  197. package/dist/components/react/post-rating.js +1 -1
  198. package/dist/components/react/post-stepper-item.js +1 -1
  199. package/dist/components/react/post-stepper.js +1 -1
  200. package/dist/components/react/post-tab-item.js +1 -1
  201. package/dist/components/react/post-tab-panel.js +1 -1
  202. package/dist/components/react/post-tabs.js +1 -1
  203. package/dist/components/react/post-togglebutton.js +1 -1
  204. package/dist/components/react/post-tooltip-trigger.js +1 -1
  205. package/dist/components/react/post-tooltip.js +1 -1
  206. package/dist/docs.json +210 -69
  207. package/dist/esm/breakpoints-BQ3HlJPr.js +202 -0
  208. package/dist/esm/component-on-ready-lpWRZjJp.js +22 -0
  209. package/dist/esm/{focusable-BD_WT2MO.js → focusable-C7afHKmo.js} +25 -5
  210. package/dist/esm/{index-DmAi35UF.js → index-DmBWUef5.js} +13 -13
  211. package/dist/esm/loader.js +3 -3
  212. package/dist/esm/nanoid-8LXe8Zt_.js +18 -0
  213. package/dist/esm/package-x3kxyWSZ.js +3 -0
  214. package/dist/esm/post-accordion_2.entry.js +6 -6
  215. package/dist/esm/post-autocomplete.entry.js +3 -3
  216. package/dist/esm/post-avatar.entry.js +6 -24
  217. package/dist/esm/post-back-to-top.entry.js +3 -3
  218. package/dist/esm/post-banner.entry.js +3 -3
  219. package/dist/esm/post-breadcrumb-item.entry.js +31 -34
  220. package/dist/esm/post-breadcrumbs.entry.js +82 -80
  221. package/dist/esm/post-closebutton_14.entry.js +31 -28
  222. package/dist/esm/post-collapsible_2.entry.js +5 -5
  223. package/dist/esm/post-components.js +3 -3
  224. package/dist/esm/post-date-picker.entry.js +15 -7
  225. package/dist/esm/post-footer.entry.js +5 -5
  226. package/dist/esm/post-linkarea.entry.js +3 -3
  227. package/dist/esm/post-listbox-option.entry.js +4 -4
  228. package/dist/esm/post-listbox.entry.js +4 -4
  229. package/dist/esm/post-login-widget.entry.js +36 -3
  230. package/dist/esm/post-number-input.entry.js +5 -5
  231. package/dist/esm/post-pagination.entry.js +4 -4
  232. package/dist/esm/post-popover-trigger.entry.js +5 -5
  233. package/dist/esm/post-popover.entry.js +4 -4
  234. package/dist/esm/post-rating.entry.js +4 -4
  235. package/dist/esm/post-stepper-item.entry.js +3 -3
  236. package/dist/esm/post-stepper.entry.js +4 -4
  237. package/dist/esm/post-tab-item.entry.js +5 -5
  238. package/dist/esm/post-tab-panel.entry.js +5 -5
  239. package/dist/esm/post-tabs.entry.js +6 -26
  240. package/dist/esm/post-tooltip-trigger.entry.js +16 -12
  241. package/dist/esm/post-tooltip.entry.js +4 -4
  242. package/dist/post-components/p-08a0e8e9.entry.js +1 -0
  243. package/dist/post-components/{p-9fab1847.entry.js → p-1583817b.entry.js} +1 -1
  244. package/dist/post-components/{p-6644e626.entry.js → p-203d9abd.entry.js} +1 -1
  245. package/dist/post-components/{p-5ade4255.entry.js → p-2c68af27.entry.js} +1 -1
  246. package/dist/post-components/{p-f88a161a.entry.js → p-39143e19.entry.js} +1 -1
  247. package/dist/post-components/p-46dd9e7e.entry.js +1 -0
  248. package/dist/post-components/{p-c95fcb40.entry.js → p-4b445a35.entry.js} +1 -1
  249. package/dist/post-components/p-53a8cce5.entry.js +1 -0
  250. package/dist/post-components/p-72bff1fc.entry.js +1 -0
  251. package/dist/post-components/{p-8b68164f.entry.js → p-75045028.entry.js} +1 -1
  252. package/dist/post-components/p-768b4516.entry.js +1 -0
  253. package/dist/post-components/{p-95df4d4e.entry.js → p-7e072450.entry.js} +1 -1
  254. package/dist/post-components/{p-0992cba9.entry.js → p-83cb6424.entry.js} +1 -1
  255. package/dist/post-components/p-8LXe8Zt_.js +1 -0
  256. package/dist/post-components/{p-d57462a3.entry.js → p-94f4da57.entry.js} +1 -1
  257. package/dist/post-components/{p-0c249c71.entry.js → p-9dace750.entry.js} +1 -1
  258. package/dist/post-components/{p-220d0eab.entry.js → p-9ea7e46f.entry.js} +1 -1
  259. package/dist/post-components/p-BQ3HlJPr.js +1 -0
  260. package/dist/post-components/p-BrY4VWTQ.js +1 -0
  261. package/dist/post-components/p-DmBWUef5.js +2 -0
  262. package/dist/post-components/{p-52f85cba.entry.js → p-a0ac814c.entry.js} +1 -1
  263. package/dist/post-components/p-a0d12ca8.entry.js +1 -0
  264. package/dist/post-components/{p-5664d5b5.entry.js → p-bab0f27f.entry.js} +1 -1
  265. package/dist/post-components/p-cb039d66.entry.js +1 -0
  266. package/dist/post-components/p-e8cda4e1.entry.js +1 -0
  267. package/dist/post-components/{p-500a3fc7.entry.js → p-e8e50d5c.entry.js} +1 -1
  268. package/dist/post-components/p-eb64ec1d.entry.js +1 -0
  269. package/dist/post-components/p-f0746a9e.entry.js +1 -0
  270. package/dist/post-components/p-f5e33714.entry.js +1 -0
  271. package/dist/post-components/{p-cca0cf23.entry.js → p-f93ce33d.entry.js} +1 -1
  272. package/dist/post-components/{p-272de102.entry.js → p-fd0446b2.entry.js} +1 -1
  273. package/dist/post-components/p-lpWRZjJp.js +1 -0
  274. package/dist/post-components/p-x3kxyWSZ.js +1 -0
  275. package/dist/post-components/post-components.css +1 -1
  276. package/dist/post-components/post-components.esm.js +1 -1
  277. package/dist/types/components/post-avatar/avatar-utils.d.ts +1 -1
  278. package/dist/types/components/post-avatar/post-avatar.d.ts +0 -8
  279. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +14 -11
  280. package/dist/types/components/post-breadcrumb-item/variants.d.ts +2 -0
  281. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +23 -25
  282. package/dist/types/components/post-footer/post-footer.d.ts +1 -0
  283. package/dist/types/components/post-login-widget/post-login-widget.d.ts +21 -2
  284. package/dist/types/components/post-menu/post-menu.d.ts +1 -1
  285. package/dist/types/components/post-popover/post-popover.d.ts +1 -1
  286. package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -1
  287. package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +1 -0
  288. package/dist/types/components.d.ts +68 -24
  289. package/dist/types/modules.d.ts +2 -0
  290. package/dist/types/utils/index.d.ts +2 -0
  291. package/dist/types/utils/nanoid.d.ts +8 -0
  292. package/dist/types/utils/property-decorators/array-of.d.ts +9 -0
  293. package/dist/types/utils/property-decorators/create-validator-decorator.d.ts +43 -0
  294. package/dist/types/utils/property-decorators/date.d.ts +6 -0
  295. package/dist/types/utils/property-decorators/index.d.ts +9 -0
  296. package/dist/types/utils/property-decorators/iso-date.d.ts +6 -0
  297. package/dist/types/utils/property-decorators/one-of.d.ts +8 -0
  298. package/dist/types/utils/property-decorators/pattern.d.ts +8 -0
  299. package/dist/types/utils/property-decorators/required.d.ts +8 -0
  300. package/dist/types/utils/property-decorators/type.d.ts +9 -0
  301. package/dist/types/utils/property-decorators/url.d.ts +6 -0
  302. package/hydrate/index.js +419 -114735
  303. package/hydrate/index.mjs +419 -114735
  304. package/hydrate/index.stub.js +5 -0
  305. package/package.json +28 -18
  306. package/dist/cjs/index-YBj3gUJp.js +0 -114540
  307. package/dist/cjs/index.browser-BVb9l9T_.js +0 -16
  308. package/dist/components/index.browser.js +0 -1
  309. package/dist/components/index3.js +0 -6
  310. package/dist/components/post-breadcrumb-item2.js +0 -1
  311. package/dist/components/react/p-B4l5EAoq.js +0 -1
  312. package/dist/components/react/p-B4tq6hiA.js +0 -1
  313. package/dist/components/react/p-CJcRbvrI.js +0 -6
  314. package/dist/components/react/p-CfQqdIV2.js +0 -1
  315. package/dist/components/react/p-D1KBbwmi.js +0 -1
  316. package/dist/components/react/p-DAIxJysJ.js +0 -1
  317. package/dist/components/react/p-De_QjSNJ.js +0 -1
  318. package/dist/components/react/p-HNUXY1z7.js +0 -1
  319. package/dist/components/react/p-PuHMz_9_.js +0 -1
  320. package/dist/components/react/p-UY924tHr.js +0 -1
  321. package/dist/components/react/p-nA1BKco0.js +0 -1
  322. package/dist/esm/index-CJcRbvrI.js +0 -114535
  323. package/dist/esm/index.browser-nA1BKco0.js +0 -14
  324. package/dist/esm/package-B4l5EAoq.js +0 -3
  325. package/dist/post-components/p-1e28d279.entry.js +0 -1
  326. package/dist/post-components/p-30e5bc99.entry.js +0 -1
  327. package/dist/post-components/p-694e76be.entry.js +0 -1
  328. package/dist/post-components/p-906b669b.entry.js +0 -1
  329. package/dist/post-components/p-92e4a7f7.entry.js +0 -1
  330. package/dist/post-components/p-B4l5EAoq.js +0 -1
  331. package/dist/post-components/p-CJcRbvrI.js +0 -6
  332. package/dist/post-components/p-DmAi35UF.js +0 -2
  333. package/dist/post-components/p-PuHMz_9_.js +0 -1
  334. package/dist/post-components/p-c70cad6e.entry.js +0 -1
  335. package/dist/post-components/p-cd6684e1.entry.js +0 -1
  336. package/dist/post-components/p-d99bdef2.entry.js +0 -1
  337. package/dist/post-components/p-dfe811cc.entry.js +0 -1
  338. package/dist/post-components/p-f14ca918.entry.js +0 -1
  339. package/dist/post-components/p-fc2882a8.entry.js +0 -1
  340. package/dist/post-components/p-nA1BKco0.js +0 -1
  341. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/language-tags.d.ts +0 -1
  342. /package/dist/types/{language-tags.js → test-setup.d.ts} +0 -0
@@ -19,7 +19,7 @@ export class PostAvatar {
19
19
  this.imageUrl = '';
20
20
  this.imageAlt = '';
21
21
  this.initials = '';
22
- // To handle email or userid updates and reset the storage item
22
+ // To handle email updates and reset the storage item
23
23
  this.storageKey = '';
24
24
  }
25
25
  validateFirstname() {
@@ -28,10 +28,6 @@ export class PostAvatar {
28
28
  validateLastname() {
29
29
  checkEmptyOrType(this, 'lastname', 'string');
30
30
  }
31
- updateUserid() {
32
- this.validateUserId();
33
- this.getAvatarImage();
34
- }
35
31
  updateEmail() {
36
32
  this.validateEmail();
37
33
  this.getAvatarImage();
@@ -39,9 +35,6 @@ export class PostAvatar {
39
35
  validateDescription() {
40
36
  checkEmptyOrType(this, 'description', 'string');
41
37
  }
42
- validateUserId() {
43
- checkEmptyOrType(this, 'userid', 'string');
44
- }
45
38
  validateEmail() {
46
39
  if (this.email)
47
40
  checkEmptyOrPattern(this, 'email', emailPattern);
@@ -51,10 +44,7 @@ export class PostAvatar {
51
44
  this.slottedImage = this.host.querySelector('img');
52
45
  const imageUrl = this.slottedImage?.getAttribute('src');
53
46
  if (!imageUrl) {
54
- if (this.userid) {
55
- imageLoaded = await this.getImageByProp(this.userid, this.fetchImageByUserId.bind(this));
56
- }
57
- if (!imageLoaded && this.email?.match(emailPattern)) {
47
+ if (this.email?.match(emailPattern)) {
58
48
  imageLoaded = await this.getImageByProp(this.email, this.fetchImageByEmail.bind(this));
59
49
  }
60
50
  if (!imageLoaded) {
@@ -93,9 +83,6 @@ export class PostAvatar {
93
83
  return true;
94
84
  }
95
85
  }
96
- async fetchImageByUserId() {
97
- return await fetch(PostAvatar.INTERNAL_USERID_IMAGE_SRC.replace('{userid}', encodeURIComponent(this.userid)));
98
- }
99
86
  async fetchImageByEmail() {
100
87
  const email = await cryptify(this.email);
101
88
  const imageUrl = GRAVATAR_BASE_URL.replace('{email}', email);
@@ -140,7 +127,6 @@ export class PostAvatar {
140
127
  this.validateFirstname();
141
128
  this.validateLastname();
142
129
  this.validateDescription();
143
- this.validateUserId();
144
130
  this.validateEmail();
145
131
  }
146
132
  render() {
@@ -150,7 +136,7 @@ export class PostAvatar {
150
136
  .join('')
151
137
  .trim();
152
138
  const fullname = names.join(' ');
153
- return (h(Host, { key: '27b541f1ac7546a3c56799c1cbf8f4347b2a0942', "data-version": version }, h("span", { key: '5652c2cec0f4455e44d73d7de22dfe53cc4baf13', class: this.avatarType === 'slotted' ? '' : 'd-none' }, h("slot", { key: 'ed8c5e541ed9ae1b43036a540327e426ef6caac4', onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && h("img", { key: 'c11bc3e761a1ea470547a32bfd74b465382fcf95', src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && (h("span", { key: '16afcb46c524440b0071d8346d7ddcc80bda0cf4', class: "initials" }, initials, h("span", { key: '99c190d5d829c0a11385dfc0fe66cbd916961813' }, this.description ?? fullname)))));
139
+ return (h(Host, { key: 'f0617cd81944692e525750d5c61a1d4ea7991b55', "data-version": version }, h("span", { key: 'ab0280fe0445ed8c97fc5bbf7d1c510cefa42621', class: this.avatarType === 'slotted' ? '' : 'd-none' }, h("slot", { key: '03737f45e5cd54f3999bbf3a9c326dd747c7ed36', onSlotchange: this.slotChanged.bind(this) })), this.avatarType === 'image' && h("img", { key: '0f4290d3b3586c68b3b33ceb44e46ba863d39f74', src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && (h("span", { key: 'e38459c13ed79df9905a69218cac303ed3fc8ff9', class: "initials" }, initials, h("span", { key: '6c47fba8605290d9cc7795c2bdbc72004f963c89' }, this.description ?? fullname)))));
154
140
  }
155
141
  static get is() { return "post-avatar"; }
156
142
  static get encapsulation() { return "shadow"; }
@@ -204,25 +190,6 @@ export class PostAvatar {
204
190
  "reflect": false,
205
191
  "attribute": "lastname"
206
192
  },
207
- "userid": {
208
- "type": "string",
209
- "mutable": false,
210
- "complexType": {
211
- "original": "string",
212
- "resolved": "string",
213
- "references": {}
214
- },
215
- "required": false,
216
- "optional": true,
217
- "docs": {
218
- "tags": [],
219
- "text": "Defines the company internal userId.<post-banner type=\"warning\" data-size=\"sm\"><p>Can only be used on post.ch domains!</p></post-banner>"
220
- },
221
- "getter": false,
222
- "setter": false,
223
- "reflect": false,
224
- "attribute": "userid"
225
- },
226
193
  "email": {
227
194
  "type": "string",
228
195
  "mutable": false,
@@ -281,9 +248,6 @@ export class PostAvatar {
281
248
  }, {
282
249
  "propName": "lastname",
283
250
  "methodName": "validateLastname"
284
- }, {
285
- "propName": "userid",
286
- "methodName": "updateUserid"
287
251
  }, {
288
252
  "propName": "email",
289
253
  "methodName": "updateEmail"
@@ -293,4 +257,3 @@ export class PostAvatar {
293
257
  }];
294
258
  }
295
259
  }
296
- PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
@@ -1 +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}}
1
+ a{-webkit-text-decoration:var(--post-core-text-decoration-underline);text-decoration:var(--post-core-text-decoration-underline);border-radius:var(--post-device-border-radius-focus);color:var(--post-current-fg)}a:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}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}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){a:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){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){a: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){a,a:focus{color:LinkText !important}a:hover{text-decoration-thickness:2px}a:visited{color:VisitedText}}:host(:not([variant=menuitem])){display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}:host(:not([variant=menuitem])) :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}:host(:not([variant=menuitem])) :is(button,a):hover{text-decoration:none}:host(:not([variant=menuitem])) :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}:host(:not([variant=menuitem])) :is(button,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}:host(:not([variant=menuitem])) :is(button,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){:host(:not([variant=menuitem])) :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host(:not([variant=menuitem])) :is(button,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){:host(:not([variant=menuitem])) :is(button,a):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(:not([variant=menuitem])) :is(button,a):is(a){color:LinkText;border:unset}:host(:not([variant=menuitem])) :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host(:not([variant=menuitem])) :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host(:not([variant=menuitem])) :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host(:not([variant=menuitem])) :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}:host(:not([variant=menuitem]))::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy0uMjIgMC0uNDUtLjA4LS42Mi0uMjZhLjg4Ljg4IDAgMCAxIDAtMS4yNGw3LjI2LTcuMjZ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b2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}:host :is(a,span){margin-block:var(--post-device-spacing-padding-block-6)}:host([selected]:not([selected=false])){display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}:host([selected]:not([selected=false])) :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}:host([selected]:not([selected=false])) :is(button,a):hover{text-decoration:none}:host([selected]:not([selected=false])) :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}:host([selected]:not([selected=false])) :is(button,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}:host([selected]:not([selected=false])) :is(button,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){:host([selected]:not([selected=false])) :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host([selected]:not([selected=false])) :is(button,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){:host([selected]:not([selected=false])) :is(button,a):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([selected]:not([selected=false])) :is(button,a):is(a){color:LinkText;border:unset}:host([selected]:not([selected=false])) :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}:host([selected]:not([selected=false])) :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}:host([selected]:not([selected=false])) :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}:host([selected]:not([selected=false])) :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}:host([selected]:not([selected=false]))::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy0uMjIgMC0uNDUtLjA4LS42Mi0uMjZhLjg4Ljg4IDAgMCAxIDAtMS4yNGw3LjI2LTcuMjZMNy40NSA0LjdhLjg4Ljg4IDAgMCAxIDAtMS4yNGMuMzQtLjM0LjktLjM0IDEuM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48L3N2Zz4=")}:host([selected]:not([selected=false])) :is(a,span){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)}:host([selected]:not([selected=false]):not([data-measuring])){align-items:start}:host([selected]:not([selected=false]):not([data-measuring])) :is(a,span){white-space:normal;overflow-wrap:anywhere}
@@ -1,42 +1,34 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { checkEmptyOrOneOf, checkEmptyOrUrl, checkRequiredAndType } from "../../utils/index";
2
2
  import { version } from "../../../../package";
3
- import { checkEmptyOrUrl } from "../../utils/index";
3
+ import { h, Host } from "@stencil/core";
4
+ import { VARIANTS } from "./variants";
4
5
  /**
5
- * @slot default - Slot for placing the text inside the breadcrumb item.
6
+ * @slot default - The content displayed inside the breadcrumb item.
6
7
  */
7
8
  export class PostBreadcrumbItem {
8
- validateUrl() {
9
- try {
10
- this.validUrl = this.constructUrl(this.url);
11
- }
12
- catch {
13
- this.validUrl = undefined;
14
- }
9
+ constructor() {
10
+ /**
11
+ * Controls how the item is rendered, either as a standard list item or within an overflow menu.
12
+ */
13
+ this.variant = 'listitem';
14
+ /**
15
+ * Indicates that the item represents the current page, applying appropriate styling.
16
+ */
17
+ this.selected = false;
15
18
  }
16
- // Helper to construct a valid URL string or return undefined
17
- constructUrl(value) {
18
- const hasBaseURL = /^https?:\/\//.test(String(this.url));
19
- if (typeof value === 'string') {
20
- this.fullUrl = hasBaseURL ? value : `${globalThis.location.origin}${value}`;
21
- checkEmptyOrUrl(this, 'fullUrl');
22
- return this.fullUrl;
23
- }
24
- return undefined;
19
+ validateURL() {
20
+ checkEmptyOrUrl(this, 'url');
25
21
  }
26
- connectedCallback() {
27
- this.validateUrl();
22
+ validateVariant() {
23
+ checkEmptyOrOneOf(this, 'variant', VARIANTS);
28
24
  }
29
- handleKeyDown(event) {
30
- if (event.key === 'Enter' || event.key === ' ') {
31
- const linkElement = this.host.shadowRoot?.querySelector('a');
32
- if (linkElement) {
33
- event.preventDefault();
34
- linkElement.click();
35
- }
36
- }
25
+ validateSelected() {
26
+ checkRequiredAndType(this, 'selected', 'boolean');
37
27
  }
38
28
  render() {
39
- return (h(Host, { key: '2b4e7426d804073e5974e3e75303e149c48b3f84', "data-version": version }, h("post-icon", { key: '03f454a41a7f4b28832b05e5d2142aaf1695aa84', name: "chevronright", class: "breadcrumb-item-icon" }), this.validUrl ? (h("a", { class: "breadcrumb-item", href: this.validUrl, onKeyDown: event => this.handleKeyDown(event), "aria-label": this.label, "aria-description": this.description }, h("slot", null))) : (h("span", { class: "breadcrumb-item" }, h("slot", null)))));
29
+ const href = this.url instanceof URL ? this.url.href : this.url;
30
+ const content = href ? (h("a", { href: href, "aria-current": this.selected ? 'page' : undefined, "aria-label": this.label, "aria-description": this.description }, h("slot", null))) : (h("span", null, h("slot", null)));
31
+ return this.variant === 'listitem' || this.selected ? (h(Host, { "data-version": version, role: "listitem", slot: this.selected ? 'selected' : undefined }, content)) : (h(Host, { "data-version": version }, h("post-menu-item", null, content)));
40
32
  }
41
33
  static get is() { return "post-breadcrumb-item"; }
42
34
  static get encapsulation() { return "shadow"; }
@@ -69,7 +61,7 @@ export class PostBreadcrumbItem {
69
61
  "optional": true,
70
62
  "docs": {
71
63
  "tags": [],
72
- "text": "The optional URL to which the breadcrumb item will link."
64
+ "text": "The destination URL for the breadcrumb item. If omitted, the item is rendered as non-interactive text."
73
65
  },
74
66
  "getter": false,
75
67
  "setter": false,
@@ -88,7 +80,7 @@ export class PostBreadcrumbItem {
88
80
  "optional": true,
89
81
  "docs": {
90
82
  "tags": [],
91
- "text": "ARIA label, screen readers will use this instead of the breadcrumb item content."
83
+ "text": "An accessible label screen readers will use this instead of the breadcrumb item content."
92
84
  },
93
85
  "getter": false,
94
86
  "setter": false,
@@ -107,25 +99,73 @@ export class PostBreadcrumbItem {
107
99
  "optional": true,
108
100
  "docs": {
109
101
  "tags": [],
110
- "text": "ARIA description for additional context, read after the breadcrumb item content or `label`."
102
+ "text": "An accessible description for additional context, read after the content or `label`."
111
103
  },
112
104
  "getter": false,
113
105
  "setter": false,
114
106
  "reflect": true,
115
107
  "attribute": "description"
108
+ },
109
+ "variant": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "Variant",
114
+ "resolved": "\"listitem\" | \"menuitem\"",
115
+ "references": {
116
+ "Variant": {
117
+ "location": "import",
118
+ "path": "./variants",
119
+ "id": "src/components/post-breadcrumb-item/variants.ts::Variant",
120
+ "referenceLocation": "Variant"
121
+ }
122
+ }
123
+ },
124
+ "required": false,
125
+ "optional": false,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": "Controls how the item is rendered, either as a standard list item or within an overflow menu."
129
+ },
130
+ "getter": false,
131
+ "setter": false,
132
+ "reflect": true,
133
+ "attribute": "variant",
134
+ "defaultValue": "'listitem'"
135
+ },
136
+ "selected": {
137
+ "type": "boolean",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "boolean",
141
+ "resolved": "boolean",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": "Indicates that the item represents the current page, applying appropriate styling."
149
+ },
150
+ "getter": false,
151
+ "setter": false,
152
+ "reflect": true,
153
+ "attribute": "selected",
154
+ "defaultValue": "false"
116
155
  }
117
156
  };
118
157
  }
119
- static get states() {
120
- return {
121
- "fullUrl": {}
122
- };
123
- }
124
158
  static get elementRef() { return "host"; }
125
159
  static get watchers() {
126
160
  return [{
127
161
  "propName": "url",
128
- "methodName": "validateUrl"
162
+ "methodName": "validateURL"
163
+ }, {
164
+ "propName": "variant",
165
+ "methodName": "validateVariant"
166
+ }, {
167
+ "propName": "selected",
168
+ "methodName": "validateSelected"
129
169
  }];
130
170
  }
131
171
  }
@@ -0,0 +1 @@
1
+ export const VARIANTS = ['listitem', 'menuitem'];
@@ -1 +1 @@
1
- :host{display:flex;align-items:center}.breadcrumbs-nav{display:flex;align-items:center}.hidden-items{position:absolute;height:0;overflow:hidden;white-space:nowrap;display:flex;flex-wrap:wrap}.hidden-items .hidden-breadcrumb-item{display:inline-flex;padding-inline-end:var(--post-device-spacing-gap-inline-4)}.hidden-items .hidden-breadcrumb-item:last-child{padding-inline-end:0;font-weight:var(--post-device-font-weight-bold)}.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-block-end: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 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}}li[aria-current=page] post-breadcrumb-item{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)}li[aria-current=page] post-breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-selected-fg1);text-decoration:none}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
1
+ :host{position:relative}nav{max-width:100%}nav.invisible{visibility:hidden;overflow:hidden;position:absolute;inset:0}[role=list]{display:flex;align-items:start;gap:var(--post-device-spacing-gap-inline-4)}.breadcrumb-item{display:flex;align-items:center;gap:var(--post-device-spacing-gap-inline-5)}.breadcrumb-item :is(button,a){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-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;display:flex;align-self:start;font:inherit;padding:unset;border:unset;color:var(--post-scheme-color-interactive-primary-enabled-fg1);border-radius:var(--post-device-border-radius-focus);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item :is(button,a):hover{text-decoration:none}.breadcrumb-item :is(button,a):disabled{border-style:var(--post-core-border-style-dash)}.breadcrumb-item :is(button,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 :is(button,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 :is(button,a):is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item :is(button,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 :is(button,a):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){.breadcrumb-item :is(button,a):is(a){color:LinkText;border:unset}.breadcrumb-item :is(button,a):is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.breadcrumb-item :is(button,a):not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.breadcrumb-item :is(button,a):not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.breadcrumb-item :is(button,a):hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item::before{mask-image:var(--post-icon-chevronright);background-color:currentColor;content:"";display:flex;height:16px;width:16px;margin-block:var(--post-device-spacing-padding-35);margin-inline:var(--post-core-dimension-4);flex-shrink:0}:root,:host{--post-icon-chevronright: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU0Ljc1NCAwIDAgMSAwLTEuMDZMOS41NyA4IDQuODUgMy4yOGMtLjI5LS4yOS0uMjktLjc3IDAtMS4wNnMuNzctLjI5IDEuMDYgMEwxMS42OSA4bC01Ljc4IDUuNzhjLS4xNS4xNS0uMzQuMjItLjUzLjIyIi8+PC9zeW1ib2w+PHN5bWJvbCBpZD0iczI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik04LjA3IDIwLjcyYy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jk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}.home::before{content:unset}.home post-icon{font-size:var(--post-core-dimension-24)}@media screen and (min-width: 0)and (max-width: 599.98px){.home post-icon{font-size:20px}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
@@ -1,25 +1,10 @@
1
1
  import { h, Host } from "@stencil/core";
2
+ import { throttle } from "throttle-debounce";
2
3
  import { version } from "../../../../package";
3
- import { checkRequiredAndUrl, debounce, checkRequiredAndType } from "../../utils/index";
4
+ import { checkRequiredAndUrl, checkRequiredAndType, componentOnReady, nanoid } from "../../utils/index";
4
5
  export class PostBreadcrumbs {
5
6
  constructor() {
6
- this.breadcrumbItems = [];
7
- // Waits for breadcrumbs navigation reference to be available
8
- this.waitForBreadcrumbsRef = debounce(() => {
9
- if (this.breadcrumbsNavRef?.clientWidth > 0) {
10
- this.checkConcatenation();
11
- }
12
- else {
13
- this.waitForBreadcrumbsRef();
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
- };
7
+ this.shouldRenderMenu = false;
23
8
  }
24
9
  validateHomeUrl() {
25
10
  checkRequiredAndUrl(this, 'homeUrl');
@@ -33,75 +18,92 @@ export class PostBreadcrumbs {
33
18
  validateTextMoreItems() {
34
19
  checkRequiredAndType(this, 'textMoreItems', 'string');
35
20
  }
21
+ componentWillLoad() {
22
+ this.id = this.host.id || `b${nanoid(6)}`;
23
+ }
36
24
  componentDidLoad() {
37
25
  this.validateHomeUrl();
38
26
  this.validateTextHome();
39
27
  this.validateTextBreadcrumbs();
40
28
  this.validateTextMoreItems();
41
- window.addEventListener('resize', this.handleResize);
42
- this.waitForBreadcrumbsRef();
29
+ this.createMutationObserver();
30
+ this.createResizeObserver();
31
+ }
32
+ disconnectedCallback() {
33
+ this.mutationObserver?.disconnect();
34
+ this.resizeObserver?.disconnect();
35
+ }
36
+ createMutationObserver() {
37
+ this.mutationObserver = new MutationObserver(this.duplicateNavElement.bind(this));
38
+ this.mutationObserver.observe(this.host, {
39
+ childList: true,
40
+ characterData: true,
41
+ subtree: true,
42
+ });
43
+ this.duplicateNavElement();
44
+ }
45
+ createResizeObserver() {
46
+ this.resizeObserver = new ResizeObserver(throttle(50, this.checkOverflow.bind(this)));
47
+ this.resizeObserver.observe(document.body);
48
+ }
49
+ /**
50
+ * To measure overflow, we duplicate the entire breadcrumb so an inline version is always available.
51
+ */
52
+ duplicateNavElement() {
53
+ const shadowRoot = this.host.shadowRoot;
54
+ const nav = shadowRoot?.querySelector('nav');
55
+ if (!shadowRoot || !nav)
56
+ return;
57
+ this.prepareBreadcrumbItemsForClone();
58
+ const clone = nav.cloneNode(true);
59
+ clone.classList.add('invisible');
60
+ shadowRoot.querySelector('nav.invisible')?.remove();
61
+ shadowRoot.append(clone);
43
62
  requestAnimationFrame(() => {
44
- this.updateBreadcrumbItems();
63
+ this.duplicateSlottedElements(clone, 'slot:not([name])');
64
+ this.duplicateSlottedElements(clone, 'slot[name="selected"]');
65
+ this.checkOverflow();
45
66
  });
46
67
  }
47
- disconnectedCallback() {
48
- window.removeEventListener('resize', this.handleResize);
49
- }
50
- // Updates breadcrumb items and sets the last item
51
- updateBreadcrumbItems() {
52
- this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(item => ({
53
- text: item.textContent || '',
54
- url: item.getAttribute('url') ?? undefined,
55
- description: item.getAttribute('description') ?? undefined,
56
- label: item.getAttribute('label') ?? undefined,
57
- }));
58
- this.lastItem = this.breadcrumbItems.at(-1);
59
- }
60
- // Determines parent width for concatenation logic
61
- getParentWidth() {
62
- let parent = this.host.parentNode;
63
- while (parent && !(parent instanceof HTMLElement)) {
64
- parent = parent.parentNode;
65
- }
66
- return parent instanceof HTMLElement ? parent.clientWidth : window.innerWidth;
67
- }
68
- checkConcatenation() {
69
- if (!this.breadcrumbsNavRef)
68
+ duplicateSlottedElements(clone, slotSelector) {
69
+ const originalSlot = this.host.shadowRoot?.querySelector(slotSelector);
70
+ const clonedSlot = clone.querySelector(slotSelector);
71
+ if (!originalSlot || !clonedSlot)
70
72
  return;
71
- const visibleWidth = this.getParentWidth();
72
- // Measure all hidden breadcrumb items
73
- const hiddenItems = Array.from(this.host.shadowRoot?.querySelectorAll('.hidden-breadcrumb-item') || []);
74
- const totalWidth = hiddenItems.reduce((accum, element) => {
75
- const rect = element.getBoundingClientRect();
76
- return accum + rect.width;
77
- }, 0);
78
- this.isConcatenated = totalWidth > visibleWidth;
79
- }
80
- // Handles breadcrumb item click to open the menu
81
- handleBreadcrumbItemClick() {
82
- if (this.host.shadowRoot) {
83
- const menuTrigger = this.host.shadowRoot
84
- ?.querySelector('.menu-trigger-wrapper')
85
- ?.querySelector('button');
86
- if (menuTrigger) {
87
- menuTrigger.click();
88
- }
89
- }
73
+ originalSlot.assignedElements().forEach(element => {
74
+ const cloned = element.cloneNode(true);
75
+ cloned.dataset.measuring = 'true';
76
+ clonedSlot.before(cloned);
77
+ });
78
+ clonedSlot.remove();
79
+ }
80
+ checkOverflow() {
81
+ const hiddenNav = this.host.shadowRoot?.querySelector('nav.invisible');
82
+ if (!hiddenNav)
83
+ return;
84
+ const breadcrumbItems = Array.from(hiddenNav.querySelectorAll('post-breadcrumb-item'));
85
+ Promise.all(breadcrumbItems.map(item => componentOnReady(item))).then(() => {
86
+ this.shouldRenderMenu = hiddenNav.scrollWidth > hiddenNav.clientWidth;
87
+ this.updateBreadcrumbItemProps();
88
+ });
89
+ }
90
+ prepareBreadcrumbItemsForClone() {
91
+ this.shouldRenderMenu = false;
92
+ this.updateBreadcrumbItemProps();
93
+ }
94
+ updateBreadcrumbItemProps() {
95
+ const breadcrumbItems = this.host.querySelectorAll('post-breadcrumb-item');
96
+ breadcrumbItems.forEach((item, index) => {
97
+ item.setAttribute('variant', this.shouldRenderMenu ? 'menuitem' : 'listitem');
98
+ item.setAttribute('selected', String(index === breadcrumbItems.length - 1));
99
+ });
100
+ }
101
+ renderMenu() {
102
+ const menuId = `${this.id}-menu`;
103
+ return (h("div", { role: "listitem" }, h("div", { class: "breadcrumb-item" }, h("post-menu-trigger", { for: menuId }, h("button", null, h("span", { class: "visually-hidden" }, this.textMoreItems), h("span", { "aria-hidden": "true" }, "...")))), h("post-menu", { id: menuId, label: this.textMoreItems, placement: "bottom-start" }, h("slot", null))));
90
104
  }
91
105
  render() {
92
- const visibleItems = this.breadcrumbItems.slice(0, -1);
93
- return (h(Host, { key: '4c0030c6896fa3bbbb26a26668a3b2cf96a110a9', "data-version": version }, h("nav", { key: '80834fa5581243a5cd081626ba743a29a2498502', "aria-label": this.textBreadcrumbs, class: "breadcrumbs-nav", ref: el => (this.breadcrumbsNavRef = el) }, h("ol", { key: '925aff0f9f19ef04e339ead446f5e4d4449b73ec', class: "no-list breadcrumbs-list" }, h("li", { key: '6dd10b7af11f6a63c27dc018dc49cdc8e85f7dcd' }, h("a", { key: '3c6db30d34a5f4d176b6127bc0ccb8fe733846af', href: this.homeUrl, class: "breadcrumb-link" }, h("span", { key: '9a78ed7042859125d32374885c0ce7426e2ff114', class: "visually-hidden" }, this.textHome), h("post-icon", { key: '096eaf22ab0f381de0b4a93a65972718101b2d4e', name: "home", class: "home-icon" }))), this.isConcatenated ? (h("li", { class: "menu-trigger-wrapper" }, h("post-icon", { name: "chevronright", class: "breadcrumb-item-icon" }), h("div", { class: "actual-menu" }, h("post-menu-trigger", { for: "breadcrumb-menu", tabIndex: 0, onKeyDown: e => {
94
- if (e.key === 'Enter' || e.key === ' ') {
95
- e.preventDefault();
96
- this.handleBreadcrumbItemClick();
97
- }
98
- } }, h("button", { class: "btn", tabIndex: -1 }, "...")), h("post-menu", { id: "breadcrumb-menu", label: this.textMoreItems }, visibleItems.map(item => (h("post-menu-item", { key: item.url || item.text, class: "breadcrumb-item", onKeyDown: e => {
99
- if (e.key === 'Enter' || e.key === ' ') {
100
- const linkElement = e.currentTarget.querySelector('a');
101
- linkElement?.click();
102
- e.preventDefault();
103
- }
104
- } }, item.url ? (h("a", { href: item.url, "aria-label": item.label, "aria-description": item.description }, item.text)) : (h("span", null, item.text))))))))) : (visibleItems.map(item => (h("li", null, h("post-breadcrumb-item", { url: item.url, label: item.label, description: item.description, key: item.url || item.text }, item.text))))), this.lastItem && (h("li", { key: '57d4678e05401a248e31559eef7562a1608c0d58', "aria-current": "page" }, h("post-breadcrumb-item", { key: 'b1be2e79473288d0755a65a0819eb2a2301a89f2', url: this.lastItem.url, label: this.lastItem.label, description: this.lastItem.description, tabindex: -1 }, this.lastItem.text)))), h("div", { key: '9eaa408234c3497176bfc116ab02f8280ff1cce7', class: "hidden-items" }, h("a", { key: 'c19fab9c610fe33b0fb980e24fe6395ee4bed8c6', href: this.homeUrl, class: "hidden-breadcrumb-item" }, h("span", { key: '9d42d66632535330307f87fdad5ba6e983b4448a', class: "visually-hidden" }, this.textHome), h("post-icon", { key: 'b7cc4122d01930d5736f6eb929a46bcd32c547e4', name: "home", class: "home-icon" })), this.breadcrumbItems.map(item => (h("post-breadcrumb-item", { url: item.url, key: `hidden-${item.url || item.text}`, label: item.label, description: item.description, class: "hidden-breadcrumb-item" }, item.text)))))));
106
+ return (h(Host, { key: '85cb104032c0caed5ab2fb442be0a6d7eac5b67a', "data-version": version }, h("nav", { key: 'be4b2b8c6333ef3bf3440de0ce61958d1a07952b', "aria-label": this.textBreadcrumbs }, h("div", { key: '28531f638065e6db5cbf7e29d87086933fb47235', role: "list" }, h("div", { key: '4a71e5b143e271e26f032e8d4ed329aee949bf32', class: "breadcrumb-item home", role: "listitem" }, h("a", { key: '3e58ac2d4bbbc2e56a7acd28119b235edadc8fa0', href: this.homeUrl }, h("span", { key: '1a31a9963898005b218177d78adbb7813728b0ce', class: "visually-hidden" }, this.textHome), h("post-icon", { key: '668a636881fbea1a7129b9108cc234c257e0fffb', "aria-hidden": "true", name: "home" }))), this.shouldRenderMenu ? this.renderMenu() : h("slot", null), h("slot", { key: '0c8bad3de95f0ca51dfd8a15c4cb6e79e2499b1b', name: "selected" })))));
105
107
  }
106
108
  static get is() { return "post-breadcrumbs"; }
107
109
  static get encapsulation() { return "shadow"; }
@@ -129,7 +131,7 @@ export class PostBreadcrumbs {
129
131
  "optional": false,
130
132
  "docs": {
131
133
  "tags": [],
132
- "text": "The URL for the home breadcrumb item."
134
+ "text": "The URL for the root (home) breadcrumb item."
133
135
  },
134
136
  "getter": false,
135
137
  "setter": false,
@@ -148,7 +150,7 @@ export class PostBreadcrumbs {
148
150
  "optional": false,
149
151
  "docs": {
150
152
  "tags": [],
151
- "text": "The text label for the home breadcrumb item."
153
+ "text": "An accessible label for the root (home) breadcrumb item."
152
154
  },
153
155
  "getter": false,
154
156
  "setter": false,
@@ -167,7 +169,7 @@ export class PostBreadcrumbs {
167
169
  "optional": false,
168
170
  "docs": {
169
171
  "tags": [],
170
- "text": "The accessible label for the breadcrumb component."
172
+ "text": "An accessible label for the breadcrumb navigation."
171
173
  },
172
174
  "getter": false,
173
175
  "setter": false,
@@ -186,7 +188,7 @@ export class PostBreadcrumbs {
186
188
  "optional": false,
187
189
  "docs": {
188
190
  "tags": [],
189
- "text": "The accessible label for the breadcrumb menu when breadcrumb items are concatenated."
191
+ "text": "An accessible label for the overflow menu that contains collapsed breadcrumb items."
190
192
  },
191
193
  "getter": false,
192
194
  "setter": false,
@@ -197,9 +199,8 @@ export class PostBreadcrumbs {
197
199
  }
198
200
  static get states() {
199
201
  return {
200
- "breadcrumbItems": {},
201
- "isConcatenated": {},
202
- "lastWindowWidth": {}
202
+ "shouldRenderMenu": {},
203
+ "id": {}
203
204
  };
204
205
  }
205
206
  static get elementRef() { return "host"; }
@@ -54,7 +54,7 @@ export class PostClosebutton {
54
54
  }
55
55
  }
56
56
  render() {
57
- return (h(Host, { key: '33c801f2e342363d6361f19e65793a4164d45f81', "data-version": version }, h("button", { key: '2fa8ae3a3e57cc971a99648d66612e13bc526e92', type: this.buttonType, class: "btn btn-icon btn-secondary btn-sm" }, h("post-icon", { key: '5ac2821cdd342115e73b13f692bd7180edab82a8', "aria-hidden": "true", name: "closex" }), h("span", { key: '5eb97879647ef8c866bfdf6cd0819477a13907bc', class: "visually-hidden" }, h("slot", { key: '80eac1979c78526078d57a8398e04824420b7983' })))));
57
+ return (h(Host, { key: 'ae74db094a2b1de985564d3f7528f78a98fd7ce9', "data-version": version }, h("button", { key: '7bab137e2dab6b3b405f486c10b3bbfbecdebafa', type: this.buttonType, class: "btn btn-icon btn-secondary btn-sm" }, h("post-icon", { key: 'ed323a3c13211f234551957a498f678e18ff4f66', "aria-hidden": "true", name: "closex" }), h("span", { key: 'aad44b5c93d357fab3d7cf537f477abd7c89f9be', class: "visually-hidden" }, h("slot", { key: 'd8424ae25100fc673188e3c77f89abe95847a38a' })))));
58
58
  }
59
59
  static get is() { return "post-closebutton"; }
60
60
  static get originalStyleUrls() {
@@ -53,7 +53,7 @@ export class PostCollapsible {
53
53
  triggers.forEach(trigger => trigger.update());
54
54
  }
55
55
  render() {
56
- return (h(Host, { key: '79ec1a3eb11225a93f5e5b6da7334d20d5e4b565', "data-version": version, tabindex: this.collapsed ? -1 : undefined, style: this.collapsed ? collapsedKeyframe : undefined }, h("slot", { key: 'baff34fc9b45aec4c3fb0f74ad676ea1237c7d23' })));
56
+ return (h(Host, { key: 'd376f9ca2621660a062f3cb5ea0164df088d9e8e', "data-version": version, tabindex: this.collapsed ? -1 : undefined, style: this.collapsed ? collapsedKeyframe : undefined }, h("slot", { key: '1debe186e172e978b8a32388a0f5b26eb2a602b3' })));
57
57
  }
58
58
  static get is() { return "post-collapsible"; }
59
59
  static get encapsulation() { return "shadow"; }
@@ -97,7 +97,7 @@ export class PostCollapsibleTrigger {
97
97
  this.updateAriaAttributes();
98
98
  }
99
99
  render() {
100
- return (h(Host, { key: 'a4d1613dc3cbcfa627f920275eb3508939b63609', "data-version": version }, h("slot", { key: 'baa22c46a7a982afcd09253daa95f68f1709d509' })));
100
+ return (h(Host, { key: 'f5055d5970eb900d345957f306c9a373680f257a', "data-version": version }, h("slot", { key: 'cf63bdbca00602b9c4e2a81f28723bd274561045' })));
101
101
  }
102
102
  static get is() { return "post-collapsible-trigger"; }
103
103
  static get encapsulation() { return "shadow"; }