@swisspost/design-system-components 10.5.0 → 10.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/{create-validator-decorator-u-Byhihe.js → create-validator-decorator-D7nAb9KJ.js} +1 -1
  3. package/dist/cjs/{index-CXnlZiX8.js → index-DWIlRT6N.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{one-of-LGG0uEIi.js → one-of-B8RUgrZk.js} +1 -1
  6. package/dist/cjs/{package-DdU-rENe.js → package-BtKYhTNj.js} +1 -1
  7. package/dist/cjs/{pattern-B-csvfNt.js → pattern-B6VoDk_m.js} +1 -1
  8. package/dist/cjs/post-accordion_2.cjs.entry.js +5 -5
  9. package/dist/cjs/post-autocomplete.cjs.entry.js +5 -5
  10. package/dist/cjs/post-avatar.cjs.entry.js +6 -6
  11. package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
  12. package/dist/cjs/post-banner.cjs.entry.js +4 -4
  13. package/dist/cjs/post-breadcrumb-item.cjs.entry.js +32 -10
  14. package/dist/cjs/post-breadcrumbs.cjs.entry.js +158 -58
  15. package/dist/cjs/post-closebutton_14.cjs.entry.js +63 -53
  16. package/dist/cjs/post-collapsible_2.cjs.entry.js +7 -7
  17. package/dist/cjs/post-components.cjs.js +2 -2
  18. package/dist/cjs/post-date-picker.cjs.entry.js +38 -34
  19. package/dist/cjs/post-footer.cjs.entry.js +8 -8
  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 +3 -3
  23. package/dist/cjs/post-number-input.cjs.entry.js +4 -4
  24. package/dist/cjs/post-pagination.cjs.entry.js +5 -5
  25. package/dist/cjs/post-popover-trigger.cjs.entry.js +6 -6
  26. package/dist/cjs/post-popover.cjs.entry.js +9 -9
  27. package/dist/cjs/post-progressbar.cjs.entry.js +4 -4
  28. package/dist/cjs/post-rating.cjs.entry.js +6 -6
  29. package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +6 -6
  30. package/dist/cjs/post-side-navigation.cjs.entry.js +7 -7
  31. package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
  32. package/dist/cjs/post-stepper.cjs.entry.js +7 -7
  33. package/dist/cjs/post-tab-item.cjs.entry.js +6 -6
  34. package/dist/cjs/post-tab-panel.cjs.entry.js +6 -6
  35. package/dist/cjs/post-tabs.cjs.entry.js +8 -8
  36. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -7
  37. package/dist/cjs/post-tooltip.cjs.entry.js +5 -5
  38. package/dist/cjs/{required-bJzxBV-V.js → required-bXtlqqaA.js} +1 -1
  39. package/dist/cjs/{type-CGPnqGY1.js → type-BqLE7Uui.js} +1 -1
  40. package/dist/cjs/{url-Dxdd6tWj.js → url-CUy3C3sH.js} +1 -1
  41. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
  42. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +30 -3
  43. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
  44. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +184 -57
  45. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  46. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  47. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +2 -2
  48. package/dist/collection/components/post-date-picker/native-mask-element.js +1 -1
  49. package/dist/collection/components/post-date-picker/post-date-picker.js +31 -29
  50. package/dist/collection/components/post-footer/post-footer.css +1 -1
  51. package/dist/collection/components/post-footer/post-footer.js +2 -2
  52. package/dist/collection/components/post-header/post-header.css +1 -1
  53. package/dist/collection/components/post-header/post-header.js +14 -8
  54. package/dist/collection/components/post-icon/post-icon.js +1 -1
  55. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  56. package/dist/collection/components/post-listbox/post-listbox.js +1 -1
  57. package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
  58. package/dist/collection/components/post-logo/post-logo.js +1 -1
  59. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  60. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  61. package/dist/collection/components/post-megadropdown/post-megadropdown.js +3 -3
  62. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  63. package/dist/collection/components/post-menu/post-menu.js +1 -1
  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-popover/post-popover.js +3 -3
  68. package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +2 -2
  69. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -22
  70. package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
  71. package/dist/collection/components/post-rating/post-rating.js +1 -1
  72. package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
  73. package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
  74. package/dist/collection/components/post-stepper/post-stepper.js +1 -1
  75. package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
  76. package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
  77. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  78. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  79. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  80. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  81. package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
  82. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +2 -2
  83. package/dist/collection/utils/floating-ui.js +1 -1
  84. package/dist/components/package.js +1 -1
  85. package/dist/components/post-breadcrumb-item.js +1 -1
  86. package/dist/components/post-breadcrumbs.js +1 -1
  87. package/dist/components/post-closebutton2.js +1 -1
  88. package/dist/components/post-collapsible-trigger2.js +1 -1
  89. package/dist/components/post-collapsible2.js +1 -1
  90. package/dist/components/post-date-picker.js +1 -1
  91. package/dist/components/post-footer.js +1 -1
  92. package/dist/components/post-header.js +1 -1
  93. package/dist/components/post-icon2.js +1 -1
  94. package/dist/components/post-linkarea.js +1 -1
  95. package/dist/components/post-listbox-option.js +1 -1
  96. package/dist/components/post-listbox.js +1 -1
  97. package/dist/components/post-logo.js +1 -1
  98. package/dist/components/post-mainnavigation.js +1 -1
  99. package/dist/components/post-megadropdown-trigger.js +1 -1
  100. package/dist/components/post-megadropdown.js +1 -1
  101. package/dist/components/post-menu-item2.js +1 -1
  102. package/dist/components/post-menu-trigger2.js +1 -1
  103. package/dist/components/post-menu2.js +1 -1
  104. package/dist/components/post-number-input.js +1 -1
  105. package/dist/components/post-popover-trigger.js +1 -1
  106. package/dist/components/post-popover.js +1 -1
  107. package/dist/components/post-popovercontainer2.js +1 -1
  108. package/dist/components/post-progressbar.js +1 -1
  109. package/dist/components/post-rating.js +1 -1
  110. package/dist/components/post-side-navigation-trigger.js +1 -1
  111. package/dist/components/post-side-navigation.js +1 -1
  112. package/dist/components/post-stepper-item.js +1 -1
  113. package/dist/components/post-stepper.js +1 -1
  114. package/dist/components/post-tab-item.js +1 -1
  115. package/dist/components/post-tab-panel.js +1 -1
  116. package/dist/components/post-tabs.js +1 -1
  117. package/dist/components/post-togglebutton2.js +1 -1
  118. package/dist/components/post-tooltip-trigger.js +1 -1
  119. package/dist/components/post-tooltip.js +1 -1
  120. package/dist/components/react/index.js +1 -1
  121. package/dist/components/react/{p-CLeWLMJn.js → p-1y1rv5Tw.js} +1 -1
  122. package/dist/components/react/{p-D3rq_-Qk.js → p-BBv5JYsW.js} +1 -1
  123. package/dist/components/react/p-BBz9PVf0.js +1 -0
  124. package/dist/components/react/{p-DasK590W.js → p-BgEY7xhT.js} +1 -1
  125. package/dist/components/react/{p-DiFAKI9o.js → p-C3J7fIWx.js} +1 -1
  126. package/dist/components/react/p-C5ibTdH5.js +1 -0
  127. package/dist/components/react/{p-DD-Sl3Ji.js → p-C8_zqgAP.js} +1 -1
  128. package/dist/components/react/{p-PYoaz_Xl.js → p-CUKzje9q.js} +1 -1
  129. package/dist/components/react/{p-C8vlYfD-.js → p-DS46v3ju.js} +1 -1
  130. package/dist/components/react/{p-CoCua20S.js → p-DTBtJCjk.js} +1 -1
  131. package/dist/components/react/{p-CuVhOs8F.js → p-XUkUhxaz.js} +1 -1
  132. package/dist/components/react/p-ialuSSl2.js +1 -0
  133. package/dist/components/react/post-accordion-item.js +1 -1
  134. package/dist/components/react/post-accordion.js +1 -1
  135. package/dist/components/react/post-autocomplete.js +1 -1
  136. package/dist/components/react/post-avatar.js +1 -1
  137. package/dist/components/react/post-back-to-top.js +1 -1
  138. package/dist/components/react/post-banner.js +1 -1
  139. package/dist/components/react/post-breadcrumb-item.js +1 -1
  140. package/dist/components/react/post-breadcrumbs.js +1 -1
  141. package/dist/components/react/post-closebutton.js +1 -1
  142. package/dist/components/react/post-collapsible-trigger.js +1 -1
  143. package/dist/components/react/post-collapsible.js +1 -1
  144. package/dist/components/react/post-date-picker.js +1 -1
  145. package/dist/components/react/post-footer.js +1 -1
  146. package/dist/components/react/post-header.js +1 -1
  147. package/dist/components/react/post-icon.js +1 -1
  148. package/dist/components/react/post-language-menu-item.js +1 -1
  149. package/dist/components/react/post-language-menu.js +1 -1
  150. package/dist/components/react/post-linkarea.js +1 -1
  151. package/dist/components/react/post-listbox-option.js +1 -1
  152. package/dist/components/react/post-listbox.js +1 -1
  153. package/dist/components/react/post-logo.js +1 -1
  154. package/dist/components/react/post-mainnavigation.js +1 -1
  155. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  156. package/dist/components/react/post-megadropdown.js +1 -1
  157. package/dist/components/react/post-menu-item.js +1 -1
  158. package/dist/components/react/post-menu-trigger.js +1 -1
  159. package/dist/components/react/post-menu.js +1 -1
  160. package/dist/components/react/post-number-input.js +1 -1
  161. package/dist/components/react/post-pagination.js +1 -1
  162. package/dist/components/react/post-popover-trigger.js +1 -1
  163. package/dist/components/react/post-popover.js +1 -1
  164. package/dist/components/react/post-popovercontainer.js +1 -1
  165. package/dist/components/react/post-progressbar.js +1 -1
  166. package/dist/components/react/post-rating.js +1 -1
  167. package/dist/components/react/post-side-navigation-trigger.js +1 -1
  168. package/dist/components/react/post-side-navigation.js +1 -1
  169. package/dist/components/react/post-stepper-item.js +1 -1
  170. package/dist/components/react/post-stepper.js +1 -1
  171. package/dist/components/react/post-tab-item.js +1 -1
  172. package/dist/components/react/post-tab-panel.js +1 -1
  173. package/dist/components/react/post-tabs.js +1 -1
  174. package/dist/components/react/post-togglebutton.js +1 -1
  175. package/dist/components/react/post-tooltip-trigger.js +1 -1
  176. package/dist/components/react/post-tooltip.js +1 -1
  177. package/dist/docs.json +57 -12
  178. package/dist/esm/{create-validator-decorator-CbYxqPSB.js → create-validator-decorator-DFpQtJzK.js} +1 -1
  179. package/dist/esm/{index-D3NdvMgy.js → index-Bs0zeM5Q.js} +1 -1
  180. package/dist/esm/loader.js +3 -3
  181. package/dist/esm/{one-of-Mx4vYjem.js → one-of-DQCfaZpw.js} +1 -1
  182. package/dist/esm/{package-Ny5VnydI.js → package-BBz9PVf0.js} +1 -1
  183. package/dist/esm/{pattern-CqQVrJPN.js → pattern-3lnaFlkk.js} +1 -1
  184. package/dist/esm/post-accordion_2.entry.js +5 -5
  185. package/dist/esm/post-autocomplete.entry.js +5 -5
  186. package/dist/esm/post-avatar.entry.js +6 -6
  187. package/dist/esm/post-back-to-top.entry.js +5 -5
  188. package/dist/esm/post-banner.entry.js +4 -4
  189. package/dist/esm/post-breadcrumb-item.entry.js +32 -10
  190. package/dist/esm/post-breadcrumbs.entry.js +158 -58
  191. package/dist/esm/post-closebutton_14.entry.js +63 -53
  192. package/dist/esm/post-collapsible_2.entry.js +7 -7
  193. package/dist/esm/post-components.js +3 -3
  194. package/dist/esm/post-date-picker.entry.js +38 -34
  195. package/dist/esm/post-footer.entry.js +8 -8
  196. package/dist/esm/post-linkarea.entry.js +3 -3
  197. package/dist/esm/post-listbox-option.entry.js +4 -4
  198. package/dist/esm/post-listbox.entry.js +3 -3
  199. package/dist/esm/post-number-input.entry.js +4 -4
  200. package/dist/esm/post-pagination.entry.js +5 -5
  201. package/dist/esm/post-popover-trigger.entry.js +6 -6
  202. package/dist/esm/post-popover.entry.js +9 -9
  203. package/dist/esm/post-progressbar.entry.js +4 -4
  204. package/dist/esm/post-rating.entry.js +6 -6
  205. package/dist/esm/post-side-navigation-trigger.entry.js +6 -6
  206. package/dist/esm/post-side-navigation.entry.js +7 -7
  207. package/dist/esm/post-stepper-item.entry.js +3 -3
  208. package/dist/esm/post-stepper.entry.js +7 -7
  209. package/dist/esm/post-tab-item.entry.js +6 -6
  210. package/dist/esm/post-tab-panel.entry.js +6 -6
  211. package/dist/esm/post-tabs.entry.js +8 -8
  212. package/dist/esm/post-tooltip-trigger.entry.js +7 -7
  213. package/dist/esm/post-tooltip.entry.js +5 -5
  214. package/dist/esm/{required-CxvSCYJj.js → required-NuzPg5jZ.js} +1 -1
  215. package/dist/esm/{type-CYB7_Yi8.js → type-ChnksJ25.js} +1 -1
  216. package/dist/esm/{url-DOwgyBfp.js → url-BCk3ZU-x.js} +1 -1
  217. package/dist/post-components/{p-c7a39444.entry.js → p-10e430c3.entry.js} +1 -1
  218. package/dist/post-components/{p-e463e7ac.entry.js → p-31550a50.entry.js} +1 -1
  219. package/dist/post-components/{p-2cb843f4.entry.js → p-31a97aae.entry.js} +1 -1
  220. package/dist/post-components/p-32e1e951.entry.js +1 -0
  221. package/dist/post-components/{p-b856263a.entry.js → p-43240818.entry.js} +1 -1
  222. package/dist/post-components/{p-44718c1a.entry.js → p-451ec8ee.entry.js} +1 -1
  223. package/dist/post-components/{p-2379e498.entry.js → p-4f08b99b.entry.js} +1 -1
  224. package/dist/post-components/{p-5a44b217.entry.js → p-54432b47.entry.js} +1 -1
  225. package/dist/post-components/{p-e7f97f6d.entry.js → p-58b66607.entry.js} +1 -1
  226. package/dist/post-components/{p-1d67c427.entry.js → p-5d7de657.entry.js} +1 -1
  227. package/dist/post-components/p-61a45246.entry.js +1 -0
  228. package/dist/post-components/p-63dd9a76.entry.js +1 -0
  229. package/dist/post-components/{p-665d877f.entry.js → p-63e570c4.entry.js} +1 -1
  230. package/dist/post-components/{p-ffec1880.entry.js → p-64480e3a.entry.js} +1 -1
  231. package/dist/post-components/p-6a2f47af.entry.js +1 -0
  232. package/dist/post-components/p-96d07f2b.entry.js +1 -0
  233. package/dist/post-components/p-9a1e8b1d.entry.js +1 -0
  234. package/dist/post-components/p-BBz9PVf0.js +1 -0
  235. package/dist/post-components/p-Bl-_v3aT.js +1 -0
  236. package/dist/post-components/p-Bs0zeM5Q.js +2 -0
  237. package/dist/post-components/{p-sgCfAEQU.js → p-BwhzbRIR.js} +1 -1
  238. package/dist/post-components/p-D1s6tESz.js +1 -0
  239. package/dist/post-components/p-DH-eJVHZ.js +1 -0
  240. package/dist/post-components/p-DeUk3rcv.js +1 -0
  241. package/dist/post-components/p-Dk-DtPZn.js +1 -0
  242. package/dist/post-components/p-aa33141b.entry.js +1 -0
  243. package/dist/post-components/p-aff180f5.entry.js +1 -0
  244. package/dist/post-components/{p-781efeb8.entry.js → p-bd128657.entry.js} +1 -1
  245. package/dist/post-components/{p-b6e231a8.entry.js → p-c2de3702.entry.js} +1 -1
  246. package/dist/post-components/{p-4e2bb082.entry.js → p-d5327dd1.entry.js} +1 -1
  247. package/dist/post-components/{p-030bfaa1.entry.js → p-e1817744.entry.js} +1 -1
  248. package/dist/post-components/{p-e8c19f72.entry.js → p-e6a4146b.entry.js} +1 -1
  249. package/dist/post-components/{p-e8268a8d.entry.js → p-f275b872.entry.js} +1 -1
  250. package/dist/post-components/{p-894b20dd.entry.js → p-f566768e.entry.js} +1 -1
  251. package/dist/post-components/{p-2ee255c1.entry.js → p-f6da5e69.entry.js} +1 -1
  252. package/dist/post-components/{p-a9223467.entry.js → p-f784e149.entry.js} +1 -1
  253. package/dist/post-components/p-f917527c.entry.js +1 -0
  254. package/dist/post-components/post-components.css +2 -2
  255. package/dist/post-components/post-components.esm.js +1 -1
  256. package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +8 -1
  257. package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +39 -22
  258. package/dist/types/components/post-date-picker/post-date-picker.d.ts +2 -1
  259. package/dist/types/components/post-header/post-header.d.ts +3 -1
  260. package/dist/types/components.d.ts +18 -7
  261. package/hydrate/index.js +308 -165
  262. package/hydrate/index.mjs +308 -165
  263. package/package.json +28 -20
  264. package/dist/components/react/p-0nNMdSBr.js +0 -1
  265. package/dist/components/react/p-Ny5VnydI.js +0 -1
  266. package/dist/components/react/p-SBBBSmJM.js +0 -1
  267. package/dist/post-components/p-29e6c2a4.entry.js +0 -1
  268. package/dist/post-components/p-3a75186d.entry.js +0 -1
  269. package/dist/post-components/p-65e12f2c.entry.js +0 -1
  270. package/dist/post-components/p-795eb5ad.entry.js +0 -1
  271. package/dist/post-components/p-9ad2216e.entry.js +0 -1
  272. package/dist/post-components/p-BmpkvdQk.js +0 -1
  273. package/dist/post-components/p-C-FunIfQ.js +0 -1
  274. package/dist/post-components/p-CCciE4QO.js +0 -1
  275. package/dist/post-components/p-D3NdvMgy.js +0 -2
  276. package/dist/post-components/p-Ny5VnydI.js +0 -1
  277. package/dist/post-components/p-X1vWfzMK.js +0 -1
  278. package/dist/post-components/p-cGcyMrvx.js +0 -1
  279. package/dist/post-components/p-cde00944.entry.js +0 -1
  280. package/dist/post-components/p-cf7493ab.entry.js +0 -1
  281. package/dist/post-components/p-ecfc494e.entry.js +0 -1
  282. package/dist/post-components/p-eda4a376.entry.js +0 -1
@@ -1,15 +1,15 @@
1
- import { r as registerInstance, h, H as Host, a as getElement } from './index-D3NdvMgy.js';
1
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-Bs0zeM5Q.js';
2
2
  import './breakpoints-I1j7a0bW.js';
3
3
  import { c as componentOnReady } from './component-on-ready-lpWRZjJp.js';
4
4
  import { n as nanoid } from './nanoid-8LXe8Zt_.js';
5
- import { v as version } from './package-Ny5VnydI.js';
5
+ import { v as version } from './package-BBz9PVf0.js';
6
6
  import { t as throttle } from './index-bR8vy6-s.js';
7
- import { R as Required } from './required-CxvSCYJj.js';
8
- import { U as Url } from './url-DOwgyBfp.js';
9
- import { T as Type } from './type-CYB7_Yi8.js';
10
- import './create-validator-decorator-CbYxqPSB.js';
7
+ import { R as Required } from './required-NuzPg5jZ.js';
8
+ import { U as Url } from './url-BCk3ZU-x.js';
9
+ import { T as Type } from './type-ChnksJ25.js';
10
+ import './create-validator-decorator-DFpQtJzK.js';
11
11
 
12
- const postBreadcrumbsCss = () => `:host{display:block;position:relative}nav{max-width:100%}nav.invisible{overflow:hidden;visibility:hidden;position:absolute;inset:0}nav.loading>div>:not(.home){display:none}[role=list]{display:flex;align-items:flex-start;gap:var(--post-device-spacing-gap-inline-4)}.breadcrumb-item{display:flex;align-items:flex-start;padding-block:var(--post-device-spacing-padding-block-6);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-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;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):not(:disabled):hover{text-decoration:none}.breadcrumb-item :is(button,a):disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.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){border-width:1px !important;transition:none}.breadcrumb-item :is(button,a):is(button){background-color:ButtonFace !important;border-color:ButtonBorder !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;flex:0 0 auto;content:"";display:block;height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4);margin-block:calc(var(--post-device-spacing-padding-35) - 1*var(--post-device-spacing-padding-block-6));margin-inline:var(--post-core-dimension-4)}:root,:host{--post-icon-chevronright:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxkZWZzPjxzeW1ib2wgaWQ9ImktY2hldnJvbnJpZ2h0Ij48c3ltYm9sIGlkPSJzMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTUuMzggMTRjLS4xOSAwLS4zOC0uMDctLjUzLS4yMmEuNzU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4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}.home{padding-block:var(--post-device-spacing-padding-47)}.home::before{content:unset}.home post-icon{width:var(--post-device-sizing-interactive-icon-size2);height:var(--post-device-sizing-interactive-icon-size2)}.menu{margin-inline-end:calc(-1*var(--post-device-spacing-gap-inline-4))}.menu.empty{display:none}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
12
+ const postBreadcrumbsCss = () => `:host{display:block;position:relative}nav{max-width:100%}nav.invisible{overflow:hidden;visibility:hidden;position:absolute;inset:0}nav.loading>div>:not(.home){display:none}[role=list]{display:flex;align-items:flex-start;gap:var(--post-device-spacing-gap-inline-4)}[role=list]>.menu:first-child::before{content:none}.breadcrumb-item{display:flex;align-items:flex-start;padding-block:var(--post-device-spacing-padding-block-6);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-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;font:inherit;padding:unset;border:unset;border-radius:var(--post-device-border-radius-focus);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item :is(button,a):not(:disabled):hover{text-decoration:none}.breadcrumb-item :is(button,a):disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.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){border-width:1px !important;transition:none}.breadcrumb-item :is(button,a):is(button){background-color:ButtonFace !important;border-color:ButtonBorder !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;flex:0 0 auto;content:"";display:block;height:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4);margin-block:calc(var(--post-device-spacing-padding-35) - 1*var(--post-device-spacing-padding-block-6));margin-inline:var(--post-core-dimension-4)}:root,:host{--post-icon-chevronright:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0i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OiB2YXIoLS1zNjQsIG5vbmUpIiBocmVmPSIjczY0Ii8+PC9zeW1ib2w+PC9kZWZzPjxzdHlsZT5AbWVkaWEgKG1heC13aWR0aDogMjMuOThweCkge2d7LS1zMTY6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogMjRweCkgYW5kIChtYXgtd2lkdGg6IDMxLjk4cHgpIHtney0tczI0OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDMycHgpIGFuZCAobWF4LXdpZHRoOiAzOS45OHB4KSB7Z3stLXMzMjpibG9jazt9fUBtZWRpYSAobWluLXdpZHRoOiA0MHB4KSBhbmQgKG1heC13aWR0aDogNDcuOThweCkge2d7LS1zNDA6YmxvY2s7fX1AbWVkaWEgKG1pbi13aWR0aDogNDhweCkgYW5kIChtYXgtd2lkdGg6IDYzLjk4cHgpIHtney0tczQ4OmJsb2NrO319QG1lZGlhIChtaW4td2lkdGg6IDY0cHgpIHtney0tczY0OmJsb2NrO319PC9zdHlsZT48Zz48dXNlIGhyZWY9IiNpLWNoZXZyb25yaWdodCIvPjwvZz48L3N2Zz4=")}post-menu-item>slot[name=home]>a{position:relative;display:flex;align-items:center;padding:8px 12px 8px 16px;gap:12px;font-size:.875rem;color:#050400;border-radius:0;text-decoration:none;min-width:0;white-space:normal;overflow:visible;text-overflow:unset;justify-content:start;overflow-wrap:anywhere;hyphens:auto;line-break:strict}@media screen and (min-width: 780px){post-menu-item>slot[name=home]>a{font-size:1rem;padding-block:12px;gap:16px}}@media screen and (min-width: 1024px){post-menu-item>slot[name=home]>a{font-size:1.25rem;padding-block:13px}}post-menu-item>slot[name=home]>a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item>slot[name=home]>a:hover{background-color:#504f4b;color:#fff}.home{flex:none}.home::before{content:unset}.home.icon{padding-block:var(--post-device-spacing-padding-47)}.home.icon post-icon{width:var(--post-device-sizing-interactive-icon-size2);height:var(--post-device-sizing-interactive-icon-size2)}.menu{margin-inline-end:calc(-1*var(--post-device-spacing-gap-inline-4))}.menu.empty{display:none}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}`;
13
13
 
14
14
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15
15
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -28,17 +28,33 @@ const PostBreadcrumbs = class {
28
28
  registerInstance(this, hostRef);
29
29
  this.debounceUpdateCollapsedItems = throttle(MEASUREMENT_DEBOUNCE_MS, this.updateCollapsedItems.bind(this));
30
30
  this.resizeObserver = new ResizeObserver(this.debounceUpdateCollapsedItems);
31
- this.mutationObserver = new MutationObserver(this.updateHiddenNav.bind(this));
31
+ this.mutationObserver = new MutationObserver(() => {
32
+ void this.updateAfterMutation();
33
+ });
32
34
  this.loaded = false;
33
- /** The number of breadcrumb items, counted from the start, that are moved into the overflow menu. */
35
+ /** Whether the consumer slotted their own `<a>` into the `home` slot. When true, `home-url` is not required, since the internal fallback link is not rendered. */
36
+ this.hasSlottedHomeAnchor = false;
37
+ /** Whether the slotted home anchor contains a post-icon. */
38
+ this.hasSlottedHomeIcon = false;
39
+ /** The number of breadcrumb items, counted from the start, moved into the overflow menu. */
34
40
  this.collapsed = 0;
41
+ /** Whether the home item is collapsed into its own overflow menu. */
42
+ this.homeCollapsed = false;
43
+ /** Whether the last (selected) item wraps onto multiple lines. */
44
+ this.lastItemWraps = false;
35
45
  /** The visible breadcrumb navigation. */
36
46
  this.nav = null;
37
47
  /** An off-screen copy of the breadcrumb navigation used for measurement. */
38
48
  this.hiddenNav = null;
49
+ /**
50
+ * Whether `text-home` content is displayed instead of the home icon, enabling segment specific
51
+ * breadcrumbs (like "Private customers" or "About us").
52
+ */
53
+ this.homeTextOnly = false;
39
54
  }
40
55
  componentWillLoad() {
41
56
  this.id = this.host.id || `b${nanoid(6)}`;
57
+ this.checkSlottedHomeAnchor();
42
58
  }
43
59
  async componentDidLoad() {
44
60
  this.resizeObserver?.observe(document.body);
@@ -56,69 +72,95 @@ const PostBreadcrumbs = class {
56
72
  this.mutationObserver?.disconnect();
57
73
  this.debounceUpdateCollapsedItems.cancel();
58
74
  }
59
- /**
60
- * Measures the space available in the breadcrumb navigation and moves the items that do not fit
61
- * into the overflow menu.
62
- */
75
+ checkSlottedHomeAnchor() {
76
+ const homeSlotElement = Array.from(this.host.children).find(child => child.getAttribute('slot') === 'home');
77
+ this.hasSlottedHomeAnchor = homeSlotElement?.tagName === 'A';
78
+ this.hasSlottedHomeIcon =
79
+ this.hasSlottedHomeAnchor && !!homeSlotElement?.querySelector('post-icon');
80
+ }
81
+ get usesHomeText() {
82
+ return this.hasSlottedHomeAnchor ? !this.hasSlottedHomeIcon : this.homeTextOnly;
83
+ }
84
+ // Degrade order: collapse middle items -> collapse home -> wrap the last item.
85
+ /** Measures the available space and updates all three degrade-stage states. */
63
86
  async updateCollapsedItems() {
64
87
  if (!this.nav)
65
88
  return;
66
- this.collapsed = await this.calculateCollapsedItems();
89
+ const { overflowing, homeOverflows, lastItemWraps } = await this.calculateCollapsedItems();
90
+ this.collapsed = overflowing;
91
+ this.homeCollapsed = homeOverflows;
92
+ this.lastItemWraps = lastItemWraps;
67
93
  }
68
- /**
69
- * Determines how many items have to be collapsed, either because they do not fit the breadcrumb
70
- * navigation or because they exceed the maximum number of visible items.
71
- */
72
94
  async calculateCollapsedItems() {
73
95
  const items = this.host.querySelectorAll('post-breadcrumb-item');
74
- const overflowing = await this.calculateOverflowingItems();
96
+ const { overflowing, homeOverflows, lastItemWraps } = await this.calculateOverflowingItems();
75
97
  // Never show more than `MAX_VISIBLE_ITEMS`, even if the nav is wide enough to fit them all.
76
- return Math.max(overflowing, items.length - MAX_VISIBLE_ITEMS);
98
+ return {
99
+ overflowing: Math.max(overflowing, items.length - MAX_VISIBLE_ITEMS),
100
+ homeOverflows,
101
+ lastItemWraps,
102
+ };
77
103
  }
78
- /**
79
- * Determines how many items overflow the width of the breadcrumb navigation.
80
- */
104
+ /** Runs the three degrade stages in order against the off-screen measurement clone. */
81
105
  async calculateOverflowingItems() {
82
- // Fallback to zero if the hidden nav is not available for measurement.
83
106
  if (!this.hiddenNav)
84
- return 0;
85
- const gap = Number.parseFloat(getComputedStyle(this.hiddenNav.firstElementChild).gap);
86
- const menu = this.hiddenNav.querySelector('.menu').clientWidth;
87
- // The last item can never be collapsed, so it is ignored when measuring the width of the items.
88
- const items = Array.from(this.hiddenNav.querySelectorAll('post-breadcrumb-item')).slice(0, -1);
89
- // Start from the assumption that all items fit and that no menu is shown.
90
- // Therefore, subtract the width of the overflow menu.
91
- let width = this.hiddenNav.scrollWidth - menu + gap;
107
+ return { overflowing: 0, homeOverflows: false, lastItemWraps: false };
108
+ const nav = this.hiddenNav;
109
+ const availableWidth = nav.clientWidth;
110
+ const gap = Number.parseFloat(getComputedStyle(nav.firstElementChild).gap);
111
+ const menuWidth = nav.querySelector('.menu')?.clientWidth ?? 0;
112
+ const homeWidth = nav.querySelector('.home')?.clientWidth ?? 0;
113
+ // Stage 1: collapse middle items, starting closest to home, until the rest fits.
114
+ const middleItems = Array.from(nav.querySelectorAll('post-breadcrumb-item')).slice(0, -1);
115
+ const { overflowing, remainingWidth } = this.collapseMiddleItems(middleItems, gap, menuWidth, availableWidth);
116
+ // Stage 2: home + last item, single-line. Text home can collapse into the menu, while the
117
+ // icon-only home remains visible and lets the last item wrap instead.
118
+ const homeOverflows = this.usesHomeText && remainingWidth > availableWidth;
119
+ // Stage 3: home joins the existing menu when middle items have collapsed. If no middle item
120
+ // collapsed, the menu needs to be added when home moves into it.
121
+ const widthWithHomeCollapsed = remainingWidth - homeWidth + (overflowing === 0 ? menuWidth : 0);
122
+ const lastItemWraps = this.usesHomeText
123
+ ? homeOverflows && widthWithHomeCollapsed > availableWidth
124
+ : remainingWidth > availableWidth;
125
+ return { overflowing, homeOverflows, lastItemWraps };
126
+ }
127
+ /** Stage 1: collapses middle items until the rest fits, or none are left. */
128
+ collapseMiddleItems(items, gap, menuWidth, availableWidth) {
129
+ // Start from the assumption that all items fit and that no menu is shown, so subtract the
130
+ // overflow menu's width from the total.
131
+ let width = this.hiddenNav.scrollWidth - menuWidth + gap;
92
132
  let overflowing = 0;
93
- // Discard items from the start until the remaining ones fit the available width.
94
- while (overflowing < items.length && width > this.hiddenNav.clientWidth) {
133
+ while (overflowing < items.length && width > availableWidth) {
95
134
  // The overflow menu needs to be displayed as soon as the first item is moved into it, so its
96
135
  // width needs to be taken into account when measuring the remaining items.
97
136
  if (overflowing === 0)
98
- width += menu;
137
+ width += menuWidth;
99
138
  width -= items[overflowing++].clientWidth + gap;
100
139
  }
101
- return overflowing;
140
+ return { overflowing, remainingWidth: width };
102
141
  }
103
- /**
104
- * Moves `collapsed` items into the overflow menu and marks the last item as selected.
105
- */
106
- updateItems(items, collapsed) {
142
+ /** Applies the degrade states to the `<post-breadcrumb-item>` elements. */
143
+ updateItems(items, collapsed, lastItemWraps) {
107
144
  items.forEach((item, index) => {
145
+ const isLast = index === items.length - 1;
108
146
  item.setAttribute('variant', index < collapsed ? 'menuitem' : 'listitem');
109
- item.setAttribute('selected', String(index === items.length - 1));
110
- item.setAttribute('standalone', String(index === items.length - 1 && index === collapsed));
147
+ item.setAttribute('selected', String(isLast));
148
+ item.setAttribute('standalone', String(isLast && index === collapsed && lastItemWraps));
111
149
  });
112
150
  }
113
- /**
114
- * Rebuilds the off-screen copy of the breadcrumb navigation.
115
- */
151
+ /** Rebuilds the off-screen copy of the breadcrumb navigation. */
116
152
  async updateHiddenNav() {
117
153
  this.hiddenNav?.remove();
118
154
  this.hiddenNav = await this.renderHiddenNav();
119
155
  }
156
+ async updateAfterMutation() {
157
+ await this.updateHiddenNav();
158
+ await this.updateCollapsedItems();
159
+ }
120
160
  /**
121
- * Renders an off-screen copy of the breadcrumb navigation that is used for measurements.
161
+ * Renders an off-screen copy of the nav for measurements. `.home` is rebuilt independently (see
162
+ * `buildMeasurementHomeElement`) rather than cloned, since the live nav may show the home item
163
+ * in the overflow menu instead if it is already collapsed.
122
164
  */
123
165
  async renderHiddenNav() {
124
166
  const shadowRoot = this.host.shadowRoot;
@@ -129,12 +171,29 @@ const PostBreadcrumbs = class {
129
171
  // Deep clone the breadcrumb navigation and flatten its slots into the clone.
130
172
  this.nav.querySelectorAll('slot').forEach((source, index) => {
131
173
  const target = slots[index];
132
- // Insert the assigned elements where the slot used to be, then drop the now empty slot
133
- source.assignedElements().forEach(element => {
134
- target.insertAdjacentElement('beforebegin', element.cloneNode(true));
135
- });
136
- target.remove();
174
+ const assignedElements = source.assignedElements();
175
+ if (assignedElements.length > 0) {
176
+ // Insert the assigned elements where the slot used to be, then drop the now empty slot.
177
+ assignedElements.forEach(element => {
178
+ target.insertAdjacentElement('beforebegin', element.cloneNode(true));
179
+ });
180
+ target.remove();
181
+ }
182
+ else {
183
+ // Nothing assigned: keep the slot's own fallback content (e.g. the default home link) by
184
+ // unwrap the <slot> in place, move its children to where it was, then remove it.
185
+ const parent = target.parentNode;
186
+ if (parent) {
187
+ Array.from(target.childNodes).forEach(child => parent.insertBefore(child, target));
188
+ target.remove();
189
+ }
190
+ }
137
191
  });
192
+ // Always measure the full, uncollapsed home item — see the method doc above. Uses
193
+ // replaceChild rather than replaceWith, since the latter isn't implemented by Stencil's
194
+ // mock-doc DOM used during SSR/hydration.
195
+ const existingHome = clone.querySelector('.home');
196
+ existingHome?.parentNode?.replaceChild(this.buildMeasurementHomeElement(), existingHome);
138
197
  clone.classList.remove('loading');
139
198
  clone.classList.add('invisible');
140
199
  // Show the overflow menu so that we can include the space it takes up in the measurement.
@@ -143,31 +202,72 @@ const PostBreadcrumbs = class {
143
202
  // Wait for all items to be fully hydrated before measuring.
144
203
  const items = clone.querySelectorAll('post-breadcrumb-item');
145
204
  await Promise.all(Array.from(items).map(item => componentOnReady(item)));
146
- // Move the items out of the overflow menu so that the uncollapsed layout can be measured.
147
- this.updateItems(items, 0);
205
+ // Uncollapsed layout, both single-line, for measurement.
206
+ this.updateItems(items, 0, false);
148
207
  return clone;
149
208
  }
209
+ /** Builds `.home` in its full, uncollapsed form for measurement. Mirrors `renderHomeContent`, but as plain DOM since this runs outside the render cycle. */
210
+ buildMeasurementHomeElement() {
211
+ const home = document.createElement('div');
212
+ home.className = `breadcrumb-item home${this.usesHomeText ? '' : ' icon'}`;
213
+ home.setAttribute('role', 'listitem');
214
+ const slottedAnchor = this.hasSlottedHomeAnchor
215
+ ? Array.from(this.host.children).find(child => child.getAttribute('slot') === 'home')
216
+ : null;
217
+ if (slottedAnchor) {
218
+ home.append(slottedAnchor.cloneNode(true));
219
+ return home;
220
+ }
221
+ const anchor = document.createElement('a');
222
+ if (this.homeUrl)
223
+ anchor.href = this.homeUrl;
224
+ const label = document.createElement('span');
225
+ if (!this.usesHomeText)
226
+ label.className = 'visually-hidden';
227
+ label.textContent = this.textHome;
228
+ anchor.append(label);
229
+ if (!this.usesHomeText) {
230
+ const icon = document.createElement('post-icon');
231
+ icon.setAttribute('aria-hidden', 'true');
232
+ icon.setAttribute('name', 'home');
233
+ anchor.append(icon);
234
+ }
235
+ home.append(anchor);
236
+ return home;
237
+ }
150
238
  renderMenu() {
151
239
  const menuId = `${this.id}-menu`;
152
- return (h("div", { class: `breadcrumb-item menu ${this.collapsed === 0 ? 'empty' : ''}`, role: "listitem" }, 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", { name: "menu" }))));
240
+ return (h("div", { class: `breadcrumb-item menu ${this.collapsed === 0 && !this.homeCollapsed ? 'empty' : ''}`, role: "listitem" }, 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" }, this.homeCollapsed && this.usesHomeText && (h("post-menu-item", null, this.renderHomeContent())), h("slot", { name: "menu" }))));
241
+ }
242
+ /** Reused by the plain home item and the home menu — a slot can only be assigned once. */
243
+ renderHomeContent() {
244
+ return (h("slot", { name: "home", onSlotchange: () => this.checkSlottedHomeAnchor() }, h("a", { href: this.homeUrl }, h("span", { class: this.usesHomeText ? undefined : 'visually-hidden' }, this.textHome), !this.usesHomeText && h("post-icon", { "aria-hidden": "true", name: "home" }))));
245
+ }
246
+ /** Degrade stage 2: home renders in full, single-line, not yet collapsed. */
247
+ renderHome() {
248
+ return (h("div", { class: `breadcrumb-item home${this.usesHomeText ? '' : ' icon'}`, role: "listitem" }, this.renderHomeContent()));
153
249
  }
154
250
  render() {
155
251
  if (this.loaded) {
156
252
  const items = this.host.querySelectorAll('post-breadcrumb-item');
157
- this.updateItems(items, this.collapsed);
253
+ this.updateItems(items, this.collapsed, this.lastItemWraps);
158
254
  }
159
- return (h(Host, { key: '501384cb07b2deac87a21800fc4d39d695747341', "data-version": version }, h("nav", { key: '20aa57da865967458169544dec75d975926eb675', "aria-label": this.textBreadcrumbs, ref: el => (this.nav = el), class: this.loaded ? '' : 'loading' }, h("div", { key: 'cf8f21f2ee9de01bac0edf9379ba5c183b938d70', role: "list" }, h("div", { key: '9bd29a83cb976d67f3c6ea24cf23b2a07e40ca84', class: "breadcrumb-item home", role: "listitem" }, h("a", { key: '675638668994f074951491040c6043819e6f7282', href: this.homeUrl }, h("span", { key: '3ce1f8ea5ba5738925bff000ec5a8c32603ae963', class: "visually-hidden" }, this.textHome), h("post-icon", { key: '1b35b22788d4e70c948e1067d99265e8af9c74e7', "aria-hidden": "true", name: "home" }))), this.renderMenu(), h("slot", { key: 'f7fe7cd0b16a9064aba28149756f785c47133351' }), h("slot", { key: 'c62ce84877203586c184e1adaea1ecb6ed8a0912', name: "selected" })))));
255
+ return (h(Host, { key: '8d5f457a7c6a2df0cfaf5c31f3ffc6937de76e57', "data-version": version, class: this.homeCollapsed && this.usesHomeText ? 'home-collapsed' : undefined }, h("nav", { key: 'ce3fd7ad69060dd6968afaad6170e27eee72682f', "aria-label": this.textBreadcrumbs, ref: el => (this.nav = el), class: this.loaded ? '' : 'loading' }, h("div", { key: '1c400c8c1e1b625203876cc9804936782a2202c6', role: "list" }, (!this.homeCollapsed || !this.usesHomeText) && this.renderHome(), this.renderMenu(), h("slot", { key: '5cf6618b487961c0e7d70637f5396d023660ec55' }), h("slot", { key: 'f4fb662d04d9966c76a22444844d692611472b2d', name: "selected" })))));
160
256
  }
161
257
  get host() { return getElement(this); }
162
258
  };
163
259
  __decorate([
164
- Required(),
260
+ Required({ when: 'hasSlottedHomeAnchor', truthy: false }),
165
261
  Url()
166
262
  ], PostBreadcrumbs.prototype, "homeUrl", void 0);
167
263
  __decorate([
168
- Required(),
264
+ Required({ when: 'hasSlottedHomeAnchor', truthy: false }),
169
265
  Type('string')
170
266
  ], PostBreadcrumbs.prototype, "textHome", void 0);
267
+ __decorate([
268
+ Required(),
269
+ Type('boolean')
270
+ ], PostBreadcrumbs.prototype, "homeTextOnly", void 0);
171
271
  __decorate([
172
272
  Required(),
173
273
  Type('string')