@nldd/design-system 0.14.0 → 0.15.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 (376) hide show
  1. package/NOTICES.md +1 -1
  2. package/custom-elements.json +665 -37
  3. package/dist/components/actions/button/button.d.ts +1 -1
  4. package/dist/components/actions/button/button.d.ts.map +1 -1
  5. package/dist/components/actions/button/button.js +10 -1
  6. package/dist/components/actions/button/button.js.map +1 -1
  7. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  8. package/dist/components/actions/button/button.template.js +2 -2
  9. package/dist/components/actions/button/button.template.js.map +1 -1
  10. package/dist/components/actions/button-group/button-group.d.ts +8 -3
  11. package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
  12. package/dist/components/actions/button-group/button-group.js +32 -13
  13. package/dist/components/actions/button-group/button-group.js.map +1 -1
  14. package/dist/components/actions/icon-button/icon-button.d.ts +1 -1
  15. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  16. package/dist/components/actions/icon-button/icon-button.js +10 -1
  17. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  18. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  19. package/dist/components/actions/icon-button/icon-button.template.js +2 -2
  20. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  21. package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
  22. package/dist/components/actions/menu/menu-item.js +3 -0
  23. package/dist/components/actions/menu/menu-item.js.map +1 -1
  24. package/dist/components/actions/menu/menu.d.ts +25 -0
  25. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  26. package/dist/components/actions/menu/menu.i18n.d.ts +2 -0
  27. package/dist/components/actions/menu/menu.i18n.d.ts.map +1 -1
  28. package/dist/components/actions/menu/menu.i18n.js +4 -0
  29. package/dist/components/actions/menu/menu.i18n.js.map +1 -1
  30. package/dist/components/actions/menu/menu.js +54 -2
  31. package/dist/components/actions/menu/menu.js.map +1 -1
  32. package/dist/components/components.js +2019 -563
  33. package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
  34. package/dist/components/content/code-viewer/code-viewer.js +3 -0
  35. package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
  36. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  37. package/dist/components/content/icon/icon-aliases.js +2 -0
  38. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  39. package/dist/components/content/rich-text/rich-text.d.ts +4 -1
  40. package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
  41. package/dist/components/content/rich-text/rich-text.js +4 -1
  42. package/dist/components/content/rich-text/rich-text.js.map +1 -1
  43. package/dist/components/content/title/title.d.ts +8 -0
  44. package/dist/components/content/title/title.d.ts.map +1 -1
  45. package/dist/components/content/title/title.js +8 -0
  46. package/dist/components/content/title/title.js.map +1 -1
  47. package/dist/components/content/title/title.styles.d.ts.map +1 -1
  48. package/dist/components/content/title/title.styles.js +13 -0
  49. package/dist/components/content/title/title.styles.js.map +1 -1
  50. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  51. package/dist/components/content/tooltip/tooltip.js +4 -1
  52. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  53. package/dist/components/{decorate-x12uDAK4.js → decorate-CzRe1eif.js} +1 -1
  54. package/dist/components/{with-translations-DLzmBSkU.js → defer-focus-DIPAUUJa.js} +34 -3
  55. package/dist/components/{dev-checks-BgrW077W.js → dev-checks-tdnaA2UV.js} +16 -1
  56. package/dist/components/{dist-BaLc58I_.js → dist-245LaK9m.js} +1 -1
  57. package/dist/components/{dist-DgjvHvsN.js → dist-4g23YHP0.js} +1 -1
  58. package/dist/components/{dist-YYLChwRq.js → dist-Bf823YyL.js} +1 -1
  59. package/dist/components/{dist-Bm3708s5.js → dist-CeMOOqgP.js} +13 -1
  60. package/dist/components/{dist-CJ9uLG0u.js → dist-DFjwTlJV.js} +1 -1
  61. package/dist/components/forms/form-field/form-field.d.ts +2 -2
  62. package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
  63. package/dist/components/forms/form-field/form-field.js +4 -3
  64. package/dist/components/forms/form-field/form-field.js.map +1 -1
  65. package/dist/components/forms/form-field/form-field.template.d.ts.map +1 -1
  66. package/dist/components/forms/form-field/form-field.template.js +3 -2
  67. package/dist/components/forms/form-field/form-field.template.js.map +1 -1
  68. package/dist/components/forms/validation-list/validation-list.d.ts +26 -0
  69. package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
  70. package/dist/components/forms/validation-list/validation-list.i18n.d.ts +12 -0
  71. package/dist/components/forms/validation-list/validation-list.i18n.d.ts.map +1 -0
  72. package/dist/components/forms/validation-list/validation-list.i18n.js +11 -0
  73. package/dist/components/forms/validation-list/validation-list.i18n.js.map +1 -0
  74. package/dist/components/forms/validation-list/validation-list.js +74 -2
  75. package/dist/components/forms/validation-list/validation-list.js.map +1 -1
  76. package/dist/components/{icon-IgCyk9ui.js → icon-BPNDyhu9.js} +2 -1
  77. package/dist/components/{icon-button-B5tH4b3c.js → icon-button-Dbo_SGor.js} +46 -15
  78. package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
  79. package/dist/components/inputs/checkbox/checkbox.js +3 -0
  80. package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
  81. package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
  82. package/dist/components/inputs/checkbox-field/checkbox-field.js +3 -0
  83. package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
  84. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  85. package/dist/components/inputs/code-editor/code-editor.styles.js +36 -13
  86. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  87. package/dist/components/inputs/combo-box/combo-box.d.ts +4 -0
  88. package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
  89. package/dist/components/inputs/combo-box/combo-box.js +12 -0
  90. package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
  91. package/dist/components/inputs/date-field/date-field.i18n.js +4 -4
  92. package/dist/components/inputs/date-field/date-field.i18n.js.map +1 -1
  93. package/dist/components/inputs/date-picker/date-picker.d.ts +3 -3
  94. package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
  95. package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +2 -2
  96. package/dist/components/inputs/date-picker/date-picker.i18n.js +2 -2
  97. package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
  98. package/dist/components/inputs/date-picker/date-picker.js +3 -0
  99. package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
  100. package/dist/components/inputs/date-picker/date-picker.template.js +2 -2
  101. package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
  102. package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
  103. package/dist/components/inputs/dropdown/dropdown.js +5 -1
  104. package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
  105. package/dist/components/inputs/file-field/file-field.d.ts +147 -17
  106. package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
  107. package/dist/components/inputs/file-field/file-field.drop.d.ts +16 -1
  108. package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -1
  109. package/dist/components/inputs/file-field/file-field.drop.js +33 -0
  110. package/dist/components/inputs/file-field/file-field.drop.js.map +1 -1
  111. package/dist/components/inputs/file-field/file-field.i18n.d.ts +11 -1
  112. package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
  113. package/dist/components/inputs/file-field/file-field.i18n.js +16 -6
  114. package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
  115. package/dist/components/inputs/file-field/file-field.js +419 -74
  116. package/dist/components/inputs/file-field/file-field.js.map +1 -1
  117. package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
  118. package/dist/components/inputs/file-field/file-field.styles.js +235 -91
  119. package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
  120. package/dist/components/inputs/file-field/file-field.template.d.ts +2 -1
  121. package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
  122. package/dist/components/inputs/file-field/file-field.template.js +282 -83
  123. package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
  124. package/dist/components/inputs/file-field/file-field.truncate.d.ts +17 -0
  125. package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -1
  126. package/dist/components/inputs/file-field/file-field.truncate.js +26 -3
  127. package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -1
  128. package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
  129. package/dist/components/inputs/number-field/number-field.js +3 -0
  130. package/dist/components/inputs/number-field/number-field.js.map +1 -1
  131. package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
  132. package/dist/components/inputs/radio-button-group/radio-button-group.js +3 -0
  133. package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
  134. package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
  135. package/dist/components/inputs/search-field/search-field.js +3 -0
  136. package/dist/components/inputs/search-field/search-field.js.map +1 -1
  137. package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
  138. package/dist/components/inputs/segmented-control/segmented-control.js +5 -0
  139. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  140. package/dist/components/inputs/slider/slider.d.ts +32 -10
  141. package/dist/components/inputs/slider/slider.d.ts.map +1 -1
  142. package/dist/components/inputs/slider/slider.js +113 -34
  143. package/dist/components/inputs/slider/slider.js.map +1 -1
  144. package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
  145. package/dist/components/inputs/slider/slider.styles.js +22 -13
  146. package/dist/components/inputs/slider/slider.styles.js.map +1 -1
  147. package/dist/components/inputs/slider/slider.template.d.ts.map +1 -1
  148. package/dist/components/inputs/slider/slider.template.js +12 -4
  149. package/dist/components/inputs/slider/slider.template.js.map +1 -1
  150. package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
  151. package/dist/components/inputs/stepper/stepper.js +3 -0
  152. package/dist/components/inputs/stepper/stepper.js.map +1 -1
  153. package/dist/components/inputs/switch/switch.d.ts.map +1 -1
  154. package/dist/components/inputs/switch/switch.js +3 -0
  155. package/dist/components/inputs/switch/switch.js.map +1 -1
  156. package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
  157. package/dist/components/inputs/switch-field/switch-field.js +3 -0
  158. package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
  159. package/dist/components/inputs/text-editor/text-editor.code-copy.js +2 -2
  160. package/dist/components/inputs/text-editor/text-editor.code-copy.js.map +1 -1
  161. package/dist/components/inputs/text-editor/text-editor.cursor.d.ts.map +1 -1
  162. package/dist/components/inputs/text-editor/text-editor.cursor.js +1 -11
  163. package/dist/components/inputs/text-editor/text-editor.cursor.js.map +1 -1
  164. package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
  165. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
  166. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +127 -11
  167. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
  168. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +3 -1
  169. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
  170. package/dist/components/inputs/text-editor/text-editor.i18n.js +5 -1
  171. package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
  172. package/dist/components/inputs/text-editor/text-editor.js +7 -5
  173. package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
  174. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +3 -0
  175. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
  176. package/dist/components/inputs/text-editor/text-editor.markdown.js +9 -1
  177. package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
  178. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +7 -2
  179. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
  180. package/dist/components/inputs/text-editor/text-editor.mentions.js +47 -145
  181. package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
  182. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  183. package/dist/components/inputs/text-editor/text-editor.styles.js +187 -2
  184. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  185. package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
  186. package/dist/components/inputs/text-field/text-field.js +3 -0
  187. package/dist/components/inputs/text-field/text-field.js.map +1 -1
  188. package/dist/components/inputs/time-field/time-field.i18n.js +3 -3
  189. package/dist/components/inputs/time-field/time-field.i18n.js.map +1 -1
  190. package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
  191. package/dist/components/inputs/time-picker/time-picker.js +3 -0
  192. package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
  193. package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
  194. package/dist/components/inputs/toggle-button/toggle-button.js +3 -0
  195. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  196. package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
  197. package/dist/components/inputs/toggle-button-group/toggle-button-group.js +3 -0
  198. package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
  199. package/dist/components/inputs/token-field/token-field.d.ts +4 -0
  200. package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
  201. package/dist/components/inputs/token-field/token-field.i18n.d.ts +1 -1
  202. package/dist/components/inputs/token-field/token-field.i18n.js +1 -1
  203. package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -1
  204. package/dist/components/inputs/token-field/token-field.js +12 -0
  205. package/dist/components/inputs/token-field/token-field.js.map +1 -1
  206. package/dist/components/inputs/token-field/token-field.template.js +1 -1
  207. package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
  208. package/dist/components/{just-in-time-education.i18n-BJ5ovWVB.js → just-in-time-education.i18n-BgCd3s-c.js} +47 -22
  209. package/dist/components/layout/collection/collection.d.ts +4 -0
  210. package/dist/components/layout/collection/collection.d.ts.map +1 -1
  211. package/dist/components/layout/collection/collection.js +56 -8
  212. package/dist/components/layout/collection/collection.js.map +1 -1
  213. package/dist/components/layout/collection/collection.template.js +1 -1
  214. package/dist/components/layout/collection/collection.template.js.map +1 -1
  215. package/dist/components/layout/page-footer/page-footer.d.ts +2 -0
  216. package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
  217. package/dist/components/layout/page-footer/page-footer.js +7 -0
  218. package/dist/components/layout/page-footer/page-footer.js.map +1 -1
  219. package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
  220. package/dist/components/layout/page-footer/page-footer.styles.js +22 -8
  221. package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
  222. package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
  223. package/dist/components/layout/page-footer/page-footer.template.js +2 -0
  224. package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
  225. package/dist/components/layout/popover/popover.d.ts +14 -4
  226. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  227. package/dist/components/layout/popover/popover.js +20 -5
  228. package/dist/components/layout/popover/popover.js.map +1 -1
  229. package/dist/components/layout/task-board/task-board.d.ts +1 -1
  230. package/dist/components/layout/task-board/task-board.d.ts.map +1 -1
  231. package/dist/components/layout/task-board/task-board.js +8 -4
  232. package/dist/components/layout/task-board/task-board.js.map +1 -1
  233. package/dist/components/{list.i18n-nFB6dZpc.js → list.i18n-CKqbhFQ_.js} +1 -1
  234. package/dist/components/lists-and-tables/cells/cell/cell.d.ts +2 -0
  235. package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
  236. package/dist/components/lists-and-tables/cells/cell/cell.js +2 -1
  237. package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
  238. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts +2 -0
  239. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
  240. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +2 -1
  241. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
  242. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -0
  243. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
  244. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +2 -1
  245. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
  246. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +7 -2
  247. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
  248. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +3 -3
  249. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
  250. package/dist/components/lists-and-tables/list/list.i18n.d.ts +1 -1
  251. package/dist/components/lists-and-tables/list/list.i18n.js +1 -1
  252. package/dist/components/lists-and-tables/list/list.js +1 -1
  253. package/dist/components/lists-and-tables/list-item/list-item.d.ts +8 -1
  254. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  255. package/dist/components/lists-and-tables/list-item/list-item.js +21 -1
  256. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  257. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +1 -1
  258. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  259. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +11 -2
  260. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  261. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
  262. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
  263. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -2
  264. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
  265. package/dist/components/lists-and-tables/table/table.d.ts +24 -0
  266. package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
  267. package/dist/components/lists-and-tables/table/table.js +52 -4
  268. package/dist/components/lists-and-tables/table/table.js.map +1 -1
  269. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +4 -4
  270. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
  271. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.d.ts +1 -1
  272. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js +1 -1
  273. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js.map +1 -1
  274. package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -2
  275. package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
  276. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
  277. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
  278. package/dist/components/navigation/link/link.styles.d.ts.map +1 -1
  279. package/dist/components/navigation/link/link.styles.js +0 -4
  280. package/dist/components/navigation/link/link.styles.js.map +1 -1
  281. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  282. package/dist/components/navigation/menu-bar/menu-bar.js +4 -0
  283. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  284. package/dist/components/navigation/menu-bar/menu-bar.styles.d.ts.map +1 -1
  285. package/dist/components/navigation/menu-bar/menu-bar.styles.js +9 -0
  286. package/dist/components/navigation/menu-bar/menu-bar.styles.js.map +1 -1
  287. package/dist/components/navigation/menu-bar/menu-bar.template.d.ts.map +1 -1
  288. package/dist/components/navigation/menu-bar/menu-bar.template.js +25 -19
  289. package/dist/components/navigation/menu-bar/menu-bar.template.js.map +1 -1
  290. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
  291. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +10 -0
  292. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  293. package/dist/components/navigation/pagination/pagination.i18n.d.ts +3 -3
  294. package/dist/components/navigation/pagination/pagination.i18n.js +3 -3
  295. package/dist/components/navigation/pagination/pagination.i18n.js.map +1 -1
  296. package/dist/components/navigation/pagination/pagination.template.js +3 -3
  297. package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
  298. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  299. package/dist/components/navigation/tab-bar/tab-bar.js +3 -0
  300. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  301. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +11 -0
  302. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
  303. package/dist/components/navigation/top-title-bar/top-title-bar.js +37 -0
  304. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  305. package/dist/components/navigation/top-title-bar/top-title-bar.template.js +1 -1
  306. package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
  307. package/dist/components/{nl.generated-Ny3Kwppu.js → nl.generated-D-8UF1iR.js} +3 -2
  308. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +1 -1
  309. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +3 -3
  310. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
  311. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +2 -2
  312. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -2
  313. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.d.ts.map +1 -1
  314. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +9 -2
  315. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js.map +1 -1
  316. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +1 -1
  317. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +1 -1
  318. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.d.ts.map +1 -1
  319. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js +9 -6
  320. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js.map +1 -1
  321. package/dist/components/{visibility-mixin-DcwzF0_a.js → visibility-mixin-CNCT26tu.js} +1 -1
  322. package/dist/css/rich-text.css +5 -0
  323. package/dist/nldd.min.js +1394 -898
  324. package/dist/translations/en-US.d.ts.map +1 -1
  325. package/dist/translations/en-US.js +44 -22
  326. package/dist/translations/en-US.js.map +1 -1
  327. package/dist/translations/fy.d.ts.map +1 -1
  328. package/dist/translations/fy.js +44 -22
  329. package/dist/translations/fy.js.map +1 -1
  330. package/dist/translations/nl.generated.d.ts +32 -10
  331. package/dist/translations/nl.generated.d.ts.map +1 -1
  332. package/dist/translations/nl.generated.js +2 -0
  333. package/dist/translations/nl.generated.js.map +1 -1
  334. package/dist/translations/pap-AW.d.ts.map +1 -1
  335. package/dist/translations/pap-AW.js +44 -22
  336. package/dist/translations/pap-AW.js.map +1 -1
  337. package/dist/translations/pap-CW.d.ts.map +1 -1
  338. package/dist/translations/pap-CW.js +44 -22
  339. package/dist/translations/pap-CW.js.map +1 -1
  340. package/dist/types/vue.d.ts +47 -29
  341. package/dist/utilities/carried-context.d.ts +14 -3
  342. package/dist/utilities/carried-context.d.ts.map +1 -1
  343. package/dist/utilities/carried-context.js +12 -5
  344. package/dist/utilities/carried-context.js.map +1 -1
  345. package/dist/utilities/defer-focus.d.ts +24 -0
  346. package/dist/utilities/defer-focus.d.ts.map +1 -0
  347. package/dist/utilities/defer-focus.js +33 -0
  348. package/dist/utilities/defer-focus.js.map +1 -0
  349. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  350. package/dist/utilities/dev-rules.generated.js +15 -0
  351. package/dist/utilities/dev-rules.generated.js.map +1 -1
  352. package/dist/utilities/file-drag-and-drop.d.ts +18 -0
  353. package/dist/utilities/file-drag-and-drop.d.ts.map +1 -0
  354. package/dist/utilities/file-drag-and-drop.js +31 -0
  355. package/dist/utilities/file-drag-and-drop.js.map +1 -0
  356. package/dist/utilities/list-items.d.ts +10 -0
  357. package/dist/utilities/list-items.d.ts.map +1 -0
  358. package/dist/utilities/list-items.js +21 -0
  359. package/dist/utilities/list-items.js.map +1 -0
  360. package/dist/utilities/popover-target.d.ts +14 -0
  361. package/dist/utilities/popover-target.d.ts.map +1 -0
  362. package/dist/utilities/popover-target.js +21 -0
  363. package/dist/utilities/popover-target.js.map +1 -0
  364. package/dist/utilities/popup-anchor-controller.d.ts.map +1 -1
  365. package/dist/utilities/popup-anchor-controller.js +6 -1
  366. package/dist/utilities/popup-anchor-controller.js.map +1 -1
  367. package/dist/utilities/render-marked.d.ts +2 -0
  368. package/dist/utilities/render-marked.d.ts.map +1 -1
  369. package/dist/utilities/render-marked.js +4 -0
  370. package/dist/utilities/render-marked.js.map +1 -1
  371. package/dist/utilities/row-header-mixin.d.ts +31 -0
  372. package/dist/utilities/row-header-mixin.d.ts.map +1 -0
  373. package/dist/utilities/row-header-mixin.js +44 -0
  374. package/dist/utilities/row-header-mixin.js.map +1 -0
  375. package/lint/data.generated.json +1 -1
  376. package/package.json +2 -1
@@ -1,22 +1,22 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.js";
2
- import { n as customElement, t as __decorate } from "./decorate-x12uDAK4.js";
2
+ import { n as customElement, t as __decorate } from "./decorate-CzRe1eif.js";
3
3
  import { n as slottedReset, t as inheritedTextReset } from "./shadow-resets-BwOyyZFH.js";
4
- import { a as linkHintKey, i as downloadLinkHintKey, n as setTranslations, o as markDownloadTarget, r as translate, s as linkRel, t as withTranslations } from "./with-translations-DLzmBSkU.js";
4
+ import { a as downloadLinkHintKey, c as linkRel, i as translate, n as withTranslations, o as linkHintKey, r as setTranslations, s as markDownloadTarget, t as deferFocus } from "./defer-focus-DIPAUUJa.js";
5
5
  import { n as internalsOf, r as setState$1 } from "./element-state-BnarBv0M.js";
6
- import { a as NLDDActivityIndicator, c as ShortcutAvailabilityController, d as shortcutsAvailable, i as releaseContext, l as hasShortcut, n as NLDDTooltip, o as PopupAnchorController, r as carryContext, s as NLDDKeyboardShortcut, t as NLDDIconButton, u as shortcutLabel } from "./icon-button-B5tH4b3c.js";
6
+ import { a as releaseContext, c as popoverTargetOf, d as hasShortcut, f as shortcutLabel, i as langOf, l as NLDDKeyboardShortcut, n as NLDDTooltip, o as NLDDActivityIndicator, p as shortcutsAvailable, r as carryContext, s as PopupAnchorController, t as NLDDIconButton, u as ShortcutAvailabilityController } from "./icon-button-Dbo_SGor.js";
7
7
  import { t as reflectNonDefault } from "./reflect-non-default-B9wQcnne.js";
8
8
  import { t as nlddButtonTranslations } from "./button.i18n-DiDGynnq.js";
9
- import { t as NLDDIcon } from "./icon-IgCyk9ui.js";
9
+ import { t as NLDDIcon } from "./icon-BPNDyhu9.js";
10
10
  import { n as isPointerMode, r as isTouchMode, t as isKeyboardMode } from "./input-modality-CiPLYYMN.js";
11
- import { A as nlddStepperTranslations, B as nlddRichTextTranslations, C as nlddCardTranslations, D as nlddTimeFieldTranslations, E as nlddTokenFieldTranslations, F as MONTH_KEYS, G as nlddAvatarTranslations, H as nlddCodeViewerTranslations, I as WEEKDAY_KEYS, J as nlddSplitButtonTranslations, K as nlddToolbarTranslations, L as nlddDatePickerTranslations, M as nlddNumberFieldTranslations, N as nlddFileFieldTranslations, O as nlddTimePickerTranslations, P as nlddDateFieldTranslations, R as nlddComboBoxTranslations, S as nlddCollectionTranslations, T as nlddSliderTranslations, U as nlddAvatarGroupTranslations, V as nlddImageTranslations, W as nlddPopoverTranslations, _ as nlddTableTranslations, a as nlddBadgeTranslations, b as nlddPageFooterTranslations, c as nlddPaginationTranslations, d as nlddTopNavigationBarTranslations, f as nlddSkipLinkTranslations, g as nlddDragHandleCellTranslations, h as nlddBreadcrumbsTranslations, i as nlddProgressBarTranslations, j as nlddSearchFieldTranslations, k as nlddTextEditorTranslations, l as nlddDocumentTabBarTranslations, m as nlddMenuBarTranslations, n as nlddStepBarTranslations, o as nlddNotificationTranslations, p as nlddLinkTranslations, q as nlddMenuTranslations, r as nlddProgressCircleTranslations, s as nlddBannerTranslations, t as nlddJustInTimeEducationTranslations, u as nlddTabBarTranslations, v as nlddListItemSegmentTranslations, w as nlddSidebarSectionTranslations, x as nlddWindowTranslations, y as nlddTaskBoardTranslations, z as nlddTokenTranslations } from "./just-in-time-education.i18n-BJ5ovWVB.js";
11
+ import { A as nlddStepperTranslations, B as nlddTokenTranslations, C as nlddCardTranslations, D as nlddTimeFieldTranslations, E as nlddTokenFieldTranslations, F as MONTH_KEYS, G as nlddPopoverTranslations, H as nlddImageTranslations, I as WEEKDAY_KEYS, J as nlddMenuTranslations, K as nlddAvatarTranslations, L as nlddDatePickerTranslations, M as nlddNumberFieldTranslations, N as nlddFileFieldTranslations, O as nlddTimePickerTranslations, P as nlddDateFieldTranslations, R as nlddComboBoxTranslations, S as nlddCollectionTranslations, T as nlddSliderTranslations, U as nlddCodeViewerTranslations, V as nlddRichTextTranslations, W as nlddAvatarGroupTranslations, Y as nlddSplitButtonTranslations, _ as nlddTableTranslations, a as nlddBadgeTranslations, b as nlddPageFooterTranslations, c as nlddPaginationTranslations, d as nlddTopNavigationBarTranslations, f as nlddSkipLinkTranslations, g as nlddDragHandleCellTranslations, h as nlddBreadcrumbsTranslations, i as nlddProgressBarTranslations, j as nlddSearchFieldTranslations, k as nlddTextEditorTranslations, l as nlddDocumentTabBarTranslations, m as nlddMenuBarTranslations, n as nlddStepBarTranslations, o as nlddNotificationTranslations, p as nlddLinkTranslations, q as nlddToolbarTranslations, r as nlddProgressCircleTranslations, s as nlddBannerTranslations, t as nlddJustInTimeEducationTranslations, u as nlddTabBarTranslations, v as nlddListItemSegmentTranslations, w as nlddSidebarSectionTranslations, x as nlddWindowTranslations, y as nlddTaskBoardTranslations, z as nlddValidationListTranslations } from "./just-in-time-education.i18n-BgCd3s-c.js";
12
12
  import { n as queryBreakpoints, r as rootFontSize, t as breakpointPx } from "./breakpoints-Bti55RWY.js";
13
- import { t as VisibilityMixin } from "./visibility-mixin-DcwzF0_a.js";
14
- import { t as nlddListTranslations } from "./list.i18n-nFB6dZpc.js";
13
+ import { t as VisibilityMixin } from "./visibility-mixin-CNCT26tu.js";
14
+ import { t as nlddListTranslations } from "./list.i18n-CKqbhFQ_.js";
15
15
  import { t as nlddListItemTranslations } from "./list-item.i18n-89uqlBMK.js";
16
16
  import { $ as ChangeSet, A as syntaxTree, B as getDrawSelectionConfig, C as indentNodeProp, D as matchBrackets, E as languageDataProp, F as RectangleMarker, G as layer, H as gutter, I as ViewPlugin, J as placeholder, K as lineNumbers, L as WidgetType, M as Direction, N as EditorView, P as GutterMarker, Q as ChangeDesc, R as drawSelection, S as getIndentation, T as indentUnit, U as gutterLineClass, W as keymap, X as tooltips, Y as showTooltip, Z as Annotation, _t as findClusterBreak, a as HighlightStyle, at as Prec, b as foldService, c as Language, d as ParseContext, dt as Text, et as Compartment, f as StreamLanguage, ft as Transaction, gt as countColumn, h as defineLanguageFacet, ht as combineConfig, j as Decoration, k as syntaxHighlighting, l as LanguageDescription, lt as StateEffect, nt as EditorState, o as IndentContext, ot as RangeSet, rt as Facet, st as RangeSetBuilder, tt as EditorSelection, u as LanguageSupport, ut as StateField, w as indentString, x as getIndentUnit, y as foldNodeProp, z as dropCursor } from "./dist-BFZM0YsR.js";
17
17
  import { a as tags, c as NodeProp, f as Parser, h as parseMixed, l as NodeSet, p as Tree, r as styleTags, t as Tag, u as NodeType } from "./dist-PeUX4vPq.js";
18
- import { i as completionStatus, n as autocompletion, s as startCompletion, t as CompletionContext } from "./dist-Bm3708s5.js";
19
- import { n as html$2, r as htmlCompletionSource } from "./dist-BaLc58I_.js";
18
+ import { a as currentCompletions, c as startCompletion, i as completionStatus, n as autocompletion, t as CompletionContext } from "./dist-CeMOOqgP.js";
19
+ import { n as html$2, r as htmlCompletionSource } from "./dist-245LaK9m.js";
20
20
  import { LitElement, css, html, nothing, svg, unsafeCSS } from "lit";
21
21
  import { property, query, queryAll, state } from "lit/decorators.js";
22
22
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
@@ -740,8 +740,7 @@ function template$23(helpers) {
740
740
  aria-expanded=${ariaExpanded}
741
741
  aria-busy=${ariaBusy}
742
742
  tabindex=${this.noTab ? "-1" : nothing}
743
- popovertarget=${this.popovertarget || nothing}
744
- .popoverTargetElement=${this.popoverTargetElement}
743
+ .popoverTargetElement=${popoverTargetOf(this, this.popovertarget, this.popoverTargetElement)}
745
744
  .popoverTargetAction=${this.popoverTargetAction}
746
745
  @pointerdown=${this._popup.handlePointerdown}
747
746
  @click=${helpers.handleClick}
@@ -847,7 +846,7 @@ function DescribedBy(Base) {
847
846
  * @attr {string} loading-text - What the screen reader announces while `loading` is on, for a button that does more than load: "Aan het bewaren". Leave it out and the activity indicator says its translated "Laden".
848
847
  * @attr {boolean} disabled - Disabled state. Avoid it: let the action run and say afterwards what is missing; the design guidelines say why.
849
848
  * @attr {string} type - Button type for form submission: 'button' | 'submit' | 'reset' (ignored when href is set)
850
- * @attr {string} popovertarget - ID of a popover element this button invokes; forwarded to the inner button. Use the popoverTargetElement property instead when the popover lives in another tree.
849
+ * @attr {string} popovertarget - ID of a popover element this button invokes, looked up in the tree of this button; the inner button gets the element. Use the popoverTargetElement property instead when the popover lives in another tree.
851
850
  * @attr {boolean} expandable - Whether the button has a icon to indicate it opens a menu or popover
852
851
  * @attr {boolean} expanded - Whether the popover/menu controlled by this button is currently open. Forwarded as aria-expanded on the inner button; toggles the is-expanded visual state.
853
852
  * @attr {string} popup-type - Type of popup container this button opens: 'menu' | 'listbox' | 'dialog' | 'tree' | 'grid'. Sets aria-haspopup on the inner button and forces aria-expanded to always be present (true/false) so screen readers know the popup state. An nldd-menu or nldd-popover in the `popup` slot, or anchored to this button, sets it itself from the first render; set it only for another kind of popup.
@@ -936,6 +935,7 @@ var _NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitEleme
936
935
  e.stopPropagation();
937
936
  return;
938
937
  }
938
+ if (e.currentTarget instanceof HTMLButtonElement) e.currentTarget.popoverTargetElement = popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
939
939
  if (this._popup.handleClick(e)) {
940
940
  e.preventDefault();
941
941
  return;
@@ -978,6 +978,7 @@ var _NLDDButton = class NLDDButton extends DescribedBy(withTranslations(LitEleme
978
978
  * consumers can call `buttonEl.focus()` without reaching into shadow DOM.
979
979
  */
980
980
  focus(options) {
981
+ if (deferFocus(this, options)) return;
981
982
  this.shadowRoot?.querySelector(".button")?.focus(options);
982
983
  }
983
984
  /** The button or link it renders, not the host around it. */
@@ -2376,6 +2377,10 @@ function renderBold(text) {
2376
2377
  const parts = text.split(/\*\*(.+?)\*\*/g);
2377
2378
  return html`${parts.map((part, i) => i % 2 === 1 ? html`<b>${part}</b>` : part)}`;
2378
2379
  }
2380
+ /** The text of `**bold**` markdown without its markers, for an accessible name. */
2381
+ function stripBold(text) {
2382
+ return text.replace(/\*\*(.+?)\*\*/g, "$1");
2383
+ }
2379
2384
  /**
2380
2385
  * Renders text with the query (or its complement) wrapped in `<b>`, based on `mode`.
2381
2386
  *
@@ -2457,6 +2462,45 @@ function template$20() {
2457
2462
  </p>
2458
2463
  `;
2459
2464
  }
2465
+ // src/utilities/row-header-mixin.ts
2466
+ /**
2467
+ * Adds the `row-header` attribute to the cells that can say what a row is
2468
+ * about: `nldd-cell`, `nldd-title-cell`, `nldd-text-cell` and
2469
+ * `nldd-description-cell`.
2470
+ *
2471
+ * It is the `<th scope="row">` of an `nldd-table`. The cell itself does
2472
+ * nothing with it: the `nldd-table-row` around it reads the attribute and
2473
+ * gives that cell `role="rowheader"` instead of `role="cell"`, so a screen
2474
+ * reader names the row when it reads any other cell in it. The row assigns
2475
+ * every cell role already, which is why the decision stays there.
2476
+ *
2477
+ * It sits on the cell rather than on the row, because a cell is what a header
2478
+ * is in HTML too, and because a column index on the row breaks as soon as a
2479
+ * column is hidden at a breakpoint or reordered. It is a mixin so it works the
2480
+ * same on every cell variant, and the variant still decides how the cell
2481
+ * looks: a row header gets no styling of its own.
2482
+ *
2483
+ * In a header row (`slot="header"`) the attribute is ignored and the cell
2484
+ * stays a `columnheader`. Outside an `nldd-table` it does nothing.
2485
+ *
2486
+ * @mixin RowHeaderMixin
2487
+ *
2488
+ * @attr {boolean} row-header - In an `nldd-table`, makes this cell the header of its row (role="rowheader" instead of "cell"). Semantics only: the cell looks the same. Ignored in a header row.
2489
+ */
2490
+ function RowHeaderMixin(Base) {
2491
+ class WithRowHeader extends Base {
2492
+ constructor(..._args) {
2493
+ super(..._args);
2494
+ this.rowHeader = false;
2495
+ }
2496
+ }
2497
+ __decorate([property({
2498
+ type: Boolean,
2499
+ reflect: true,
2500
+ attribute: "row-header"
2501
+ })], WithRowHeader.prototype, "rowHeader", void 0);
2502
+ return WithRowHeader;
2503
+ }
2460
2504
  // src/components/lists-and-tables/cells/text-cell/text-cell.ts
2461
2505
  /**
2462
2506
  * Nederlandse Digitale Dienst Text Cell Component (Lit + TypeScript)
@@ -2513,7 +2557,7 @@ function template$20() {
2513
2557
  * @attr {string} query-mark-mode - 'match' | 'predictive' (default: 'predictive')
2514
2558
  */
2515
2559
  var text_cell_exports = /* @__PURE__ */ __exportAll({ NLDDTextCell: () => NLDDTextCell });
2516
- var _NLDDTextCell = class NLDDTextCell extends VisibilityMixin(LitElement, "cells-container") {
2560
+ var _NLDDTextCell = class NLDDTextCell extends RowHeaderMixin(VisibilityMixin(LitElement, "cells-container")) {
2517
2561
  constructor(..._args) {
2518
2562
  super(..._args);
2519
2563
  this.size = "md";
@@ -2645,6 +2689,7 @@ var inlineDialogStyles = css`
2645
2689
  --_inline-dialog-icon-color: var(--semantics-content-color);
2646
2690
  --_inline-dialog-text-font: var(--primitives-font-body-md-bold-tight);
2647
2691
  --_inline-dialog-supporting-text-font: var(--primitives-font-body-sm-regular-tight);
2692
+ --_inline-dialog-footer-max-width: var(--primitives-area-360);
2648
2693
 
2649
2694
  ${inheritedTextReset}
2650
2695
  display: flex;
@@ -2734,7 +2779,7 @@ var inlineDialogStyles = css`
2734
2779
  text-align: center;
2735
2780
  color: var(--semantics-content-color);
2736
2781
  font: var(--_inline-dialog-text-font);
2737
- text-wrap: pretty;
2782
+ text-wrap: balance;
2738
2783
  }
2739
2784
 
2740
2785
  .inline-dialog__text:focus-visible {
@@ -2747,12 +2792,13 @@ var inlineDialogStyles = css`
2747
2792
  text-align: center;
2748
2793
  color: var(--semantics-content-color);
2749
2794
  font: var(--_inline-dialog-supporting-text-font);
2750
- text-wrap: pretty;
2795
+ text-wrap: balance;
2751
2796
  }
2752
2797
 
2753
2798
  .inline-dialog--left-aligned .inline-dialog__text,
2754
2799
  .inline-dialog--left-aligned .inline-dialog__supporting-text {
2755
2800
  text-align: left;
2801
+ text-wrap: pretty;
2756
2802
  }
2757
2803
 
2758
2804
  .inline-dialog__content {
@@ -2773,9 +2819,14 @@ var inlineDialogStyles = css`
2773
2819
 
2774
2820
  .inline-dialog__footer {
2775
2821
  width: 100%;
2822
+ max-width: var(--_inline-dialog-footer-max-width);
2776
2823
  padding-top: var(--primitives-space-16);
2777
2824
  }
2778
2825
 
2826
+ .inline-dialog--left-aligned .inline-dialog__footer {
2827
+ max-width: none;
2828
+ }
2829
+
2779
2830
  .inline-dialog__footer[hidden] {
2780
2831
  display: none;
2781
2832
  }
@@ -3009,7 +3060,14 @@ function template$19() {
3009
3060
  *
3010
3061
  * @slot - Default slot for buttons (max 3)
3011
3062
  */
3012
- var _NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
3063
+ var _NLDDButtonGroup;
3064
+ /** `_collapseVerdict` while the group waits for the page to load. */
3065
+ var PENDING = -1;
3066
+ /** Resolves once the page has loaded and its fonts are in. */
3067
+ function pageLoaded() {
3068
+ return (document.readyState === "complete" ? Promise.resolve() : new Promise((resolve) => window.addEventListener("load", resolve, { once: true }))).then(() => document.fonts?.ready);
3069
+ }
3070
+ var NLDDButtonGroup = (_NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
3013
3071
  constructor(..._args) {
3014
3072
  super(..._args);
3015
3073
  this.size = "md";
@@ -3058,8 +3116,12 @@ var _NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
3058
3116
  *
3059
3117
  * A zero reading waits before it counts: a parent can hand over its width a
3060
3118
  * frame or two after the first paint, and that looks exactly like a collapse
3061
- * until it does. Only a zero that is still zero when the timer runs out gets
3062
- * said out loud.
3119
+ * until it does. While the page is still loading it can take far longer: a
3120
+ * collection that scrolls sideways gives its cards their width once it has
3121
+ * rendered, after its script and fonts are in. So the wait starts once the
3122
+ * page has loaded, and only a zero that is still zero 250ms after that gets
3123
+ * said out loud. The observer keeps watching after that, so a width that
3124
+ * arrives even later takes the fact back.
3063
3125
  */
3064
3126
  _watchForCollapse() {
3065
3127
  if (!import.meta.env?.DEV) return;
@@ -3078,26 +3140,29 @@ var _NLDDButtonGroup = class NLDDButtonGroup extends LitElement {
3078
3140
  return;
3079
3141
  }
3080
3142
  if (this._collapseVerdict !== 0) return;
3081
- this._collapseVerdict = window.setTimeout(() => {
3082
- if (!this.isConnected || this.getClientRects().length === 0) return;
3083
- if (this.getBoundingClientRect().width > 0) return;
3084
- setState$1(this, "no-width", true);
3085
- this._stopWatchingForCollapse();
3086
- }, 250);
3143
+ this._collapseVerdict = PENDING;
3144
+ pageLoaded().then(() => {
3145
+ if (this._collapseVerdict !== PENDING) return;
3146
+ this._collapseVerdict = window.setTimeout(() => {
3147
+ this._collapseVerdict = 0;
3148
+ if (!this.isConnected || this.getClientRects().length === 0) return;
3149
+ if (this.getBoundingClientRect().width > 0) return;
3150
+ setState$1(this, "no-width", true);
3151
+ }, 250);
3152
+ });
3087
3153
  });
3088
3154
  this._collapseObserver.observe(this);
3089
3155
  }
3090
3156
  _stopWatchingForCollapse() {
3091
3157
  this._collapseObserver?.disconnect();
3092
3158
  this._collapseObserver = null;
3093
- if (this._collapseVerdict) clearTimeout(this._collapseVerdict);
3159
+ if (this._collapseVerdict > 0) clearTimeout(this._collapseVerdict);
3094
3160
  this._collapseVerdict = 0;
3095
3161
  }
3096
3162
  render() {
3097
3163
  return template$19.call(this);
3098
3164
  }
3099
- };
3100
- var NLDDButtonGroup = (_NLDDButtonGroup.styles = buttonGroupStyles, _NLDDButtonGroup);
3165
+ }, _NLDDButtonGroup.styles = buttonGroupStyles, _NLDDButtonGroup);
3101
3166
  __decorate([property({
3102
3167
  reflect: true,
3103
3168
  converter: reflectNonDefault("md")
@@ -3128,9 +3193,9 @@ NLDDButtonGroup = __decorate([customElement("nldd-button-group")], NLDDButtonGro
3128
3193
  * @attr {string} text - Main text (heading or paragraph, depending on heading-level)
3129
3194
  * @attr {string} supporting-text - Supporting text below the heading
3130
3195
  * @attr {1|2|3|4|5|6} heading-level - Renders text as h1–h6; absent renders a p
3131
- * @attr {'left'|'center'} horizontal-alignment - Overrides the alignment of text, icon and actions. Unset (the default) derives it: content in the default slot means a task, which aligns left; a bare message stays centered. Left alignment also lays the actions out in a row instead of stacked full-width.
3196
+ * @attr {'left'|'center'} horizontal-alignment - Overrides the alignment of text, icon and actions. Unset (the default) derives it: content in the default slot means a task, which aligns left; a bare message stays centered. Centered, the actions stack at most 360px wide, even where two would fit side by side. Left-aligned, they sit in a row, each as wide as its label.
3132
3197
  *
3133
- * @slot - Optional custom content between text and actions
3198
+ * @slot - Optional custom content between text and actions. Puts no space between its children, as a sheet or card does not: the app decides the distance. Put an nldd-spacer between different components, and a group of the same, such as form fields, in an nldd-container with layout="stack" and a gap.
3134
3199
  * @slot actions - nldd-button elements, wrapped in nldd-button-group (max 3)
3135
3200
  */
3136
3201
  var _NLDDInlineDialog = class NLDDInlineDialog extends LitElement {
@@ -3760,6 +3825,7 @@ var NLDDMenuItem = class NLDDMenuItem extends LitElement {
3760
3825
  });
3761
3826
  }
3762
3827
  focus(options) {
3828
+ if (deferFocus(this, options)) return;
3763
3829
  (this.shadowRoot?.querySelector("button, a"))?.focus(options);
3764
3830
  }
3765
3831
  get _submenuEl() {
@@ -3978,6 +4044,8 @@ function nameOfAnchor(anchor) {
3978
4044
  const root = anchor.getRootNode();
3979
4045
  return root instanceof ShadowRoot ? nameOfAnchor(root.host) : "";
3980
4046
  }
4047
+ /** How long the options have to stay the same before their number is said. */
4048
+ var ANNOUNCE_RESULTS_DELAY_MS = 500;
3981
4049
  /**
3982
4050
  * A floating menu component using the Popover API.
3983
4051
  * Positioned relative to an anchor element using Floating UI.
@@ -4039,6 +4107,7 @@ var NLDDMenu = class NLDDMenu extends LitElement {
4039
4107
  this._cleanupAutoUpdate = null;
4040
4108
  this._announceRaf = 0;
4041
4109
  this._pendingAnnouncement = "";
4110
+ this._announceResultsTimer = 0;
4042
4111
  this._resyncAnchorFromPopoverState = () => {
4043
4112
  const reallyOpen = this.matches(":popover-open");
4044
4113
  if (reallyOpen === this._isOpen) return;
@@ -4047,9 +4116,9 @@ var NLDDMenu = class NLDDMenu extends LitElement {
4047
4116
  };
4048
4117
  this._seededPopupType = null;
4049
4118
  this._handleDocumentClick = (event) => {
4050
- if (this.anchorElement) return;
4051
4119
  const collapsedByGesture = this._collapsedByPointerGesture;
4052
4120
  this._collapsedByPointerGesture = false;
4121
+ if (this.anchorElement) return;
4053
4122
  const anchorEl = this._getAnchorEl();
4054
4123
  if (!anchorEl) return;
4055
4124
  if (!event.composedPath().includes(anchorEl)) return;
@@ -4353,6 +4422,17 @@ var NLDDMenu = class NLDDMenu extends LitElement {
4353
4422
  const anchor = this._getAnchorEl();
4354
4423
  return anchor ? nameOfAnchor(anchor) : "";
4355
4424
  }
4425
+ /**
4426
+ * Whether the invoking control should treat this menu as open on a
4427
+ * pointerdown. In drill-in mode the root is hidden while a submenu shows,
4428
+ * and the same pointerdown on the anchor collapses that submenu before the
4429
+ * control looks, so `:popover-open` alone would make its click reopen the
4430
+ * main level.
4431
+ * @internal
4432
+ */
4433
+ _shownForInvoker() {
4434
+ return this.matches(":popover-open") || this._openChain.length > 0 || this._collapsedByPointerGesture;
4435
+ }
4356
4436
  /** @internal */
4357
4437
  _getAnchorEl() {
4358
4438
  if (this.anchorElement) return this.anchorElement;
@@ -4492,6 +4572,8 @@ var NLDDMenu = class NLDDMenu extends LitElement {
4492
4572
  }
4493
4573
  disconnectedCallback() {
4494
4574
  super.disconnectedCallback();
4575
+ clearTimeout(this._announceResultsTimer);
4576
+ this._announceResultsTimer = 0;
4495
4577
  if (this._activeSubmenu) this._activeSubmenu.hidePopover?.();
4496
4578
  this.removeEventListener("beforetoggle", this._handleBeforeToggle);
4497
4579
  this.removeEventListener("toggle", this._handleToggle);
@@ -4603,6 +4685,31 @@ var NLDDMenu = class NLDDMenu extends LitElement {
4603
4685
  if (this._isOpen) this.reposition();
4604
4686
  }
4605
4687
  /**
4688
+ * Says how many options a listbox shows, or its empty text when it shows
4689
+ * none, in the live region that is always there.
4690
+ *
4691
+ * The field that owns the listbox calls this after a keystroke and when
4692
+ * options arrive, since only the field knows that a search happened: the
4693
+ * menu cannot tell a filter from any other change to its items. The count
4694
+ * waits until the options stop changing for a moment, so a screen reader
4695
+ * hears the number you land on and not every one on the way. A closed menu
4696
+ * says nothing, as it shows nothing.
4697
+ *
4698
+ * @internal Called by nldd-combo-box and nldd-token-field.
4699
+ */
4700
+ _announceResults() {
4701
+ clearTimeout(this._announceResultsTimer);
4702
+ this._announceResultsTimer = window.setTimeout(() => {
4703
+ this._announceResultsTimer = 0;
4704
+ if (!this.isConnected || !this.matches(":popover-open")) return;
4705
+ const count = Array.from(this.querySelectorAll("nldd-menu-item:not([hidden])")).filter((item) => item.closest("nldd-menu") === this).length;
4706
+ let text;
4707
+ if (count === 0) text = ((this.shadowRoot?.querySelector("slot[name=\"empty\"]"))?.assignedNodes({ flatten: true }) ?? []).map((node) => node.textContent ?? "").join(" ").trim() || this._resolvedEmptyText;
4708
+ else text = count === 1 ? this._t("components.menu.one-result-text") : this._t("components.menu.results-text", { count });
4709
+ this._announce(text);
4710
+ }, ANNOUNCE_RESULTS_DELAY_MS);
4711
+ }
4712
+ /**
4606
4713
  * Hide each nldd-menu-group whose items are all filtered out — a labeled
4607
4714
  * heading above an empty section reads as broken. Runs after filter() has
4608
4715
  * updated individual item visibility.
@@ -7493,10 +7600,20 @@ function isDismissFromTitleBar(e) {
7493
7600
  * For a custom focus target inside the popover, put `autofocus` on the child you
7494
7601
  * want. Without it the popover host itself takes focus.
7495
7602
  *
7496
- * On sm the popover is a bottom sheet that closes with Escape or a tap outside
7497
- * it. Where that is not enough, give its content a title bar of its own, as in a
7498
- * sheet: an nldd-page with an nldd-top-title-bar and a `dismiss-text`. The
7499
- * popover catches the dismiss of that bar and closes. It draws no bar itself.
7603
+ * On md and up the popover closes with Escape or a click outside it, and that
7604
+ * click goes on to what it lands on, as with any native popover: the page has
7605
+ * no backdrop and stays in use, so a click on another control does what it
7606
+ * says in one go. It needs no close button of its own. Content that does, because
7607
+ * a stray click must not close it (a form, a few steps, work you would lose),
7608
+ * is more than a popover holds: use an nldd-sheet. nldd-just-in-time-education
7609
+ * is the exception, a manual popover that stays until it is dismissed.
7610
+ *
7611
+ * On sm the popover is a bottom sheet with a dimmed backdrop, which closes with
7612
+ * Escape or a tap outside it. That tap stops at the backdrop, as on every
7613
+ * native sheet: the dimming says the page is out of play. Where that is not
7614
+ * enough, give its content a title bar of its own, as in a sheet: an nldd-page
7615
+ * with an nldd-top-title-bar and a `dismiss-text`. The popover catches the
7616
+ * dismiss of that bar and closes. It draws no bar itself.
7500
7617
  *
7501
7618
  * @element nldd-popover
7502
7619
  *
@@ -7590,8 +7707,9 @@ var NLDDPopover = (_NLDDPopover2 = class NLDDPopover extends LitElement {
7590
7707
  const anchorEl = this._getAnchorEl();
7591
7708
  if (!anchorEl) return;
7592
7709
  if (!event.composedPath().includes(anchorEl)) return;
7593
- const popovertarget = anchorEl.getAttribute("popovertarget");
7710
+ const popovertarget = anchorEl.getAttribute("popovertarget") ?? anchorEl.popovertarget;
7594
7711
  if (popovertarget && this.id && popovertarget === this.id) return;
7712
+ if (anchorEl.popoverTargetElement === this) return;
7595
7713
  if (this._pointerdownOnAnchorWhileOpen) {
7596
7714
  this._pointerdownOnAnchorWhileOpen = false;
7597
7715
  return;
@@ -9776,7 +9894,7 @@ function topTitleBarTemplate(component) {
9776
9894
  </div>
9777
9895
  ` : nothing}
9778
9896
  <div class="top-title-bar__title-group"
9779
- aria-hidden=${component._hasAnchor ? "true" : nothing}
9897
+ aria-hidden=${component._hidesTitle ? "true" : nothing}
9780
9898
  >
9781
9899
  ${html$1`<${headingTag} class="top-title-bar__title">${component.text}</${headingTag}>`}
9782
9900
  ${component.supportingText ? html`
@@ -9831,6 +9949,10 @@ function topTitleBarTemplate(component) {
9831
9949
  * twice. Sighted readers see one at a time, and this makes that true for
9832
9950
  * everyone. Anchor at the heading, then, and not at some other element that
9833
9951
  * happens to sit at the right height: the bar hands its title over to it.
9952
+ * An `nldd-title` anchor without a `heading-level` gets the bar's own, so the
9953
+ * title it takes over is a heading of the same level. An anchor that is no
9954
+ * heading at all, and holds none, would leave the page without one: the bar
9955
+ * then keeps its own title for assistive technology and warns in development.
9834
9956
  *
9835
9957
  * The title stays on one line and is cut off with an ellipsis when it does not
9836
9958
  * fit, which on a narrow screen or at 400% zoom is soon. The bar is therefore
@@ -9874,6 +9996,7 @@ var _NLDDTopTitleBar = class NLDDTopTitleBar extends LitElement {
9874
9996
  this._anchorLayoutObserver = null;
9875
9997
  this._anchorAppearObserver = null;
9876
9998
  this._boundOnScroll = this._onScroll.bind(this);
9999
+ this._gaveHeadingLevel = false;
9877
10000
  this._onToolbarSlotChange = (e) => {
9878
10001
  const slot = e.target;
9879
10002
  this._hasToolbarItems = slot.assignedElements().length > 0;
@@ -9895,6 +10018,7 @@ var _NLDDTopTitleBar = class NLDDTopTitleBar extends LitElement {
9895
10018
  if (this.collapseAnchor) this._connectAnchor();
9896
10019
  this._updateAutoCompact();
9897
10020
  } else if (changed.has("text")) this._updateAutoCompact();
10021
+ if (changed.has("_anchorElement") || changed.has("headingLevel") && this._gaveHeadingLevel) this._syncAnchorHeading();
9898
10022
  }
9899
10023
  _updateAutoCompact() {
9900
10024
  if (this.collapseAnchor) return;
@@ -9914,6 +10038,29 @@ var _NLDDTopTitleBar = class NLDDTopTitleBar extends LitElement {
9914
10038
  get _hasAnchor() {
9915
10039
  return this._anchorElement !== null;
9916
10040
  }
10041
+ /** Whether the anchor takes over the title as a heading, so the bar's own
10042
+ * copy can go. See the class description. */
10043
+ get _hidesTitle() {
10044
+ const anchor = this._anchorElement;
10045
+ if (!anchor) return false;
10046
+ const heading = "h1, h2, h3, h4, h5, h6, [role=\"heading\"]";
10047
+ return anchor.localName === "nldd-title" || anchor.matches(heading) || anchor.querySelector(heading) !== null;
10048
+ }
10049
+ /** Hands the bar's heading level to an nldd-title anchor that has none, and
10050
+ * states whether the anchor is no heading. */
10051
+ _syncAnchorHeading() {
10052
+ const anchor = this._anchorElement;
10053
+ if (!anchor) return;
10054
+ if (anchor.localName === "nldd-title") {
10055
+ if (!anchor.hasAttribute("heading-level") || this._gaveHeadingLevel) {
10056
+ anchor.setAttribute("heading-level", String(this.headingLevel));
10057
+ this._gaveHeadingLevel = true;
10058
+ }
10059
+ setState$1(this, "anchor-not-heading", false);
10060
+ return;
10061
+ }
10062
+ setState$1(this, "anchor-not-heading", !this._hidesTitle);
10063
+ }
9917
10064
  _connectAnchor() {
9918
10065
  if (!this.collapseAnchor) {
9919
10066
  setState$1(this, "no-anchor", false);
@@ -9967,6 +10114,8 @@ var _NLDDTopTitleBar = class NLDDTopTitleBar extends LitElement {
9967
10114
  this._onScroll();
9968
10115
  }
9969
10116
  _teardownAnchor() {
10117
+ this._gaveHeadingLevel = false;
10118
+ setState$1(this, "anchor-not-heading", false);
9970
10119
  this._activeScrollTarget?.removeEventListener("scroll", this._boundOnScroll);
9971
10120
  this._activeScrollTarget = null;
9972
10121
  this._anchorElement = null;
@@ -11296,7 +11445,7 @@ var NLDDList = (_NLDDList2 = class NLDDList extends LitElement {
11296
11445
  activeId: this._searchFocused ? this._activeId : "",
11297
11446
  searchPlaceholder: this._t("components.list.search-placeholder-label"),
11298
11447
  searchAccessibleLabel: this.accessibleLabel || this._t("components.list.search-placeholder-label"),
11299
- searchClearLabel: this._t("components.list.search-clear-action"),
11448
+ searchClearLabel: this._t("components.list.clear-search-action"),
11300
11449
  hasSearchBarEnd: this._hasSearchBarEnd,
11301
11450
  onSearchInput: this._onSearchInput,
11302
11451
  onSearchKeyDown: this._onSearchKeyDown,
@@ -12173,6 +12322,7 @@ var NLDDListItem = (_NLDDListItem2 = class NLDDListItem extends withTranslations
12173
12322
  this._relayExpanded();
12174
12323
  this._syncExpandedFacts();
12175
12324
  }
12325
+ if (changed.has("accessibleLabel") || changed.has("href") || changed.has("button")) this._syncLabelFacts();
12176
12326
  if (changed.has("_arrowNavigation") || changed.has("_rovingActive")) this._syncRovingTabStops();
12177
12327
  if (changed.has("disabled")) {
12178
12328
  this._syncRovingTabStops();
@@ -12215,6 +12365,19 @@ var NLDDListItem = (_NLDDListItem2 = class NLDDListItem extends withTranslations
12215
12365
  segment._rowExpanded = this._resolvedExpanded;
12216
12366
  });
12217
12367
  }
12368
+ /**
12369
+ * An `accessible-label` replaces what the row says for assistive technology.
12370
+ * Someone who reads "Aanvraag A-1042" and says it to voice control finds no
12371
+ * control by that name when the label says something else (WCAG 2.5.3).
12372
+ * States whether the label starts with the visible title.
12373
+ */
12374
+ _syncLabelFacts() {
12375
+ const cell = this._ownDescendants("nldd-title-cell, nldd-text-cell")[0];
12376
+ const normalize = (text) => text.replace(/\*\*/g, "").replace(/\s+/g, " ").trim().toLowerCase();
12377
+ const title = normalize(cell?.getAttribute("text") ?? cell?.textContent ?? "");
12378
+ const without = Boolean(this.accessibleLabel) && Boolean(title) && !normalize(this.accessibleLabel).startsWith(title);
12379
+ setState$1(this, "label-without-title", without);
12380
+ }
12218
12381
  /** `expanded` needs a control to sit on; a plain container has none, and a
12219
12382
  * row with sub-pages in a navigation list is always open. */
12220
12383
  _syncExpandedFacts() {
@@ -12385,6 +12548,7 @@ var NLDDListItem = (_NLDDListItem2 = class NLDDListItem extends withTranslations
12385
12548
  * so consumers can call `listItemEl.focus()` without reaching into shadow DOM.
12386
12549
  */
12387
12550
  focus(options) {
12551
+ if (deferFocus(this, options)) return;
12388
12552
  if (this._action) {
12389
12553
  this._action.focus(options);
12390
12554
  return;
@@ -12709,7 +12873,7 @@ var template$13 = () => html`<slot></slot>`;
12709
12873
  *
12710
12874
  * @slot - Default slot for any content (buttons, switches, icons, etc.)
12711
12875
  */
12712
- var _NLDDCell = class NLDDCell extends VisibilityMixin(LitElement, "cells-container") {
12876
+ var _NLDDCell = class NLDDCell extends RowHeaderMixin(VisibilityMixin(LitElement, "cells-container")) {
12713
12877
  constructor(..._args) {
12714
12878
  super(..._args);
12715
12879
  this.width = "fit-content";
@@ -13436,14 +13600,14 @@ var nlddCodeMirrorTheme = [baseTheme, syntaxHighlighting(highlightStyle)];
13436
13600
  var loaders = {
13437
13601
  json: async () => (await import("./dist-CJm4tkNC.js")).json(),
13438
13602
  yaml: async () => (await import("./dist-DHhnz3Gv.js")).yaml(),
13439
- javascript: async () => (await import("./dist-DgjvHvsN.js").then((n) => n.t)).javascript(),
13440
- typescript: async () => (await import("./dist-DgjvHvsN.js").then((n) => n.t)).javascript({ typescript: true }),
13603
+ javascript: async () => (await import("./dist-4g23YHP0.js").then((n) => n.t)).javascript(),
13604
+ typescript: async () => (await import("./dist-4g23YHP0.js").then((n) => n.t)).javascript({ typescript: true }),
13441
13605
  css: async () => (await import("./dist-BNkeFjc3.js").then((n) => n.r)).css(),
13442
- html: async () => (await import("./dist-BaLc58I_.js").then((n) => n.t)).html(),
13606
+ html: async () => (await import("./dist-245LaK9m.js").then((n) => n.t)).html(),
13443
13607
  xml: async () => (await import("./dist-m70B83qb.js")).xml(),
13444
- python: async () => (await import("./dist-YYLChwRq.js")).python(),
13608
+ python: async () => (await import("./dist-Bf823YyL.js")).python(),
13445
13609
  rust: async () => (await import("./dist-B9YBOGFW.js")).rust(),
13446
- sql: async () => (await import("./dist-CJ9uLG0u.js")).sql(),
13610
+ sql: async () => (await import("./dist-DFjwTlJV.js")).sql(),
13447
13611
  markdown: async () => (await Promise.resolve().then(() => dist_exports)).markdown(),
13448
13612
  bash: async () => new LanguageSupport(StreamLanguage.define((await import("./shell-Dh5IwHd-.js")).shell)),
13449
13613
  toml: async () => new LanguageSupport(StreamLanguage.define((await import("./toml-D0Pix_8Q.js")).toml)),
@@ -14233,7 +14397,7 @@ function forceScrollLayerRepaint(el) {
14233
14397
  * @slot - Default slot for the code/text content (also the copy source)
14234
14398
  */
14235
14399
  var _NLDDCodeViewer;
14236
- var COPY_FEEDBACK_DURATION_MS = 2e3;
14400
+ var COPY_FEEDBACK_DURATION_MS$1 = 2e3;
14237
14401
  function isClipboardAvailable() {
14238
14402
  return typeof window !== "undefined" && window.isSecureContext === true && typeof navigator !== "undefined" && typeof navigator.clipboard?.writeText === "function";
14239
14403
  }
@@ -14284,6 +14448,7 @@ var NLDDCodeViewer = (_NLDDCodeViewer = class NLDDCodeViewer extends NLDDCodeMir
14284
14448
  return codeViewerTemplate(this);
14285
14449
  }
14286
14450
  focus(options) {
14451
+ if (deferFocus(this, options)) return;
14287
14452
  const scroller = this.view?.scrollDOM;
14288
14453
  if (this._isScrollable && scroller) scroller.focus(options);
14289
14454
  }
@@ -14483,7 +14648,7 @@ var NLDDCodeViewer = (_NLDDCodeViewer = class NLDDCodeViewer extends NLDDCodeMir
14483
14648
  if (this._copyState === "failure") return;
14484
14649
  this._copyResetTimer = setTimeout(() => {
14485
14650
  this._copyState = "idle";
14486
- }, COPY_FEEDBACK_DURATION_MS);
14651
+ }, COPY_FEEDBACK_DURATION_MS$1);
14487
14652
  }
14488
14653
  /** Leaving the button clears a failure, which no timer does. */
14489
14654
  _onCopyBlur() {
@@ -15441,7 +15606,10 @@ NLDDImage = __decorate([customElement("nldd-image")], NLDDImage);
15441
15606
  * language information the browser does not hyphenate. An
15442
15607
  * `overflow-wrap: break-word` safety net on headings, p and li is always on,
15443
15608
  * independent of this attribute, so a word wider than the column breaks
15444
- * instead of overflowing, without a hyphen; headings never get one.
15609
+ * instead of overflowing. Headings are hyphenated regardless of this
15610
+ * attribute, but only a word of at least 12 letters, as in `nldd-title`, so
15611
+ * a short word moves to the next line whole. A soft hyphen (`&shy;`) adds
15612
+ * a place to break of your own.
15445
15613
  */
15446
15614
  var MANAGED_LABEL_ATTR = "data-nldd-managed-label";
15447
15615
  var NLDDRichText = class NLDDRichText extends LitElement {
@@ -16237,6 +16405,9 @@ var titleStyles = css`
16237
16405
  /* # Host */
16238
16406
 
16239
16407
  :host {
16408
+ --_title-hyphenate-limit-before: 5;
16409
+ --_title-hyphenate-limit-after: 5;
16410
+ --_title-hyphenate-limit-chars: 12 var(--_title-hyphenate-limit-before) var(--_title-hyphenate-limit-after);
16240
16411
  --_title-sm-custom-size: initial;
16241
16412
  --_title-md-custom-size: initial;
16242
16413
  --_title-lg-custom-size: initial;
@@ -16486,6 +16657,11 @@ var titleStyles = css`
16486
16657
  font: var(--_title-font);
16487
16658
  overflow-wrap: anywhere;
16488
16659
  text-wrap: balance;
16660
+ -webkit-hyphens: auto;
16661
+ hyphens: auto;
16662
+ -webkit-hyphenate-limit-before: var(--_title-hyphenate-limit-before);
16663
+ -webkit-hyphenate-limit-after: var(--_title-hyphenate-limit-after);
16664
+ hyphenate-limit-chars: var(--_title-hyphenate-limit-chars);
16489
16665
  }
16490
16666
 
16491
16667
  ::slotted(:not([slot])) {
@@ -16497,6 +16673,11 @@ var titleStyles = css`
16497
16673
  font: var(--_title-font) !important;
16498
16674
  overflow-wrap: anywhere !important;
16499
16675
  text-wrap: balance !important;
16676
+ -webkit-hyphens: auto !important;
16677
+ hyphens: auto !important;
16678
+ -webkit-hyphenate-limit-before: var(--_title-hyphenate-limit-before) !important;
16679
+ -webkit-hyphenate-limit-after: var(--_title-hyphenate-limit-after) !important;
16680
+ hyphenate-limit-chars: var(--_title-hyphenate-limit-chars) !important;
16500
16681
  }
16501
16682
 
16502
16683
  .title__supporting-text {
@@ -16602,6 +16783,14 @@ function titleTemplate(component) {
16602
16783
  * it. Each of the three has a slot in the same place for content that is more
16603
16784
  * than text, and a filled slot takes the place of the attribute.
16604
16785
  *
16786
+ * A word too long for the line is hyphenated by syllable, with the `lang` of
16787
+ * the page: only a word of at least 12 letters, with at least 5 on each side, so
16788
+ * a short word moves to the next line whole. A soft hyphen (`&shy;`) adds a
16789
+ * place to break of your own, also where the browser has no dictionary for the
16790
+ * language: `overheids&shy;informatie`, or `\u00AD` in a string set from
16791
+ * script, where an entity is not read. Most browsers then break that word only
16792
+ * there; Safari may still pick a syllable of its own.
16793
+ *
16605
16794
  * @element nldd-title
16606
16795
  *
16607
16796
  * @attr {number} size - Visual size of the title: 1–6 (default: 3)
@@ -17815,12 +18004,12 @@ function formFieldTemplate(component) {
17815
18004
  <label class="form-field__label"
17816
18005
  @click=${(e) => component._focusInput(e)}
17817
18006
  >
17818
- ${component.label}
18007
+ <span>${renderBold(component.label)}</span>
17819
18008
  ${component.optional ? renderOptional(component.optionalLabel) : nothing}
17820
18009
  </label>
17821
18010
  ` : nothing}
17822
18011
  ${hasSupportingLabel ? html`
17823
- <span class="form-field__supporting-label">${component.supportingLabel}</span>
18012
+ <span class="form-field__supporting-label">${renderBold(component.supportingLabel)}</span>
17824
18013
  ` : nothing}
17825
18014
  </div>
17826
18015
  `;
@@ -17859,8 +18048,8 @@ function formFieldHelpTextTemplate(_component) {
17859
18048
  * @element nldd-form-field
17860
18049
  *
17861
18050
  * @attr {string} label-alignment - 'top' (default) | 'right' | 'left'. A value of its own always wins over the inherited form-label-alignment.
17862
- * @attr {string} label - Field label text. Omit for no-label layout.
17863
- * @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge.
18051
+ * @attr {string} label - Field label text. Omit for no-label layout. Supports **bold** markdown syntax, for the word to type in a confirmation; the accessible name of the control takes the text without the markers.
18052
+ * @attr {string} supporting-label - Short supporting text below the label. Same typography as optional badge. Supports **bold** markdown syntax.
17864
18053
  * @attr {boolean} optional - Shows an optional badge next to the label.
17865
18054
  * @attr {string} optional-label - Text for the optional badge. Defaults to 'Optioneel'.
17866
18055
  * @attr {string} form-label-alignment - Set by a wrapping nldd-form as a fallback. Do not set it yourself in consumer code.
@@ -17996,7 +18185,7 @@ var NLDDFormField = (_NLDDFormField = class NLDDFormField extends LitElement {
17996
18185
  _applyAccessibleLabel(input) {
17997
18186
  const attribute = "accessibleLabel" in input ? "accessible-label" : input instanceof HTMLInputElement || input instanceof HTMLSelectElement || input instanceof HTMLTextAreaElement ? "aria-label" : null;
17998
18187
  if (!attribute) return;
17999
- this._appliedLabel = setOwnedAttribute(input, attribute, this.label, this._appliedLabel);
18188
+ this._appliedLabel = setOwnedAttribute(input, attribute, stripBold(this.label), this._appliedLabel);
18000
18189
  }
18001
18190
  /**
18002
18191
  * Hands every validation list in this field the control it is about, so it
@@ -18205,11 +18394,23 @@ function validationItemTemplate(_component) {
18205
18394
  * There are no checkmarks. The control already shows a validation icon of its
18206
18395
  * own, and repeating that per line says the same thing three times.
18207
18396
  *
18397
+ * A field can be `invalid` while no item fails: the browser rejects
18398
+ * `naam@` as an e-mail address, and a `match="@"` item passes it. The list
18399
+ * then says what it can itself, so a field never turns red without a reason
18400
+ * under it. It reads the control's `validity` and names what is wrong (an
18401
+ * invalid e-mail or web address, an empty required field, too short, too long,
18402
+ * too low, too high), and says "Dit klopt nog niet." when it
18403
+ * cannot tell. An item of your own that fails always wins over this line.
18404
+ * The line is an nldd-validation-item the list adds to its own children while
18405
+ * it is needed, so nldd-form-field reads it to the control as it does every
18406
+ * other item: a line in the list's shadow root would be out of its reach.
18407
+ *
18208
18408
  * @element nldd-validation-list
18209
18409
  *
18210
18410
  * @attr {string} for - Id of the control this list is about. Not needed inside an nldd-form-field, which hands its own control over.
18211
18411
  * @attr {boolean} hint - Show every item before there is a verdict, as the requirements of the field. Overridable per item.
18212
18412
  * @attr {boolean} judging - Drop the hints, because this field has been judged. Turned on by the list itself once its control is `invalid`, and settable by hand. What turns red follows `invalid`, not this.
18413
+ * @attr {object} translations - Override translation keys (the line the list shows when the field is invalid and no item fails); unset keys fall back to Dutch.
18213
18414
  *
18214
18415
  * @slot - nldd-validation-item elements.
18215
18416
  *
@@ -18327,9 +18528,14 @@ var NLDDValidationList = (_NLDDValidationList = class NLDDValidationList extends
18327
18528
  this.hint = false;
18328
18529
  this.judging = false;
18329
18530
  this.control = null;
18531
+ this.translations = {};
18330
18532
  this._resolved = null;
18331
18533
  this._observer = null;
18332
18534
  this._onInput = () => this._evaluate();
18535
+ this._fallbackItem = null;
18536
+ }
18537
+ _t(key, vars) {
18538
+ return translate(this.translations, nlddValidationListTranslations, key, vars);
18333
18539
  }
18334
18540
  connectedCallback() {
18335
18541
  super.connectedCallback();
@@ -18367,7 +18573,7 @@ var NLDDValidationList = (_NLDDValidationList = class NLDDValidationList extends
18367
18573
  return validationListTemplate(this);
18368
18574
  }
18369
18575
  get _items() {
18370
- return Array.from(this.children).filter((el) => el instanceof NLDDValidationItem);
18576
+ return Array.from(this.children).filter((el) => el instanceof NLDDValidationItem && el !== this._fallbackItem);
18371
18577
  }
18372
18578
  /**
18373
18579
  * Finds the control and starts listening to it.
@@ -18446,10 +18652,50 @@ var NLDDValidationList = (_NLDDValidationList = class NLDDValidationList extends
18446
18652
  messages.push(item.textContent?.trim() ?? "");
18447
18653
  }
18448
18654
  }
18449
- this.classList.toggle("has-items", anyVisible);
18655
+ const fallback = invalid && !items.some((item) => item.unmet) ? this._fallbackText() : "";
18656
+ this._syncFallbackItem(fallback);
18657
+ this.classList.toggle("has-items", anyVisible || Boolean(fallback));
18450
18658
  setState$1(this, "rule-and-unmet", ruleAndUnmet);
18451
18659
  this._reportValidity(anyRuleFails, messages);
18452
18660
  }
18661
+ /** Adds, updates or removes the item that carries the fallback line. */
18662
+ _syncFallbackItem(text) {
18663
+ if (!text) {
18664
+ this._fallbackItem?.remove();
18665
+ this._fallbackItem = null;
18666
+ return;
18667
+ }
18668
+ if (!this._fallbackItem) {
18669
+ this._fallbackItem = document.createElement("nldd-validation-item");
18670
+ this._fallbackItem.toggleAttribute("data-fallback", true);
18671
+ }
18672
+ if (this._fallbackItem.textContent !== text) this._fallbackItem.textContent = text;
18673
+ this._fallbackItem.unmet = true;
18674
+ this._fallbackItem.visible = true;
18675
+ if (this._fallbackItem.parentElement !== this) this.append(this._fallbackItem);
18676
+ }
18677
+ /**
18678
+ * What the list can say about an invalid field when none of its items does.
18679
+ *
18680
+ * The platform's own verdict, read from `validity`. Its rule of its own, a
18681
+ * failing `match` and the like, never reaches here: that item would be unmet.
18682
+ */
18683
+ _fallbackText() {
18684
+ const control = this._resolved;
18685
+ const validity = control?.internals?.validity ?? control?.validity;
18686
+ const attr = (name) => control?.getAttribute(name) ?? "";
18687
+ if (validity?.typeMismatch) {
18688
+ const type = control?.type ?? attr("type");
18689
+ if (type === "email") return this._t("components.validation-list.email-text");
18690
+ if (type === "url") return this._t("components.validation-list.url-text");
18691
+ }
18692
+ if (validity?.valueMissing) return this._t("components.validation-list.value-missing-text");
18693
+ if (validity?.tooShort) return this._t("components.validation-list.too-short-text", { minlength: attr("minlength") });
18694
+ if (validity?.tooLong) return this._t("components.validation-list.too-long-text", { maxlength: attr("maxlength") });
18695
+ if (validity?.rangeUnderflow) return this._t("components.validation-list.range-underflow-text", { min: attr("min") });
18696
+ if (validity?.rangeOverflow) return this._t("components.validation-list.range-overflow-text", { max: attr("max") });
18697
+ return this._t("components.validation-list.invalid-text");
18698
+ }
18453
18699
  /**
18454
18700
  * Hands the verdict to the control, so a form with a failing rule does not
18455
18701
  * submit.
@@ -18482,6 +18728,7 @@ __decorate([property({
18482
18728
  })], NLDDValidationList.prototype, "judging", void 0);
18483
18729
  __decorate([property({ attribute: false })], NLDDValidationList.prototype, "control", void 0);
18484
18730
  __decorate([property({ attribute: false })], NLDDValidationList.prototype, "value", void 0);
18731
+ __decorate([property({ type: Object })], NLDDValidationList.prototype, "translations", void 0);
18485
18732
  __decorate([state()], NLDDValidationList.prototype, "_resolved", void 0);
18486
18733
  NLDDValidationList = __decorate([customElement("nldd-validation-list")], NLDDValidationList);
18487
18734
  // src/components/forms/form-section/form-section.ts
@@ -19090,6 +19337,7 @@ var _NLDDCheckbox = class NLDDCheckbox extends DescribedBy(FormAssociated(LitEle
19090
19337
  * call `checkboxEl.focus()` without reaching into shadow DOM.
19091
19338
  */
19092
19339
  focus(options) {
19340
+ if (deferFocus(this, options)) return;
19093
19341
  this.shadowRoot?.querySelector(".checkbox__input")?.focus(options);
19094
19342
  }
19095
19343
  render() {
@@ -19298,6 +19546,7 @@ var _NLDDCheckboxField = class NLDDCheckboxField extends DescribedBy(FormAssocia
19298
19546
  * reaching into shadow DOM.
19299
19547
  */
19300
19548
  focus(options) {
19549
+ if (deferFocus(this, options)) return;
19301
19550
  this.shadowRoot?.querySelector("nldd-checkbox")?.focus(options);
19302
19551
  }
19303
19552
  /** The checkbox it renders knows which element inside itself is the control. */
@@ -21280,6 +21529,9 @@ var codeEditorStyles = css`
21280
21529
  --_code-editor-gutter-background-color: var(--context-parent-background-color, var(--semantics-surfaces-base-background-color));
21281
21530
  --_code-editor-gutter-border-width: var(--semantics-dividers-thickness);
21282
21531
  --_code-editor-gutter-border-color: var(--semantics-dividers-color);
21532
+ --_code-editor-line-number-padding-left: var(--primitives-space-8);
21533
+ --_code-editor-line-number-padding-right: var(--primitives-space-8);
21534
+ --_code-editor-line-numbers-content-padding-left: var(--primitives-space-8);
21283
21535
  --_code-editor-input-field-border-z-index: 1;
21284
21536
  --_code-editor-input-field-border-color: transparent;
21285
21537
  --_code-editor-input-field-border-shadow: none;
@@ -21290,6 +21542,7 @@ var codeEditorStyles = css`
21290
21542
  --_code-editor-content-color: var(--semantics-content-color);
21291
21543
  --_code-editor-font: var(--primitives-font-monospace-sm-regular-snug);
21292
21544
  --_code-editor-rows: 6;
21545
+ --_code-editor-min-height: calc(var(--_code-editor-rows) * 1lh + 2 * var(--_code-editor-padding-block));
21293
21546
 
21294
21547
  /* iOS Safari auto-zooms a focused field rendered under 16px (sm is ~14px).
21295
21548
  Bump to the 16px md size on touch to prevent it; non-touch keeps the
@@ -21325,6 +21578,7 @@ var codeEditorStyles = css`
21325
21578
  --_code-editor-input-field-border-shadow: inset 0 0 0 var(--semantics-input-fields-border-width) var(--_code-editor-input-field-border-color);
21326
21579
  --_code-editor-padding-block: var(--semantics-controls-md-inline-padding);
21327
21580
  --_code-editor-padding-inline: var(--semantics-controls-md-inline-padding);
21581
+ --_code-editor-line-number-padding-left: var(--_code-editor-padding-inline);
21328
21582
  }
21329
21583
 
21330
21584
 
@@ -21381,10 +21635,9 @@ var codeEditorStyles = css`
21381
21635
 
21382
21636
  /* Padding lives on the content so the whole padded area is clickable and a
21383
21637
  click maps to the nearest line — no dead zone around the text. */
21384
- /* Inline padding sits on the scroller so it lands left of the line-number
21385
- gutter (the gutter stays inset with the text). Block + right padding sit
21386
- on the content so the padded area is clickable and horizontal scrolling
21387
- keeps its end padding. :host beats the shared theme's .cm-content reset. */
21638
+ /* Inline padding sits on the scroller, block + right padding on the content,
21639
+ so the padded area is clickable and horizontal scrolling keeps its end
21640
+ padding. :host beats the shared theme's .cm-content reset. */
21388
21641
  :host .cm-scroller {
21389
21642
  padding-left: var(--_code-editor-padding-inline);
21390
21643
  }
@@ -21392,18 +21645,37 @@ var codeEditorStyles = css`
21392
21645
  :host .cm-content {
21393
21646
  padding-block: var(--_code-editor-padding-block);
21394
21647
  padding-right: var(--_code-editor-padding-inline);
21395
- min-height: calc(var(--_code-editor-rows) * 1lh);
21648
+ min-height: var(--_code-editor-min-height);
21396
21649
  tab-size: 2;
21397
21650
  }
21398
21651
 
21399
- /* The gutter stays put while the code scrolls sideways under it. The
21400
- divider is a gradient: an inset shadow with an offset leaves a hairline on iOS. */
21652
+ /* The gutter stays put while the code scrolls sideways under it. */
21401
21653
  :host .cm-gutters.cm-gutters {
21402
21654
  background-color: var(--_code-editor-gutter-background-color);
21403
- background-image: linear-gradient(var(--_code-editor-gutter-border-color), var(--_code-editor-gutter-border-color));
21404
- background-repeat: no-repeat;
21405
- background-position: right;
21406
- background-size: var(--_code-editor-gutter-border-width) 100%;
21655
+ }
21656
+
21657
+ /* CodeMirror sizes the gutter to the document, so below the last line of a
21658
+ short one the gutter ends. The divider runs on to the rows floor. */
21659
+ :host .cm-gutters::after {
21660
+ content: '';
21661
+ position: absolute;
21662
+ top: 0;
21663
+ right: 0;
21664
+ width: var(--_code-editor-gutter-border-width);
21665
+ height: max(100%, var(--_code-editor-min-height));
21666
+ background-color: var(--_code-editor-gutter-border-color);
21667
+ }
21668
+
21669
+ :host([line-numbers]) .cm-scroller {
21670
+ padding-left: 0;
21671
+ }
21672
+
21673
+ :host([line-numbers]) .cm-content {
21674
+ padding-left: var(--_code-editor-line-numbers-content-padding-left);
21675
+ }
21676
+
21677
+ :host .cm-lineNumbers .cm-gutterElement {
21678
+ padding: 0 var(--_code-editor-line-number-padding-right) 0 var(--_code-editor-line-number-padding-left);
21407
21679
  }
21408
21680
 
21409
21681
  /* Read-only, like a native read-only field: select and copy, but no caret. */
@@ -21425,7 +21697,7 @@ var codeEditorStyles = css`
21425
21697
  auto (default) = grow, vertical = drag up from the floor, none = fixed. */
21426
21698
  :host .cm-scroller {
21427
21699
  resize: none;
21428
- min-height: calc(var(--_code-editor-rows) * 1lh + 2 * var(--_code-editor-padding-block));
21700
+ min-height: var(--_code-editor-min-height);
21429
21701
  }
21430
21702
 
21431
21703
  :host([resize="vertical"]) .cm-scroller {
@@ -21433,7 +21705,7 @@ var codeEditorStyles = css`
21433
21705
  }
21434
21706
 
21435
21707
  :host([resize="none"]) .cm-editor {
21436
- height: calc(var(--_code-editor-rows) * 1lh + 2 * var(--_code-editor-padding-block));
21708
+ height: var(--_code-editor-min-height);
21437
21709
  }
21438
21710
  `;
21439
21711
  // src/components/inputs/code-editor/code-editor.template.ts
@@ -21890,6 +22162,10 @@ function submitOnEnter(host, event) {
21890
22162
  * A text input with autocomplete dropdown via nldd-menu.
21891
22163
  * Add a slotted nldd-menu with nldd-menu-item children to provide options.
21892
22164
  *
22165
+ * After typing, a screen reader hears how many options are shown ("2 resultaten"),
22166
+ * or the empty text when none are, also for options that a server sends in
22167
+ * later. Only the number it lands on: it waits until the options settle.
22168
+ *
21893
22169
  * The slotted nldd-menu keeps its default focus behavior (menu container receives focus)
21894
22170
  * so that typing keeps focus on the input. The picker button moves focus
21895
22171
  * to the menu explicitly on activation.
@@ -22020,11 +22296,13 @@ var NLDDComboBox = (_NLDDComboBox2 = class NLDDComboBox extends DescribedBy(Form
22020
22296
  if (!this._menu || this.shadowRoot?.activeElement !== this._input) return;
22021
22297
  if (this._menu.matches(":popover-open")) {
22022
22298
  if (this.allowCustom && !this._hasVisibleMenuItems()) this._closeMenu();
22299
+ else this._menu._announceResults();
22023
22300
  return;
22024
22301
  }
22025
22302
  if (this._openPending && this._hasVisibleMenuItems()) {
22026
22303
  this._openPending = false;
22027
22304
  this._openMenu();
22305
+ this._menu._announceResults();
22028
22306
  }
22029
22307
  };
22030
22308
  this._pickerPointerdownWhileOpen = false;
@@ -22205,6 +22483,7 @@ var NLDDComboBox = (_NLDDComboBox2 = class NLDDComboBox extends DescribedBy(Form
22205
22483
  if (this.allowCustom && this._isOpen && !this._hasVisibleMenuItems()) this._closeMenu();
22206
22484
  if (!this._isOpen) this._openMenu();
22207
22485
  this._openPending = this.text !== "" && !this._menu?.matches(":popover-open");
22486
+ this._menu?._announceResults();
22208
22487
  this.commitFormValue();
22209
22488
  this.dispatchEvent(new CustomEvent("input", {
22210
22489
  detail: { value: this.text },
@@ -22330,6 +22609,7 @@ var NLDDComboBox = (_NLDDComboBox2 = class NLDDComboBox extends DescribedBy(Form
22330
22609
  * `comboBoxEl.focus()` without reaching into shadow DOM.
22331
22610
  */
22332
22611
  focus(options) {
22612
+ if (deferFocus(this, options)) return;
22333
22613
  this._input?.focus(options);
22334
22614
  }
22335
22615
  render() {
@@ -23159,7 +23439,7 @@ function renderHeader(component) {
23159
23439
  </h2>
23160
23440
  ${months.length < 2 ? nothing : html`
23161
23441
  <nldd-menu class="date-picker__month-menu"
23162
- accessible-label=${component._t("components.date-picker.choose-month-action")}
23442
+ accessible-label=${component._t("components.date-picker.to-choose-month-action")}
23163
23443
  width="176px"
23164
23444
  @toggle=${component._handleMonthMenuToggle}
23165
23445
  >
@@ -23175,7 +23455,7 @@ function renderHeader(component) {
23175
23455
  `}
23176
23456
  ${years.length < 2 ? nothing : html`
23177
23457
  <nldd-menu class="date-picker__year-menu"
23178
- accessible-label=${component._t("components.date-picker.choose-year-action")}
23458
+ accessible-label=${component._t("components.date-picker.to-choose-year-action")}
23179
23459
  max-items="8"
23180
23460
  width="136px"
23181
23461
  @toggle=${component._handleYearMenuToggle}
@@ -23572,6 +23852,7 @@ var NLDDDatePicker = (_NLDDDatePicker = class NLDDDatePicker extends DescribedBy
23572
23852
  * until the user has tabbed into the grid themselves.
23573
23853
  */
23574
23854
  focus(options) {
23855
+ if (deferFocus(this, options)) return;
23575
23856
  const cell = this._focusedCell();
23576
23857
  if (cell) cell.focus(options);
23577
23858
  else super.focus(options);
@@ -25041,7 +25322,8 @@ var _NLDDDropdown = class NLDDDropdown extends DescribedBy(LitElement) {
25041
25322
  * to send focus.
25042
25323
  */
25043
25324
  focus(options) {
25044
- this._select?.focus(options);
25325
+ if (deferFocus(this, options)) return;
25326
+ (this._select ?? this.querySelector("select"))?.focus(options);
25045
25327
  }
25046
25328
  /** The consumer's own <select>, which it slots in the light DOM. */
25047
25329
  describedTarget() {
@@ -25102,6 +25384,7 @@ var fileFieldStyles = css`
25102
25384
  --_file-field-value-color: var(--semantics-content-color);
25103
25385
  --_file-field-text-font: var(--semantics-input-fields-md-text-font);
25104
25386
  --_file-field-clear-button-padding-right: calc((var(--_file-field-min-size) - var(--semantics-controls-sm-min-size)) / 2);
25387
+ --_file-field-more-button-padding-right: var(--_file-field-clear-button-padding-right);
25105
25388
  --_file-field-validation-icon-area-padding-right: var(--_file-field-inline-padding);
25106
25389
  --_file-field-validation-icon-size: var(--semantics-input-fields-md-validation-icon-size);
25107
25390
  --_file-field-highlight-border-width: var(--semantics-surfaces-highlight-border-width);
@@ -25115,19 +25398,22 @@ var fileFieldStyles = css`
25115
25398
  --_file-field-rejected-border-color: var(--semantics-drop-targets-is-rejected-border-color);
25116
25399
  --_file-field-rejected-background-color: var(--semantics-drop-targets-is-rejected-background-color);
25117
25400
  --_file-field-file-icon-size: var(--primitives-space-24);
25118
- --_file-field-actions-gap: var(--primitives-space-4);
25119
- --_file-field-browse-action-color: var(--semantics-controls-is-selected-indicator-color);
25120
- --_file-field-browse-is-hovered-highlight-border-color: light-dark(var(--primitives-color-neutral-100), var(--primitives-color-neutral-250));
25121
- --_file-field-browse-is-active-highlight-border-color: light-dark(var(--primitives-color-neutral-150), var(--primitives-color-neutral-300));
25122
- --_file-field-browse-is-hovered-background-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-100));
25123
- --_file-field-browse-is-active-background-color: light-dark(var(--primitives-color-neutral-75), var(--primitives-color-neutral-150));
25124
- --_file-field-browse-action-font: var(--semantics-buttons-md-primary-text-font);
25401
+ --_file-field-file-icon-gap: var(--primitives-space-8);
25402
+ --_file-field-button-group-gap: var(--primitives-space-6);
25403
+ --_file-field-choose-text-color: var(--semantics-controls-is-selected-indicator-color);
25404
+ --_file-field-choose-button-is-hovered-highlight-border-color: light-dark(var(--primitives-color-neutral-100), var(--primitives-color-neutral-250));
25405
+ --_file-field-choose-button-is-active-highlight-border-color: light-dark(var(--primitives-color-neutral-150), var(--primitives-color-neutral-300));
25406
+ --_file-field-choose-button-is-hovered-background-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-100));
25407
+ --_file-field-choose-button-is-active-background-color: light-dark(var(--primitives-color-neutral-75), var(--primitives-color-neutral-150));
25408
+ --_file-field-choose-text-font: var(--semantics-buttons-md-primary-text-font);
25125
25409
  --_file-field-area-min-height: var(--primitives-area-160);
25126
25410
  --_file-field-area-padding: var(--primitives-space-16);
25127
25411
  --_file-field-area-gap: var(--primitives-space-2);
25128
25412
  --_file-field-area-icon-size: var(--primitives-space-40);
25129
- --_file-field-area-actions-padding-top: var(--primitives-space-16);
25130
- --_file-field-area-actions-max-width: var(--primitives-area-320);
25413
+ --_file-field-area-edit-button-group-padding-top: var(--primitives-space-8);
25414
+ --_file-field-area-choose-button-group-margin-top: var(--primitives-space-4);
25415
+ --_file-field-area-choose-button-group-margin-bottom: var(--primitives-space-8);
25416
+ --_file-field-drop-area-drop-hint-text-color: var(--semantics-content-color);
25131
25417
  --_file-field-accepted-types-color: var(--semantics-content-secondary-color);
25132
25418
  --_file-field-accepted-types-font: var(--primitives-font-body-sm-regular-tight);
25133
25419
 
@@ -25143,24 +25429,42 @@ var fileFieldStyles = css`
25143
25429
  display: none;
25144
25430
  }
25145
25431
 
25146
- :host([disabled]) {
25147
- opacity: var(--primitives-opacity-disabled);
25148
- pointer-events: none;
25149
- }
25150
-
25151
25432
  :host([size="sm"]) {
25152
25433
  --_file-field-corner-radius: var(--semantics-controls-sm-corner-radius);
25153
25434
  --_file-field-min-size: var(--semantics-controls-sm-min-size);
25154
25435
  --_file-field-inline-padding: var(--semantics-controls-sm-inline-padding);
25155
25436
  --_file-field-text-font: var(--semantics-input-fields-sm-text-font);
25156
25437
  --_file-field-clear-button-padding-right: calc((var(--_file-field-min-size) - var(--semantics-controls-xs-min-size)) / 2);
25438
+ --_file-field-more-button-padding-right: var(--primitives-space-6);
25157
25439
  --_file-field-validation-icon-size: var(--semantics-input-fields-sm-validation-icon-size);
25158
25440
  --_file-field-file-icon-size: var(--primitives-space-20);
25159
- --_file-field-browse-action-font: var(--semantics-buttons-sm-primary-text-font);
25441
+ --_file-field-file-icon-gap: var(--primitives-space-6);
25442
+ --_file-field-choose-text-font: var(--semantics-buttons-sm-primary-text-font);
25160
25443
  --_file-field-area-icon-size: var(--primitives-space-32);
25444
+ --_file-field-area-min-height: var(--primitives-area-120);
25445
+ --_file-field-area-padding: var(--primitives-space-12);
25161
25446
  --_file-field-accepted-types-font: var(--primitives-font-body-xs-regular-tight);
25162
25447
  }
25163
25448
 
25449
+ :host([variant="area"]:not([size="sm"])) {
25450
+ --_file-field-button-group-gap: var(--primitives-space-8);
25451
+ }
25452
+
25453
+ :host([directory]) {
25454
+ --_file-field-area-min-height: var(--primitives-area-200);
25455
+ --_file-field-area-stacked-min-height: var(--primitives-area-240);
25456
+ }
25457
+
25458
+ :host([directory][size="sm"]) {
25459
+ --_file-field-area-min-height: var(--primitives-area-160);
25460
+ --_file-field-area-stacked-min-height: var(--primitives-area-200);
25461
+ }
25462
+
25463
+ :host([disabled]) {
25464
+ opacity: var(--primitives-opacity-disabled);
25465
+ pointer-events: none;
25466
+ }
25467
+
25164
25468
 
25165
25469
  /* # Block */
25166
25470
 
@@ -25176,7 +25480,6 @@ var fileFieldStyles = css`
25176
25480
  align-items: center;
25177
25481
  }
25178
25482
 
25179
-
25180
25483
  .file-field::before {
25181
25484
  box-sizing: border-box;
25182
25485
  position: absolute;
@@ -25187,12 +25490,27 @@ var fileFieldStyles = css`
25187
25490
  pointer-events: none;
25188
25491
  }
25189
25492
 
25190
- .file-field:not([class*="is-drag-"]):has(> .file-field__browse-button:hover) {
25191
- --_file-field-highlight-border-color: var(--_file-field-browse-is-hovered-highlight-border-color);
25493
+ .file-field:not([class*="is-drag-"]):has(> .file-field__choose-button:hover) {
25494
+ --_file-field-highlight-border-color: var(--_file-field-choose-button-is-hovered-highlight-border-color);
25495
+ }
25496
+
25497
+ .file-field:not([class*="is-drag-"]):has(> .file-field__choose-button:active) {
25498
+ --_file-field-highlight-border-color: var(--_file-field-choose-button-is-active-highlight-border-color);
25499
+ }
25500
+
25501
+ .file-field.is-refused {
25502
+ cursor: default;
25503
+ user-select: none;
25504
+ }
25505
+
25506
+ .file-field.is-refused:hover {
25507
+ --_file-field-highlight-border-color: var(--_file-field-choose-button-is-hovered-highlight-border-color);
25508
+ --_file-field-background-color: var(--_file-field-choose-button-is-hovered-background-color);
25192
25509
  }
25193
25510
 
25194
- .file-field:not([class*="is-drag-"]):has(> .file-field__browse-button:active) {
25195
- --_file-field-highlight-border-color: var(--_file-field-browse-is-active-highlight-border-color);
25511
+ .file-field.is-refused:active {
25512
+ --_file-field-highlight-border-color: var(--_file-field-choose-button-is-active-highlight-border-color);
25513
+ --_file-field-background-color: var(--_file-field-choose-button-is-active-background-color);
25196
25514
  }
25197
25515
 
25198
25516
  .file-field.is-drag-page {
@@ -25206,7 +25524,6 @@ var fileFieldStyles = css`
25206
25524
  --_file-field-background-color: var(--_file-field-drop-background-color);
25207
25525
  }
25208
25526
 
25209
-
25210
25527
  .file-field.is-drag-rejected {
25211
25528
  --_file-field-highlight-border-width: var(--_file-field-drop-border-width);
25212
25529
  --_file-field-highlight-border-color: var(--_file-field-rejected-border-color);
@@ -25216,11 +25533,20 @@ var fileFieldStyles = css`
25216
25533
 
25217
25534
  /* # Elements */
25218
25535
 
25219
- .file-field__input {
25536
+ .file-field__input,
25537
+ .file-field__folder-input {
25220
25538
  display: none;
25221
25539
  }
25222
25540
 
25223
- .file-field__browse-button,
25541
+ .file-field__menu-anchor {
25542
+ position: absolute;
25543
+ pointer-events: none;
25544
+ width: 0;
25545
+ height: 0;
25546
+ }
25547
+
25548
+ .file-field__choose-button,
25549
+ .file-field__drop-area,
25224
25550
  .file-field__replace-area {
25225
25551
  box-sizing: border-box;
25226
25552
  display: flex;
@@ -25240,30 +25566,51 @@ var fileFieldStyles = css`
25240
25566
  text-align: center;
25241
25567
  }
25242
25568
 
25243
- .file-field:not([class*="is-drag-"]) > .file-field__browse-button:hover {
25244
- background-color: var(--_file-field-browse-is-hovered-background-color);
25569
+ .file-field:not([class*="is-drag-"]) > .file-field__choose-button:hover {
25570
+ background-color: var(--_file-field-choose-button-is-hovered-background-color);
25245
25571
  }
25246
25572
 
25247
- .file-field:not([class*="is-drag-"]) > .file-field__browse-button:active {
25248
- background-color: var(--_file-field-browse-is-active-background-color);
25573
+ .file-field:not([class*="is-drag-"]) > .file-field__choose-button:active {
25574
+ background-color: var(--_file-field-choose-button-is-active-background-color);
25249
25575
  }
25250
25576
 
25251
- .file-field__browse-button:focus-visible {
25577
+ .file-field__dismiss-button {
25578
+ position: absolute;
25579
+ inset: 0;
25580
+ z-index: 1;
25581
+ margin: 0;
25582
+ border: none;
25583
+ border-radius: inherit;
25584
+ padding: 0;
25585
+ background: none;
25586
+ cursor: default;
25587
+ }
25588
+
25589
+ .file-field__dismiss-button:focus-visible,
25590
+ .file-field__choose-button:focus-visible {
25252
25591
  outline: var(--semantics-focus-ring-outline);
25253
25592
  outline-offset: var(--semantics-focus-ring-outline-offset);
25254
25593
  box-shadow: var(--semantics-focus-ring-box-shadow);
25255
25594
  }
25256
25595
 
25257
- .file-field__browse-button:focus:not(:focus-visible) {
25596
+ .file-field__dismiss-button:focus:not(:focus-visible),
25597
+ .file-field__choose-button:focus:not(:focus-visible) {
25258
25598
  outline: none;
25259
25599
  }
25260
25600
 
25261
- :host([valid]) .file-field:not(.file-field--area) :is(.file-field__browse-button, .file-field__replace-area),
25262
- :host([invalid]) .file-field:not(.file-field--area) :is(.file-field__browse-button, .file-field__replace-area) {
25601
+ :host([valid]) .file-field:not(.file-field--area) :is(.file-field__choose-button, .file-field__replace-area),
25602
+ :host([invalid]) .file-field:not(.file-field--area) :is(.file-field__choose-button, .file-field__replace-area) {
25263
25603
  padding-left: calc(var(--_file-field-validation-icon-size) + var(--_file-field-validation-icon-area-padding-right));
25264
25604
  }
25265
25605
 
25266
- .file-field__sentence {
25606
+ .file-field__text,
25607
+ .file-field__value {
25608
+ display: grid;
25609
+ grid-template-columns: minmax(0, 1fr);
25610
+ align-items: center;
25611
+ }
25612
+
25613
+ .file-field__text {
25267
25614
  padding-block: var(--primitives-space-8);
25268
25615
  white-space: normal;
25269
25616
  overflow-wrap: anywhere;
@@ -25271,6 +25618,7 @@ var fileFieldStyles = css`
25271
25618
  }
25272
25619
 
25273
25620
  .file-field__chosen-area {
25621
+ container: file-field-chosen-area / inline-size;
25274
25622
  display: grid;
25275
25623
  min-width: 0;
25276
25624
  flex-grow: 1;
@@ -25294,37 +25642,18 @@ var fileFieldStyles = css`
25294
25642
  visibility: hidden;
25295
25643
  }
25296
25644
 
25297
- .file-field__texts {
25298
- display: grid;
25299
- min-width: 0;
25300
- grid-template-columns: minmax(0, 1fr);
25301
- align-items: center;
25302
- }
25303
-
25304
- .file-field__text {
25645
+ :is(.file-field__text, .file-field__value) > * {
25305
25646
  grid-area: 1 / 1;
25306
25647
  min-width: 0;
25307
25648
  }
25308
25649
 
25309
- .file-field__text:not(.is-active) {
25650
+ :is(.file-field__text, .file-field__value) > :not(.is-active) {
25310
25651
  visibility: hidden;
25311
25652
  }
25312
25653
 
25313
- .file-field__text--rejected {
25314
- white-space: normal;
25315
- overflow-wrap: anywhere;
25316
- text-wrap: balance;
25317
- }
25318
-
25319
- @media (hover: none) {
25320
- :is(.file-field__text--drag, .file-field__text--drop, .file-field__text--rejected) {
25321
- display: none;
25322
- }
25323
- }
25324
-
25325
- .file-field__browse-action {
25326
- color: var(--_file-field-browse-action-color);
25327
- font: var(--_file-field-browse-action-font);
25654
+ .file-field__choose-text {
25655
+ color: var(--_file-field-choose-text-color);
25656
+ font: var(--_file-field-choose-text-font);
25328
25657
  }
25329
25658
 
25330
25659
  .file-field__file-icon {
@@ -25335,8 +25664,50 @@ var fileFieldStyles = css`
25335
25664
  color: var(--semantics-content-color);
25336
25665
  }
25337
25666
 
25667
+ .file-field:not(.file-field--area) .file-field__chosen-file {
25668
+ @container file-field-chosen-area (max-width: 14.9375rem) {
25669
+ .file-field__file-icon {
25670
+ display: none;
25671
+ }
25672
+
25673
+ .file-field__value {
25674
+ padding-left: var(--_file-field-inline-padding);
25675
+ }
25676
+ }
25677
+
25678
+ @container file-field-chosen-area (max-width: 19.9375rem) {
25679
+ :is(.file-field__change-button, .file-field__clear-button) {
25680
+ display: none;
25681
+ }
25682
+
25683
+ .file-field__edit-button-group:last-child {
25684
+ padding-right: var(--_file-field-more-button-padding-right);
25685
+ }
25686
+ }
25687
+
25688
+ @container file-field-chosen-area (min-width: 20rem) {
25689
+ .file-field__more-button {
25690
+ display: none;
25691
+ }
25692
+ }
25693
+ }
25694
+
25695
+ .file-field__chosen-file {
25696
+ @container file-field-chosen-area (max-width: 19.9375rem) {
25697
+ .file-field__folder.file-field__folder--full {
25698
+ display: none;
25699
+ }
25700
+ }
25701
+
25702
+ @container file-field-chosen-area (min-width: 20rem) {
25703
+ .file-field__folder.file-field__folder--short {
25704
+ display: none;
25705
+ }
25706
+ }
25707
+ }
25708
+
25338
25709
  .file-field__value,
25339
- .file-field__sentence {
25710
+ .file-field__text {
25340
25711
  box-sizing: border-box;
25341
25712
  min-width: 0;
25342
25713
  padding-right: var(--_file-field-inline-padding);
@@ -25347,44 +25718,95 @@ var fileFieldStyles = css`
25347
25718
  }
25348
25719
 
25349
25720
  .file-field__value {
25350
- text-overflow: ellipsis;
25721
+ padding-left: var(--_file-field-file-icon-gap);
25351
25722
  white-space: nowrap;
25352
25723
  overflow: hidden;
25353
25724
  }
25354
25725
 
25355
- :is(.file-field__text--drag, .file-field__text--drop, .file-field__text--rejected) {
25356
- font: var(--_file-field-browse-action-font);
25726
+ .file-field__value > * {
25727
+ text-overflow: ellipsis;
25728
+ overflow: hidden;
25729
+ }
25730
+
25731
+ :is(.file-field__drag-text, .file-field__drop-text, .file-field__rejected-text) {
25732
+ font: var(--_file-field-choose-text-font);
25357
25733
  }
25358
25734
 
25359
- .file-field__text--drop {
25360
- color: var(--_file-field-browse-action-color);
25735
+ .file-field__drop-text {
25736
+ color: var(--_file-field-choose-text-color);
25361
25737
  }
25362
25738
 
25363
- .file-field__text--rejected {
25739
+ .file-field__rejected-text {
25364
25740
  color: var(--_file-field-rejected-color);
25365
25741
  }
25366
25742
 
25367
- .file-field__hint {
25743
+ .file-field__reading-text {
25744
+ display: flex;
25745
+ height: 1lh;
25746
+ align-items: center;
25747
+ justify-content: center;
25748
+ }
25749
+
25750
+ .file-field__drop-hint-text {
25368
25751
  color: var(--semantics-content-secondary-color);
25369
25752
  }
25370
25753
 
25371
- .file-field__value {
25372
- padding-left: var(--primitives-space-8);
25754
+ .file-field__drop-area .file-field__drop-hint-text {
25755
+ color: var(--_file-field-drop-area-drop-hint-text-color);
25373
25756
  }
25374
25757
 
25375
25758
  @media (hover: none) {
25376
- .file-field__hint {
25759
+ :is(.file-field__drag-text, .file-field__drop-text, .file-field__rejected-text, .file-field__drop-hint-text),
25760
+ .file-field__drop-area .file-field__text {
25377
25761
  display: none;
25378
25762
  }
25379
25763
  }
25380
25764
 
25765
+ .file-field__choose-button-group {
25766
+ display: flex;
25767
+ margin-top: var(--_file-field-area-choose-button-group-margin-top);
25768
+ margin-bottom: var(--_file-field-area-choose-button-group-margin-bottom);
25769
+ flex-wrap: wrap;
25770
+ justify-content: center;
25771
+ gap: var(--_file-field-button-group-gap);
25772
+ }
25773
+
25381
25774
  .file-field__name {
25382
25775
  display: flex;
25383
25776
  min-width: 0;
25384
25777
  overflow: hidden;
25385
25778
  }
25386
25779
 
25387
- .file-field__full-name {
25780
+ .file-field__folder {
25781
+ display: flex;
25782
+ min-width: 0;
25783
+ }
25784
+
25785
+ :is(.file-field__name, .file-field__folder).is-wrapped {
25786
+ display: block;
25787
+ white-space: normal;
25788
+ overflow-wrap: anywhere;
25789
+ text-wrap: balance;
25790
+ }
25791
+
25792
+ .file-field__name.is-wrapped .file-field__name-start {
25793
+ white-space: normal;
25794
+ }
25795
+
25796
+ .file-field__folder-name {
25797
+ min-width: 0;
25798
+ white-space: pre;
25799
+ text-overflow: ellipsis;
25800
+ overflow: hidden;
25801
+ }
25802
+
25803
+ .file-field__folder-rest {
25804
+ flex-shrink: 0;
25805
+ white-space: pre;
25806
+ }
25807
+
25808
+ .file-field__full-name,
25809
+ .file-field__status {
25388
25810
  position: absolute;
25389
25811
  width: 1px;
25390
25812
  height: 1px;
@@ -25405,28 +25827,19 @@ var fileFieldStyles = css`
25405
25827
  white-space: pre;
25406
25828
  }
25407
25829
 
25408
- .file-field__actions {
25830
+ .file-field__edit-button-group {
25409
25831
  display: flex;
25410
25832
  position: relative;
25411
25833
  flex-shrink: 0;
25412
- gap: var(--_file-field-actions-gap);
25834
+ gap: var(--_file-field-button-group-gap);
25413
25835
  padding-right: var(--_file-field-clear-button-padding-right);
25414
25836
  align-items: center;
25415
25837
  }
25416
25838
 
25417
- .file-field__actions:not(:last-child) {
25839
+ .file-field__edit-button-group:not(:last-child) {
25418
25840
  padding-right: var(--primitives-space-0);
25419
25841
  }
25420
25842
 
25421
- .file-field__status {
25422
- position: absolute;
25423
- width: 1px;
25424
- height: 1px;
25425
- clip-path: inset(50%);
25426
- white-space: nowrap;
25427
- overflow: hidden;
25428
- }
25429
-
25430
25843
  .file-field__validation-icon-area {
25431
25844
  display: flex;
25432
25845
  height: 100%;
@@ -25450,14 +25863,26 @@ var fileFieldStyles = css`
25450
25863
  }
25451
25864
 
25452
25865
 
25453
-
25454
25866
  /* # Area */
25455
25867
 
25456
25868
  .file-field--area {
25457
25869
  min-height: var(--_file-field-area-min-height);
25870
+ container: file-field-area / inline-size;
25458
25871
  }
25459
25872
 
25460
- .file-field--area :is(.file-field__browse-button, .file-field__replace-area, .file-field__chosen-file) {
25873
+ @container file-field-area (max-width: 22.4375rem) {
25874
+ :host([directory]:not([size="sm"])) .file-field--area > :is(.file-field__choose-button, .file-field__drop-area, .file-field__chosen-area) {
25875
+ min-height: var(--_file-field-area-stacked-min-height);
25876
+ }
25877
+ }
25878
+
25879
+ @container file-field-area (max-width: 18.6875rem) {
25880
+ :host([directory][size="sm"]) .file-field--area > :is(.file-field__choose-button, .file-field__drop-area, .file-field__chosen-area) {
25881
+ min-height: var(--_file-field-area-stacked-min-height);
25882
+ }
25883
+ }
25884
+
25885
+ .file-field--area :is(.file-field__choose-button, .file-field__drop-area, .file-field__replace-area, .file-field__chosen-file) {
25461
25886
  padding: var(--_file-field-area-padding);
25462
25887
  flex-direction: column;
25463
25888
  gap: var(--_file-field-area-gap);
@@ -25477,14 +25902,15 @@ var fileFieldStyles = css`
25477
25902
  }
25478
25903
 
25479
25904
  .file-field--area.is-drag-over :is(.file-field__upload-icon, .file-field__accepted-types) {
25480
- color: var(--_file-field-browse-action-color);
25905
+ color: var(--_file-field-choose-text-color);
25481
25906
  }
25482
25907
 
25483
- .file-field--area.is-drag-rejected :is(.file-field__upload-icon, .file-field__accepted-types) {
25908
+ .file-field--area.is-drag-rejected :is(.file-field__upload-icon, .file-field__accepted-types),
25909
+ .file-field--area.is-refused .file-field__upload-icon {
25484
25910
  color: var(--_file-field-rejected-color);
25485
25911
  }
25486
25912
 
25487
- .file-field--area :is(.file-field__sentence, .file-field__value) {
25913
+ .file-field--area :is(.file-field__text, .file-field__value) {
25488
25914
  padding-block: 0;
25489
25915
  width: 100%;
25490
25916
  flex-grow: 0;
@@ -25493,11 +25919,11 @@ var fileFieldStyles = css`
25493
25919
 
25494
25920
  /* The surface has a fixed height and centers its content, so only the
25495
25921
  shown text takes room; a hidden one that wraps would push the rest apart. */
25496
- .file-field--area .file-field__text:not(.is-active) {
25922
+ .file-field--area :is(.file-field__text, .file-field__value) > :not(.is-active) {
25497
25923
  display: none;
25498
25924
  }
25499
25925
 
25500
- .file-field--area .file-field__name {
25926
+ .file-field--area :is(.file-field__name, .file-field__folder) {
25501
25927
  justify-content: center;
25502
25928
  }
25503
25929
 
@@ -25506,10 +25932,10 @@ var fileFieldStyles = css`
25506
25932
  font: var(--_file-field-accepted-types-font);
25507
25933
  }
25508
25934
 
25509
- .file-field--area .file-field__actions {
25510
- width: 100%;
25511
- max-width: var(--_file-field-area-actions-max-width);
25512
- padding-top: calc(var(--_file-field-area-actions-padding-top) - var(--_file-field-area-gap));
25935
+ .file-field--area .file-field__edit-button-group {
25936
+ flex-wrap: wrap;
25937
+ justify-content: center;
25938
+ padding-top: var(--_file-field-area-edit-button-group-padding-top);
25513
25939
  padding-right: var(--primitives-space-0);
25514
25940
  }
25515
25941
 
@@ -25564,16 +25990,23 @@ function compose(base, extension, kept) {
25564
25990
  * end, around an ellipsis and before the extension.
25565
25991
  */
25566
25992
  function truncateMiddle(name, width, measure) {
25567
- if (measure(name) <= width) return {
25993
+ return truncateMiddleToFit(name, (text) => measure(text) <= width);
25994
+ }
25995
+ /**
25996
+ * The name as it fits where `fits` says, cut as `truncateMiddle` cuts it. With
25997
+ * `keepExtension` off, as for a folder, a dot in the name is no extension.
25998
+ */
25999
+ function truncateMiddleToFit(name, fits, { keepExtension = true } = {}) {
26000
+ if (fits(name)) return {
25568
26001
  text: name,
25569
26002
  truncated: false
25570
26003
  };
25571
- const [base, extension] = splitName(name);
26004
+ const [base, extension] = keepExtension ? splitName(name) : [name, ""];
25572
26005
  let low = 0;
25573
26006
  let high = base.length - 1;
25574
26007
  while (low < high) {
25575
26008
  const mid = Math.ceil((low + high) / 2);
25576
- if (measure(compose(base, extension, mid)) <= width) low = mid;
26009
+ if (fits(compose(base, extension, mid))) low = mid;
25577
26010
  else high = mid - 1;
25578
26011
  }
25579
26012
  return {
@@ -25581,6 +26014,22 @@ function truncateMiddle(name, width, measure) {
25581
26014
  truncated: true
25582
26015
  };
25583
26016
  }
26017
+ /** Tells whether text fits in `lines` lines of `width`, wrapped the way
26018
+ * `container` wraps it: anywhere, as a file name has few spaces. Call `done`
26019
+ * after. */
26020
+ function lineFitter(container, width, lines) {
26021
+ const probe = document.createElement("span");
26022
+ probe.style.cssText = `position: absolute; visibility: hidden; display: block; width: ${width}px; white-space: normal; overflow-wrap: anywhere;`;
26023
+ container.append(probe);
26024
+ const lineHeight = parseFloat(getComputedStyle(probe).lineHeight);
26025
+ return {
26026
+ fits: (text) => {
26027
+ probe.textContent = text;
26028
+ return probe.getBoundingClientRect().height <= lines * lineHeight + .5;
26029
+ },
26030
+ done: () => probe.remove()
26031
+ };
26032
+ }
25584
26033
  /** Measures text the way `container` renders it, with a hidden span in it.
25585
26034
  * Canvas text metrics drift from the page by a character or two (kerning,
25586
26035
  * font features), which shows as a second, CSS ellipsis. Call `done` after. */
@@ -25618,7 +26067,9 @@ var FORMAT_ICONS = {
25618
26067
  odg: "file-odg",
25619
26068
  odf: "file-odf"
25620
26069
  };
25621
- function fileIcon(files) {
26070
+ function fileIcon(component) {
26071
+ const files = component.files;
26072
+ if (component._folderName()) return "folder";
25622
26073
  if (files.length > 1) return "file-on-file";
25623
26074
  return FORMAT_ICONS[splitName(files[0].name)[1].slice(1).toLowerCase()] ?? "file";
25624
26075
  }
@@ -25639,15 +26090,18 @@ function renderValidationIcon$5(component) {
25639
26090
  * them all the time, so the field keeps its height when the text changes: a
25640
26091
  * sentence that wraps in a narrow or zoomed field does not move the target
25641
26092
  * under a pointer that is dragging a file. The texts that only a drag brings
25642
- * (`kind`) are left out on a device without hover, where nothing is dragged.
26093
+ * are left out on a device without hover, where nothing is dragged.
26094
+ *
26095
+ * A control holds the texts of both states, and of a field for one file and
26096
+ * for more, so every field of a size is as tall at one width, whatever it
26097
+ * shows and however it is set up.
25643
26098
  */
25644
- function renderStack(variants) {
26099
+ function renderStack(element, variants) {
25645
26100
  return html`
25646
- <span class="file-field__texts">${variants.map((variant) => html`
26101
+ <span class="file-field__${element}">${variants.map((variant) => html`
25647
26102
  <span class=${classMap({
25648
- "file-field__text": true,
25649
- "is-active": variant.active,
25650
- [`file-field__text--${variant.kind}`]: !!variant.kind
26103
+ [`file-field__${variant.kind}-text`]: true,
26104
+ "is-active": variant.active
25651
26105
  })}>${variant.content}</span>
25652
26106
  `)}</span>
25653
26107
  `;
@@ -25656,7 +26110,7 @@ function renderStack(variants) {
25656
26110
  function dragVariants(component, dragText, dropText) {
25657
26111
  const rejection = component._dragRejection ?? component._rejection;
25658
26112
  const dragging = !rejection && component._drag !== "none";
25659
- const variants = [
26113
+ return [
25660
26114
  {
25661
26115
  content: dragText,
25662
26116
  kind: "drag",
@@ -25667,136 +26121,313 @@ function dragVariants(component, dragText, dropText) {
25667
26121
  kind: "drop",
25668
26122
  active: dragging && component._drag === "over"
25669
26123
  },
25670
- {
25671
- content: component._rejectionText("type"),
25672
- kind: "rejected",
25673
- active: rejection === "type"
25674
- },
25675
- {
25676
- content: component._rejectionText("folder"),
25677
- kind: "rejected",
25678
- active: rejection === "folder"
25679
- }
26124
+ ...rejectionVariants(component, rejection)
25680
26125
  ];
25681
- if (!component.multiple) variants.push({
25682
- content: component._rejectionText("count"),
26126
+ }
26127
+ /** Every text a control can show, none of them active: they only reserve
26128
+ * their height. Only a field with `directory` offers a folder, so only it
26129
+ * reserves that sentence. An area shows only the active text, and has a
26130
+ * fixed height. */
26131
+ function reservedVariants(component) {
26132
+ if (component.variant === "area") return [];
26133
+ const t = (key) => component._t(`components.file-field.${key}`);
26134
+ const sentence = (choose, hint) => html`<span class="file-field__choose-text">${t(choose)}</span> <span class="file-field__drop-hint-text">${t(hint)}</span>`;
26135
+ return [
26136
+ [sentence("to-choose-file-action", "drop-hint-lowercase-text"), "idle"],
26137
+ [sentence("to-choose-files-action", "drop-hint-multiple-lowercase-text"), "idle"],
26138
+ ...component.directory ? [[sentence("to-choose-files-or-folder-action", "drop-hint-multiple-lowercase-text"), "idle"]] : [],
26139
+ ...[
26140
+ "drag-here-text",
26141
+ "drag-here-multiple-text",
26142
+ "replace-drag-text"
26143
+ ].map((key) => [t(key), "drag"]),
26144
+ ...[
26145
+ "drop-here-text",
26146
+ "drop-here-multiple-text",
26147
+ "replace-drop-text"
26148
+ ].map((key) => [t(key), "drop"]),
26149
+ ...[
26150
+ "type",
26151
+ "count",
26152
+ "folder",
26153
+ "empty-folder",
26154
+ "unreadable-folder"
26155
+ ].map((reason) => [component._rejectionText(reason), "rejected"]),
26156
+ [t("wrong-file-type-error-text"), "rejected"]
26157
+ ].map(([content, kind]) => ({
26158
+ content,
26159
+ kind,
26160
+ active: false
26161
+ }));
26162
+ }
26163
+ /** The reasons a drop can be refused for, as this field takes files: a field
26164
+ * for one refuses a folder or several files, a field for more reads a folder,
26165
+ * which can then be empty or unreadable. */
26166
+ function rejectionVariants(component, rejection) {
26167
+ return (component._multiple ? [
26168
+ "type",
26169
+ "empty-folder",
26170
+ "unreadable-folder"
26171
+ ] : [
26172
+ "type",
26173
+ "folder",
26174
+ "count"
26175
+ ]).map((reason) => ({
26176
+ content: component._rejectionText(reason),
25683
26177
  kind: "rejected",
25684
- active: rejection === "count"
25685
- });
25686
- return variants;
26178
+ active: rejection === reason
26179
+ }));
26180
+ }
26181
+ /**
26182
+ * While a dropped folder is read, the activity indicator with its own label, as
26183
+ * every other loading state, at the size of the icon of a chosen file, a step
26184
+ * smaller in an area, where the label goes under it. The field
26185
+ * shows it empty: what was chosen before gives way to the folder. Only an area
26186
+ * has room to show the label; a screen reader hears it either way. The circle
26187
+ * is only there while it shows: it is a live region, and sets its own visibility.
26188
+ */
26189
+ function renderReadingIndicator(component) {
26190
+ const area = component.variant === "area";
26191
+ const sm = component.size === "sm";
26192
+ return html`<nldd-activity-indicator class="file-field__reading-indicator"
26193
+ timing="instant"
26194
+ size=${area ? sm ? "24" : "32" : sm ? "20" : "24"}
26195
+ ?show-text=${area}
26196
+ ></nldd-activity-indicator>`;
26197
+ }
26198
+ /** "Bestanden kiezen…" and "Map kiezen…", for a menu of a field with
26199
+ * `directory`: one dialog picks files or a folder, never both. */
26200
+ function renderChoiceItems(component) {
26201
+ return html`
26202
+ <nldd-menu-item
26203
+ icon="files"
26204
+ text=${component._t("components.file-field.to-choose-files-menu-action")}
26205
+ @select=${component._chooseFiles}
26206
+ ></nldd-menu-item>
26207
+ <nldd-menu-item
26208
+ icon="folder"
26209
+ text=${component._t("components.file-field.to-choose-folder-menu-action")}
26210
+ @select=${component._chooseFolder}
26211
+ ></nldd-menu-item>
26212
+ `;
26213
+ }
26214
+ /** "Wijzigen", which with `directory` opens the choice of files or a folder. */
26215
+ function renderChangeButton(component, size) {
26216
+ return html`
26217
+ <nldd-button class="file-field__change-button"
26218
+ appearance="neutral-tinted"
26219
+ size=${size}
26220
+ text=${component._t("components.file-field.to-change-action")}
26221
+ popup-type=${component.directory ? "menu" : nothing}
26222
+ ?expandable=${component.directory}
26223
+ ?expanded=${component._menuOpen}
26224
+ accessible-label=${component._changeAccessibleLabel() || nothing}
26225
+ ?disabled=${component.disabled}
26226
+ @click=${(e) => component._handleChoose(e)}
26227
+ ></nldd-button>
26228
+ `;
26229
+ }
26230
+ /** A button for files and one for a folder, for an area with `directory`:
26231
+ * room enough to offer both without a menu. */
26232
+ function renderChooseButtonGroup(component) {
26233
+ const label = (text) => [text, component.accessibleLabel].filter(Boolean).join(", ");
26234
+ const files = component._t("components.file-field.to-choose-files-action");
26235
+ const folder = component._t("components.file-field.to-choose-folder-action");
26236
+ return html`
26237
+ <div class="file-field__choose-button-group">
26238
+ <nldd-button
26239
+ appearance="neutral-tinted"
26240
+ size=${component.size}
26241
+ start-icon="files"
26242
+ text=${files}
26243
+ accessible-label=${label(files)}
26244
+ ?disabled=${component.disabled}
26245
+ @click=${component._chooseFiles}
26246
+ ></nldd-button>
26247
+ <nldd-button
26248
+ appearance="neutral-tinted"
26249
+ size=${component.size}
26250
+ start-icon="folder"
26251
+ text=${folder}
26252
+ accessible-label=${label(folder)}
26253
+ ?disabled=${component.disabled}
26254
+ @click=${component._chooseFolder}
26255
+ ></nldd-button>
26256
+ </div>
26257
+ `;
25687
26258
  }
25688
26259
  /** The empty field is one button over the whole surface, read as one sentence:
25689
26260
  * "Bestand kiezen of sleep het hierheen". The validation icon sits inside it,
25690
- * so a press on the icon opens the dialog too. */
25691
- function renderBrowse(component) {
25692
- const drags = dragVariants(component, component.multiple ? component._t("components.file-field.drag-here-multiple-text") : component._t("components.file-field.drag-here-text"), component.multiple ? component._t("components.file-field.drop-here-multiple-text") : component._t("components.file-field.drop-here-text"));
25693
- const sentence = html`<span class="file-field__browse-action">${component._chooseLabel()}</span> <span class="file-field__hint">${component.multiple ? component._t("components.file-field.drop-hint-multiple-lowercase-text") : component._t("components.file-field.drop-hint-lowercase-text")}</span>`;
26261
+ * so a press on the icon opens the dialog too. An area with `directory` has a
26262
+ * button for each choice instead, with the drop hint under them, and the
26263
+ * surface around them is only a place to drop. */
26264
+ function renderEmpty(component) {
26265
+ const drags = dragVariants(component, component._multiple ? component._t("components.file-field.drag-here-multiple-text") : component._t("components.file-field.drag-here-text"), component._multiple ? component._t("components.file-field.drop-here-multiple-text") : component._t("components.file-field.drop-here-text"));
25694
26266
  const area = component.variant === "area";
25695
- const types = area ? component._acceptTypes() : null;
26267
+ const buttonGroup = area && component.directory;
26268
+ const hint = html`<span class="file-field__drop-hint-text">${component._multiple ? component._t("components.file-field.drop-hint-multiple-lowercase-text") : component._t("components.file-field.drop-hint-lowercase-text")}</span>`;
26269
+ const sentence = buttonGroup ? hint : html`<span class="file-field__choose-text">${component._chooseLabel()}</span> ${hint}`;
26270
+ const refused = area && component._refused;
26271
+ const types = area && !refused ? component._acceptTypes() : null;
26272
+ const dragged = drags.some((variant) => variant.active);
26273
+ const reading = component._reading && !dragged;
26274
+ const stack = renderStack("text", [
26275
+ {
26276
+ content: sentence,
26277
+ kind: "idle",
26278
+ active: !reading && !dragged
26279
+ },
26280
+ ...drags,
26281
+ ...area ? [] : [{
26282
+ content: reading ? renderReadingIndicator(component) : "",
26283
+ kind: "reading",
26284
+ active: reading
26285
+ }],
26286
+ ...reservedVariants(component)
26287
+ ]);
26288
+ const icon = area ? html`<nldd-icon class="file-field__upload-icon" icon="upload-to-cloud" aria-hidden="true"></nldd-icon>` : nothing;
26289
+ const buttons = buttonGroup && !refused ? renderChooseButtonGroup(component) : nothing;
26290
+ const accepted = types ? html`<span class="file-field__accepted-types">${component._t("components.file-field.accepted-types-text", { types })}</span>` : nothing;
26291
+ const content = area && reading ? html`${renderReadingIndicator(component)}${renderValidationIcon$5(component)}` : html`${icon}${buttons}${stack}${accepted}${renderValidationIcon$5(component)}`;
26292
+ if (buttonGroup) return html`<div class="file-field__drop-area" ?inert=${component._refused}>${content}</div>`;
25696
26293
  return html`
25697
- <button class="file-field__browse-button"
26294
+ <button class="file-field__choose-button"
25698
26295
  type="button"
25699
- aria-label=${component._chooseAccessibleLabel() || component._chooseLabel()}
26296
+ ?inert=${component._refused}
26297
+ aria-label=${component._chooseAccessibleLabel()}
26298
+ aria-haspopup=${component.directory ? "menu" : nothing}
26299
+ aria-expanded=${component.directory ? String(component._menuOpen) : nothing}
25700
26300
  ?disabled=${component.disabled}
25701
- @click=${component._handleChoose}
25702
- >${area ? html`<nldd-icon class="file-field__upload-icon" icon="upload-to-cloud" aria-hidden="true"></nldd-icon>` : nothing}<span class="file-field__sentence">${renderStack([{
25703
- content: sentence,
25704
- active: !drags.some((variant) => variant.active)
25705
- }, ...drags])}</span>${types ? html`<span class="file-field__accepted-types">${component._t("components.file-field.accepted-types-text", { types })}</span>` : nothing}${renderValidationIcon$5(component)}</button>
26301
+ @click=${(e) => component._handleChoose(e)}
26302
+ >${content}</button>
25706
26303
  `;
25707
26304
  }
25708
- /** A name as it fits: cut in the middle once measured, before that cut by CSS
25709
- * with its end in view. A screen reader reads the whole name either way, and a
25710
- * name that is cut short shows whole in a tooltip. */
26305
+ /** A name as it fits: cut in the middle once measured, on one line or on the
26306
+ * lines the field has, before that cut by CSS with its end in view. A screen
26307
+ * reader reads the whole name either way, and a name that is cut short shows
26308
+ * whole in a tooltip. */
25711
26309
  function renderName(component, name) {
25712
26310
  const [start, end] = splitForTruncation(name);
25713
26311
  const shown = component._fittedName === null ? html`<span class="file-field__name-start">${start}</span>${end ? html`<span class="file-field__name-end">${end}</span>` : nothing}` : html`<span class="file-field__name-start">${component._fittedName}</span>`;
25714
26312
  return html`
25715
26313
  <nldd-tooltip text=${name} timing=${component._nameTruncated ? "delay" : "never"}>
25716
- <span class="file-field__name" aria-hidden="true">${shown}</span>
26314
+ <span class=${classMap({
26315
+ "file-field__name": true,
26316
+ "is-wrapped": component._nameLines > 1
26317
+ })} aria-hidden="true">${shown}</span>
25717
26318
  </nldd-tooltip>
25718
26319
  <span class="file-field__full-name">${name}</span>
25719
26320
  `;
25720
26321
  }
26322
+ /** A folder with the number of files in it. The name of the folder gives way
26323
+ * first, so the number stays in view: on one line by CSS, on more cut in the
26324
+ * middle once measured. A narrow field drops the word: "site (3)". A screen
26325
+ * reader reads the whole label either way. */
26326
+ function renderFolderLabel(component, folder) {
26327
+ const label = component._valueLabel();
26328
+ const short = component._t("components.file-field.folder-count-short-text", {
26329
+ folder,
26330
+ count: component.files.length
26331
+ });
26332
+ const wrapped = component._nameLines > 1;
26333
+ const variant = (text, length) => {
26334
+ const at = text.indexOf(folder);
26335
+ if (wrapped) {
26336
+ const fitted = at < 0 ? text : text.slice(0, at) + (component._fittedFolder ?? folder) + text.slice(at + folder.length);
26337
+ return html`<span class="file-field__folder file-field__folder--${length} is-wrapped" aria-hidden="true">${fitted}</span>`;
26338
+ }
26339
+ const [before, name, after] = at < 0 ? [
26340
+ "",
26341
+ text,
26342
+ ""
26343
+ ] : [
26344
+ text.slice(0, at),
26345
+ folder,
26346
+ text.slice(at + folder.length)
26347
+ ];
26348
+ return html`<span class="file-field__folder file-field__folder--${length}" aria-hidden="true">${before ? html`<span class="file-field__folder-rest">${before}</span>` : nothing}<span class="file-field__folder-name">${name}</span>${after ? html`<span class="file-field__folder-rest">${after}</span>` : nothing}</span>`;
26349
+ };
26350
+ return html`${variant(label, "full")}${variant(short, "short")}<span class="file-field__full-name">${label}</span>`;
26351
+ }
26352
+ /** The buttons of a narrow control in one menu, so the name keeps room. With
26353
+ * `directory` it offers files and a folder itself, not a menu in a menu. */
26354
+ function renderMoreButton(component, size) {
26355
+ return html`
26356
+ <nldd-icon-button class="file-field__more-button"
26357
+ appearance="neutral-tinted"
26358
+ size=${size}
26359
+ icon="more"
26360
+ text=${component._t("components.file-field.show-options-action")}
26361
+ tooltip-timing="never"
26362
+ accessible-label=${component._moreAccessibleLabel()}
26363
+ ?disabled=${component.disabled}
26364
+ >
26365
+ <nldd-menu slot="popup">
26366
+ ${component.directory ? renderChoiceItems(component) : html`
26367
+ <nldd-menu-item
26368
+ icon="edit"
26369
+ text=${component._t("components.file-field.to-change-action")}
26370
+ @select=${component._chooseFiles}
26371
+ ></nldd-menu-item>
26372
+ `}
26373
+ <nldd-menu-divider></nldd-menu-divider>
26374
+ <nldd-menu-item
26375
+ icon="dismiss"
26376
+ text=${component._t("components.file-field.clear-action")}
26377
+ destructive
26378
+ @select=${component._handleClear}
26379
+ ></nldd-menu-item>
26380
+ </nldd-menu>
26381
+ </nldd-icon-button>
26382
+ `;
26383
+ }
25721
26384
  /**
25722
26385
  * A field with a file: the row with its name and buttons, and over it, in the
25723
26386
  * same place, the sentences of a drag, saying a drop replaces what is there.
25724
26387
  * While files are dragged the row gives way to them; nothing can be pressed
25725
- * then. A drop that was refused says why in place of the name, with the
25726
- * buttons still there.
26388
+ * then. A drop that was refused says why in the same place, across the whole
26389
+ * row, so the name has only itself to make room for. A narrow control puts both
26390
+ * buttons in a menu first, then gives up the icon of the file.
25727
26391
  */
25728
26392
  function renderChosen(component) {
25729
26393
  const files = component.files;
25730
26394
  const area = component.variant === "area";
25731
26395
  const buttonSize = component.size === "sm" ? "xs" : "sm";
25732
- const dragging = component._drag !== "none";
25733
- const refused = component._rejection;
26396
+ const replaced = component._drag !== "none" || component._rejection !== null;
25734
26397
  const drags = dragVariants(component, component._t("components.file-field.replace-drag-text"), component._t("components.file-field.replace-drop-text")).map((variant) => ({
25735
26398
  ...variant,
25736
- active: variant.active && dragging
26399
+ active: variant.active && replaced
25737
26400
  }));
25738
- const nameVariants = [
25739
- {
25740
- content: files.length === 1 ? renderName(component, files[0].name) : component._valueLabel(),
25741
- active: !refused
25742
- },
25743
- {
25744
- content: component._rejectionText("type"),
25745
- kind: "rejected",
25746
- active: refused === "type"
25747
- },
25748
- {
25749
- content: component._rejectionText("folder"),
25750
- kind: "rejected",
25751
- active: refused === "folder"
25752
- }
25753
- ];
25754
- if (!component.multiple) nameVariants.push({
25755
- content: component._rejectionText("count"),
25756
- kind: "rejected",
25757
- active: refused === "count"
25758
- });
26401
+ const folder = component._folderName();
26402
+ const name = folder ? renderFolderLabel(component, folder) : files.length === 1 ? renderName(component, files[0].name) : component._valueLabel();
25759
26403
  return html`
25760
- <div class="file-field__chosen-area">
26404
+ <div class="file-field__chosen-area" ?inert=${component._refused}>
25761
26405
  <div class=${classMap({
25762
26406
  "file-field__chosen-file": true,
25763
- "is-active": !dragging
26407
+ "is-active": !replaced
25764
26408
  })}>
25765
- <nldd-icon class="file-field__file-icon" icon=${fileIcon(files)} aria-hidden="true"></nldd-icon>
25766
- <span class="file-field__value">${renderStack(nameVariants)}</span>
26409
+ <nldd-icon class="file-field__file-icon" icon=${fileIcon(component)} aria-hidden="true"></nldd-icon>
26410
+ ${renderStack("value", [{
26411
+ content: name,
26412
+ kind: "idle",
26413
+ active: true
26414
+ }])}
25767
26415
  ${area ? html`
25768
- <div class="file-field__actions">
25769
- <nldd-button-group
25770
- size=${component.size}
25771
- width="full"
25772
- >
25773
- <nldd-button
25774
- appearance="neutral-tinted"
25775
- text=${component._t("components.file-field.to-change-action")}
25776
- accessible-label=${component._changeAccessibleLabel() || nothing}
25777
- ?disabled=${component.disabled}
25778
- @click=${component._handleChoose}
25779
- ></nldd-button>
25780
- <nldd-button
25781
- appearance="neutral-base"
25782
- text=${component._t("components.file-field.clear-action")}
25783
- accessible-label=${component._clearAccessibleLabel()}
25784
- ?disabled=${component.disabled}
25785
- @click=${component._handleClear}
25786
- ></nldd-button>
25787
- </nldd-button-group>
25788
- </div>
25789
- ` : html`
25790
- <div class="file-field__actions">
26416
+ <div class="file-field__edit-button-group">
26417
+ ${renderChangeButton(component, component.size)}
25791
26418
  <nldd-button
25792
- appearance="neutral-tinted"
25793
- size=${buttonSize}
25794
- text=${component._t("components.file-field.to-change-action")}
25795
- accessible-label=${component._changeAccessibleLabel() || nothing}
26419
+ appearance="neutral-base"
26420
+ size=${component.size}
26421
+ text=${component._t("components.file-field.clear-action")}
26422
+ accessible-label=${component._clearAccessibleLabel()}
25796
26423
  ?disabled=${component.disabled}
25797
- @click=${component._handleChoose}
26424
+ @click=${component._handleClear}
25798
26425
  ></nldd-button>
25799
- <nldd-icon-button
26426
+ </div>
26427
+ ` : html`
26428
+ <div class="file-field__edit-button-group">
26429
+ ${renderChangeButton(component, buttonSize)}
26430
+ <nldd-icon-button class="file-field__clear-button"
25800
26431
  appearance="neutral-transparent"
25801
26432
  size=${buttonSize}
25802
26433
  icon="dismiss"
@@ -25805,41 +26436,63 @@ function renderChosen(component) {
25805
26436
  ?disabled=${component.disabled}
25806
26437
  @click=${component._handleClear}
25807
26438
  ></nldd-icon-button>
26439
+ ${renderMoreButton(component, buttonSize)}
25808
26440
  </div>
25809
26441
  `}
25810
26442
  ${renderValidationIcon$5(component)}
25811
26443
  </div>
25812
26444
  <div class=${classMap({
25813
26445
  "file-field__replace-area": true,
25814
- "is-active": dragging
26446
+ "is-active": replaced
25815
26447
  })}>
25816
26448
  ${area ? html`<nldd-icon class="file-field__upload-icon" icon="upload-to-cloud" aria-hidden="true"></nldd-icon>` : nothing}
25817
- <span class="file-field__sentence">${renderStack(drags)}</span>
26449
+ ${renderStack("text", [...drags, ...reservedVariants(component)])}
25818
26450
  ${renderValidationIcon$5(component)}
25819
26451
  </div>
25820
26452
  </div>
25821
26453
  `;
25822
26454
  }
25823
26455
  function fileFieldTemplate(component) {
25824
- const hasFiles = component.files.length > 0;
26456
+ const hasFiles = component.files.length > 0 && !component._reading;
25825
26457
  return html`
25826
- <div class=${classMap({
26458
+ <div aria-busy=${component._reading ? "true" : nothing} class=${classMap({
25827
26459
  "file-field": true,
25828
26460
  "file-field--area": component.variant === "area",
25829
26461
  "has-files": hasFiles,
26462
+ "is-refused": component._refused,
25830
26463
  [`is-drag-${component._drag}`]: component._drag !== "none"
25831
26464
  })}>
25832
26465
  <input class="file-field__input"
25833
26466
  type="file"
25834
26467
  id=${component.inputId || nothing}
25835
26468
  accept=${component.accept || nothing}
25836
- ?multiple=${component.multiple}
26469
+ ?multiple=${component._multiple}
25837
26470
  ?disabled=${component.disabled}
25838
26471
  ?required=${component.required}
25839
26472
  aria-label=${component.accessibleLabel || nothing}
25840
26473
  @change=${component._handleInputChange}
25841
26474
  >
25842
- ${hasFiles ? renderChosen(component) : renderBrowse(component)}
26475
+ ${component.directory ? html`
26476
+ <input class="file-field__folder-input"
26477
+ type="file"
26478
+ webkitdirectory
26479
+ multiple
26480
+ ?disabled=${component.disabled}
26481
+ @change=${component._handleInputChange}
26482
+ >
26483
+ <span class="file-field__menu-anchor"></span>
26484
+ <nldd-menu class="file-field__choose-menu"
26485
+ @beforetoggle=${(e) => component._handleMenuToggle(e)}
26486
+ >${renderChoiceItems(component)}</nldd-menu>
26487
+ ` : nothing}
26488
+ ${hasFiles ? renderChosen(component) : renderEmpty(component)}
26489
+ ${component._refused ? html`
26490
+ <button class="file-field__dismiss-button"
26491
+ type="button"
26492
+ aria-label=${component._dismissAccessibleLabel()}
26493
+ @click=${() => component._handleDismiss()}
26494
+ ></button>
26495
+ ` : nothing}
25843
26496
  <span class="file-field__status" role="status">${component._rejection ? component._rejectionText(component._rejection) : component._announcement}</span>
25844
26497
  </div>
25845
26498
  `;
@@ -25939,6 +26592,36 @@ function typeRuledOut(accept, type) {
25939
26592
  function holdsFolder(transfer) {
25940
26593
  return Array.from(transfer.items).some((item) => item.kind === "file" && item.webkitGetAsEntry?.()?.isDirectory);
25941
26594
  }
26595
+ /**
26596
+ * Every file in a drop, folders read down to the files in them, with paths.
26597
+ *
26598
+ * The entries have to be taken while the drop event runs: once its handler
26599
+ * returns, the DataTransfer is emptied. Reading a folder is asynchronous, and a
26600
+ * reader hands out its entries in batches (100 in Chrome), so it is read until
26601
+ * a batch comes back empty. An empty folder yields nothing.
26602
+ */
26603
+ function readDrop(transfer) {
26604
+ const entries = Array.from(transfer.items).filter((item) => item.kind === "file").map((item) => item.webkitGetAsEntry?.()).filter((entry) => !!entry);
26605
+ return Promise.all(entries.map(readEntry)).then((lists) => lists.flat());
26606
+ }
26607
+ function readEntry(entry) {
26608
+ const path = entry.fullPath.replace(/^\//, "");
26609
+ if (entry.isFile) return new Promise((resolve, reject) => {
26610
+ entry.file((file) => resolve([{
26611
+ file,
26612
+ path
26613
+ }]), reject);
26614
+ });
26615
+ const reader = entry.createReader();
26616
+ const batch = () => new Promise((resolve, reject) => reader.readEntries(resolve, reject));
26617
+ const all = [];
26618
+ const readAll = () => batch().then((entries) => {
26619
+ if (entries.length === 0) return all;
26620
+ all.push(...entries);
26621
+ return readAll();
26622
+ });
26623
+ return readAll().then((children) => Promise.all(children.map(readEntry))).then((lists) => lists.flat());
26624
+ }
25942
26625
  /** Whether a drag carries files, as opposed to text or a link. */
25943
26626
  function carriesFiles(transfer) {
25944
26627
  return !!transfer && Array.from(transfer.types).includes("Files");
@@ -25990,6 +26673,32 @@ function unwatchDrags(target) {
25990
26673
  window.removeEventListener("dragend", end);
25991
26674
  clearTimeout(endTimer);
25992
26675
  }
26676
+ // src/utilities/file-drag-and-drop.ts
26677
+ var NO_FILE_DRAG_QUERY = "(hover: none)";
26678
+ /** Whether files can be dragged onto the page on this device, so a hint for it is worth showing. */
26679
+ function fileDragAndDropAvailable() {
26680
+ return typeof matchMedia !== "function" || !matchMedia(NO_FILE_DRAG_QUERY).matches;
26681
+ }
26682
+ /**
26683
+ * Renders the host again when dragging files becomes available or unavailable,
26684
+ * such as when a trackpad is attached to a tablet, so a drop hint in its
26685
+ * accessible name follows the visible one. Pass `onChange` for work that a
26686
+ * render does not redo.
26687
+ */
26688
+ var FileDragAndDropAvailabilityController = class {
26689
+ constructor(host, onChange) {
26690
+ this._query = typeof matchMedia === "function" ? matchMedia(NO_FILE_DRAG_QUERY) : null;
26691
+ this._handleChange = () => this._onChange();
26692
+ this._onChange = onChange ?? (() => host.requestUpdate());
26693
+ host.addController(this);
26694
+ }
26695
+ hostConnected() {
26696
+ this._query?.addEventListener("change", this._handleChange);
26697
+ }
26698
+ hostDisconnected() {
26699
+ this._query?.removeEventListener("change", this._handleChange);
26700
+ }
26701
+ };
25993
26702
  // src/components/inputs/file-field/file-field.ts
25994
26703
  /**
25995
26704
  * Nederlandse Digitale Dienst File Field Component (Lit + TypeScript)
@@ -26010,12 +26719,38 @@ function unwatchDrags(target) {
26010
26719
  * a pick. `accept` and `multiple` hold for a drop too, which the native input
26011
26720
  * does not do: a drop that does not fit is refused as a whole, the previous
26012
26721
  * choice stays, and the field says why for a few seconds: "Sleep één
26013
- * bestand", or what `accept` takes, named from it ("Het bestand moet een PDF
26014
- * zijn"; "Dit bestandstype past niet" where a type in it has no name). A
26015
- * dropped folder is refused as well ("Sleep een bestand, geen map"): it
26016
- * arrives as a file without a type that cannot be read, and only the drop
26017
- * tells it apart, not the drag. The message stays for a few seconds and then
26018
- * gives way to the field again.
26722
+ * bestand", or what `accept` takes, named from it ("Alleen PDF";
26723
+ * "Bestandstype past niet" where a type in it has no name). The
26724
+ * message stays for a few seconds and then gives way to the field again.
26725
+ * While it shows, the message is a button of its own over the whole field,
26726
+ * "Alleen PDF, sluit melding, Bijlage" to a screen reader: a press on it, or
26727
+ * Enter, Space or Escape, dismisses it and puts focus on the button of the
26728
+ * field again. A field that had focus when the message came gives it to the
26729
+ * message, so focus does not fall back to the page.
26730
+ *
26731
+ * With `multiple`, a dropped folder is read down to the files in it, its
26732
+ * subfolders included, and mixed with loose files in one drop if need be. The
26733
+ * field then names the folder ("site (124 bestanden)", also "site (1 bestand)"
26734
+ * for one), `paths` says where each
26735
+ * file sat ("site/css/main.css"), and a form submits each file with its path as
26736
+ * its name, as a native folder input does, so two files with one name in
26737
+ * different folders stay apart. `accept` holds for every file in it. Without
26738
+ * `multiple` a folder is refused ("Sleep bestand, geen map"): one file
26739
+ * cannot be a folder. Only a drop tells a folder apart, not the drag. A folder
26740
+ * that takes longer than a second to read shows the field empty with an
26741
+ * `nldd-activity-indicator` ("Laden" in an area, the circle alone otherwise),
26742
+ * as what was chosen gives way to it. An empty or unreadable folder is refused
26743
+ * as any other drop, and the previous choice comes back after the message.
26744
+ *
26745
+ * `directory` offers a folder in the file dialog too. A dialog picks files or a
26746
+ * folder, never both, so with it the field says "Bestanden of map kiezen" and
26747
+ * a click opens a menu with both where it lands, as a context menu does; the
26748
+ * keyboard opens it under the button. An area has room for both, so there it
26749
+ * shows "Bestanden kiezen" and "Map kiezen" as two buttons with the drop hint
26750
+ * under them, and the surface around them only takes a drop.
26751
+ * "Wijzigen" opens the menu under itself. A folder is many files, so `directory`
26752
+ * takes several without `multiple`. Safari on iOS picks a folder as well; a
26753
+ * browser that cannot opens a dialog for files instead.
26019
26754
  *
26020
26755
  * While files are dragged over the page, every field marks itself as a place
26021
26756
  * to put them, and the field under the pointer says it will take them (a field
@@ -26025,6 +26760,16 @@ function unwatchDrags(target) {
26025
26760
  * editable field takes is left alone. On a device without hover there is no
26026
26761
  * dragging, so the field there drops the hint.
26027
26762
  *
26763
+ * A control reserves the height of every text it can show, so fields of a
26764
+ * size are as tall at one width, empty or with a file. Only a field with
26765
+ * `directory` reserves the sentence that offers a folder, the longest of them. The name takes the lines
26766
+ * that leaves it, and is cut in the middle only once those are full. A narrow
26767
+ * field makes more room: below 320px "Wijzigen" and "Wis selectie" go in one
26768
+ * menu behind "Toon opties" and a folder is counted as "site (3)", below 240px
26769
+ * it leaves out the icon of the format. A refused drop says why in place of
26770
+ * the name and the buttons, and an area shows its upload icon in red with it,
26771
+ * as it did while the drop was refused.
26772
+ *
26028
26773
  * The surface deliberately does not look like an input field. A border with
26029
26774
  * field semantics promises you can type into it; here you can only press it or
26030
26775
  * drop a file on it, so it has the border of a tinted surface instead of
@@ -26042,15 +26787,20 @@ function unwatchDrags(target) {
26042
26787
  * `variant="area"` lays the same field out as a tall surface, for a page where
26043
26788
  * handing in files is the main task. Empty, it shows an upload icon, the
26044
26789
  * sentence and the types it takes ("Toegestaan: PDF of JPG"), named from
26045
- * `accept`; with a file, the icon of its format, its name and the buttons
26790
+ * `accept`; with a file, the icon of its format (a folder for a folder, a
26791
+ * stack for several files), its name and the buttons
26046
26792
  * "Wijzigen" and "Wis selectie" stacked in the middle. Both states have the same
26047
- * height, so the page does not move when a file is chosen.
26793
+ * height, so the page does not move when a file is chosen: 160px, 120px at
26794
+ * `size="sm"`, and a step more with `directory`, whose buttons take a row of
26795
+ * their own. Where those buttons no longer fit side by side, below 360px or
26796
+ * 300px at `size="sm"`, it is one step taller again.
26048
26797
  *
26049
26798
  * @element nldd-file-field
26050
26799
  * @attr {string} variant - 'control' (default): a row the height of a field. 'area': a tall surface with the upload icon and the accepted types when empty, and the file icon, name and buttons stacked once chosen; both states keep the same height
26051
26800
  * @attr {string} size - Field size: 'md' (default) | 'sm'. Set automatically by nldd-form-field.
26052
26801
  * @attr {string} accept - Comma-separated list of accepted file types, forwarded to the input (e.g. ".pdf,image/*")
26053
- * @attr {boolean} multiple - Allows choosing more than one file
26802
+ * @attr {boolean} multiple - Allows choosing more than one file, and dropping a folder
26803
+ * @attr {boolean} directory - Offers a folder beside files, since one dialog picks either: choosing and changing open a menu with both, and an area shows a button for each. Takes several files, as `multiple` does
26054
26804
  * @attr {string} accessible-label - Accessible label forwarded to the inner input. Set automatically by nldd-form-field.
26055
26805
  * @attr {string} input-id - Sets the id on the native input. Set automatically by nldd-form-field.
26056
26806
  * @attr {boolean} valid - Marks the field as valid; shows a check icon on the right, like nldd-dropdown
@@ -26061,12 +26811,18 @@ function unwatchDrags(target) {
26061
26811
  * @attr {object} translations - Override translation keys; unset keys fall back to Dutch
26062
26812
  *
26063
26813
  * @prop {File[]} files - The chosen files. Read-only: browsers forbid setting a file input's value, so there is no `value` attribute and no way to preselect a file.
26814
+ * @prop {string[]} paths - Where each of `files` sat, in the same order: its name, or for a file from a dropped folder the path from that folder down. Read-only.
26064
26815
  *
26065
- * @fires change - When the chosen files change, including a clear; detail: { files: File[] }
26816
+ * @fires change - When the chosen files change, including a clear; detail: { files: File[], paths: string[] }
26066
26817
  */
26067
26818
  var _NLDDFileField;
26068
26819
  /** How long the message of a refused drop stays in the field. */
26069
26820
  var REJECTION_MS = 4e3;
26821
+ /** How long a folder is read before the field shows it is busy. Most folders
26822
+ * are read sooner, and the field then does not flash. */
26823
+ var READING_INDICATOR_DELAY_MS = 1e3;
26824
+ /** A click this soon after the choose menu closed is the one that closed it. */
26825
+ var REOPEN_GUARD_MS = 300;
26070
26826
  /** The word for a family of types in `accept`, such as `image/*`. */
26071
26827
  var FAMILY_KEYS = {
26072
26828
  image: "components.file-field.image-lowercase",
@@ -26080,6 +26836,7 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26080
26836
  this.size = "md";
26081
26837
  this.accept = "";
26082
26838
  this.multiple = false;
26839
+ this.directory = false;
26083
26840
  this.accessibleLabel = "";
26084
26841
  this.inputId = "";
26085
26842
  this.valid = false;
@@ -26089,12 +26846,20 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26089
26846
  this.required = false;
26090
26847
  this.translations = {};
26091
26848
  this._files = [];
26849
+ this._paths = [];
26092
26850
  this._drag = "none";
26093
26851
  this._dragRejection = null;
26094
26852
  this._fittedName = null;
26095
26853
  this._nameTruncated = false;
26854
+ this._fittedFolder = null;
26855
+ this._nameLines = 1;
26096
26856
  this._announcement = "";
26857
+ this._reading = false;
26097
26858
  this._rejection = null;
26859
+ this._menuOpen = false;
26860
+ this._menuClosedAt = -Infinity;
26861
+ this._fileDrag = new FileDragAndDropAvailabilityController(this);
26862
+ this._action = 0;
26098
26863
  this._handleDragOver = (e) => {
26099
26864
  if (this.disabled || !e.dataTransfer || !carriesFiles(e.dataTransfer)) return;
26100
26865
  if (this._judge(e.dataTransfer)) return;
@@ -26105,53 +26870,96 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26105
26870
  if (!e.dataTransfer || !carriesFiles(e.dataTransfer)) return;
26106
26871
  e.preventDefault();
26107
26872
  if (this.disabled) return;
26873
+ const action = ++this._action;
26874
+ this._stopReading();
26108
26875
  const files = Array.from(e.dataTransfer.files);
26109
26876
  const rejection = this._judge(e.dataTransfer, files);
26110
26877
  if (rejection) {
26111
- this._rejection = rejection;
26112
- clearTimeout(this._rejectionTimer);
26113
- this._rejectionTimer = setTimeout(() => {
26114
- this._announcement = this._rejectionText(rejection);
26115
- this._rejection = null;
26116
- }, REJECTION_MS);
26878
+ this._refuse(rejection);
26117
26879
  return;
26118
26880
  }
26119
- if (this._input) this._input.files = e.dataTransfer.files;
26120
- this._files = files;
26121
- this._rejection = null;
26122
- this._announcement = this._t("components.file-field.file-chosen-text", { name: this._valueLabel() });
26123
- this._commit();
26881
+ if (holdsFolder(e.dataTransfer)) {
26882
+ this._readingTimer = setTimeout(() => {
26883
+ this._reading = true;
26884
+ }, READING_INDICATOR_DELAY_MS);
26885
+ readDrop(e.dataTransfer).then((dropped) => {
26886
+ if (action !== this._action) return;
26887
+ this._stopReading();
26888
+ if (dropped.length) this._takeDrop(dropped);
26889
+ else this._refuse("empty-folder");
26890
+ }, () => {
26891
+ if (action !== this._action) return;
26892
+ this._stopReading();
26893
+ this._refuse("unreadable-folder");
26894
+ });
26895
+ return;
26896
+ }
26897
+ this._takeDrop(files.map((file) => ({
26898
+ file,
26899
+ path: file.name
26900
+ })));
26124
26901
  };
26125
26902
  this._clearRejection = () => {
26903
+ const hadFocus = this.shadowRoot?.activeElement?.classList.contains("file-field__dismiss-button") ?? false;
26126
26904
  clearTimeout(this._rejectionTimer);
26127
26905
  this._rejection = null;
26128
26906
  this._announcement = "";
26907
+ if (hadFocus) this.updateComplete.then(() => this.focus());
26129
26908
  };
26130
26909
  this._handleKeydown = (e) => {
26131
26910
  if (e.key === "Escape") this._clearRejection();
26132
26911
  };
26133
26912
  }
26913
+ /** @internal A folder is many files, so `directory` takes several too. */
26914
+ get _multiple() {
26915
+ return this.multiple || this.directory;
26916
+ }
26134
26917
  get files() {
26135
26918
  return this._files;
26136
26919
  }
26920
+ /** Where each file sat: its name, or for a file from a dropped folder the
26921
+ * path from that folder down ("site/css/main.css"). Same order as `files`. */
26922
+ get paths() {
26923
+ return this._paths;
26924
+ }
26925
+ /** @internal Whether the field says why a drop was refused, which a new drag
26926
+ * takes the place of. */
26927
+ get _refused() {
26928
+ return this._rejection !== null && this._drag === "none";
26929
+ }
26137
26930
  /** @internal */
26138
26931
  _t(key, vars) {
26139
26932
  return translate(this.translations, nlddFileFieldTranslations, key, vars);
26140
26933
  }
26141
26934
  /** @internal */
26142
26935
  _chooseLabel() {
26143
- return this.multiple ? this._t("components.file-field.to-choose-files-action") : this._t("components.file-field.to-choose-file-action");
26936
+ if (this.directory) return this._t("components.file-field.to-choose-files-or-folder-action");
26937
+ return this._multiple ? this._t("components.file-field.to-choose-files-action") : this._t("components.file-field.to-choose-file-action");
26144
26938
  }
26145
26939
  /**
26146
26940
  * The native input carries the field's label but is hidden, so it is not in
26147
26941
  * the accessibility tree. The button is what you tab to, and on its own it
26148
- * only says "choose a file" — for which field is the part that matters.
26942
+ * does not say for which field, so the label comes in its name.
26943
+ *
26944
+ * After everything the button shows, and not in place of part of it: a voice
26945
+ * command or an audit compares the name with the visible text, and "Bestand
26946
+ * kiezen, Bijlage" under "Bestand kiezen of sleep het hierheen" is a mismatch
26947
+ * (WCAG 2.5.3). The change button does the same.
26948
+ *
26949
+ * The drop hint only where it shows: a device without hover cannot drag, so
26950
+ * there the hint is gone from the field and from the name alike, and a screen
26951
+ * reader is not told to do what cannot be done.
26149
26952
  *
26150
26953
  * @internal
26151
26954
  */
26152
26955
  _chooseAccessibleLabel() {
26153
- if (!this.accessibleLabel) return "";
26154
- return `${this._chooseLabel()}, ${this.accessibleLabel}`;
26956
+ const hint = !fileDragAndDropAvailable() ? "" : this._multiple ? this._t("components.file-field.drop-hint-multiple-lowercase-text") : this._t("components.file-field.drop-hint-lowercase-text");
26957
+ const types = this.variant === "area" ? this._acceptTypes() : null;
26958
+ return [
26959
+ hint ? `${this._chooseLabel()} ${hint}` : this._chooseLabel(),
26960
+ types ? this._t("components.file-field.accepted-types-text", { types }) : "",
26961
+ this.accessibleLabel
26962
+ ].filter(Boolean).join(", ");
26155
26963
  }
26156
26964
  /**
26157
26965
  * The change button is where focus lands after a pick, so its name says for
@@ -26186,16 +26994,34 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26186
26994
  /** @internal */
26187
26995
  _rejectionText(reason) {
26188
26996
  if (reason === "count") return this._t("components.file-field.too-many-files-error-text");
26189
- if (reason === "folder") return this.multiple ? this._t("components.file-field.folder-multiple-error-text") : this._t("components.file-field.folder-error-text");
26997
+ if (reason === "folder") return this._t("components.file-field.folder-error-text");
26998
+ if (reason === "empty-folder") return this._t("components.file-field.empty-folder-error-text");
26999
+ if (reason === "unreadable-folder") return this._t("components.file-field.unreadable-folder-error-text");
26190
27000
  const types = this._acceptTypes();
26191
27001
  if (!types) return this._t("components.file-field.wrong-file-type-error-text");
26192
- return this.multiple ? this._t("components.file-field.files-type-error-text", { types }) : this._t("components.file-field.file-type-error-text", { types });
27002
+ return this._multiple ? this._t("components.file-field.files-type-error-text", { types }) : this._t("components.file-field.file-type-error-text", { types });
27003
+ }
27004
+ /** @internal "Toon opties" with what they are for: "Toon opties, rapport.pdf". */
27005
+ _moreAccessibleLabel() {
27006
+ return `${this._t("components.file-field.show-options-action")}, ${this._valueLabel()}`;
26193
27007
  }
26194
27008
  /** @internal */
26195
27009
  _valueLabel() {
27010
+ const folder = this._folderName();
27011
+ if (folder) return this._files.length === 1 ? this._t("components.file-field.folder-one-file-text", { folder }) : this._t("components.file-field.folder-count-text", {
27012
+ folder,
27013
+ count: this._files.length
27014
+ });
26196
27015
  if (this._files.length === 1) return this._files[0].name;
26197
27016
  return this._t("components.file-field.file-count-text", { count: this._files.length });
26198
27017
  }
27018
+ /** @internal The folder everything came from, picked or dropped, or null.
27019
+ * A folder with one file is still named as a folder, as `paths` has it. */
27020
+ _folderName() {
27021
+ const folders = new Set(this._paths.map((path) => path.includes("/") ? path.split("/")[0] : ""));
27022
+ const [folder] = folders;
27023
+ return folders.size === 1 && folder ? folder : null;
27024
+ }
26199
27025
  connectedCallback() {
26200
27026
  super.connectedCallback();
26201
27027
  watchDrags(this);
@@ -26206,7 +27032,6 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26206
27032
  });
26207
27033
  this.addEventListener("dragover", this._handleDragOver);
26208
27034
  this.addEventListener("drop", this._handleDrop);
26209
- this.addEventListener("pointerdown", this._clearRejection);
26210
27035
  this.addEventListener("keydown", this._handleKeydown);
26211
27036
  }
26212
27037
  disconnectedCallback() {
@@ -26214,10 +27039,10 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26214
27039
  unwatchDrags(this);
26215
27040
  this._resizeObserver?.disconnect();
26216
27041
  clearTimeout(this._rejectionTimer);
27042
+ this._stopReading();
26217
27043
  this._observedValue = void 0;
26218
27044
  this.removeEventListener("dragover", this._handleDragOver);
26219
27045
  this.removeEventListener("drop", this._handleDrop);
26220
- this.removeEventListener("pointerdown", this._clearRejection);
26221
27046
  this.removeEventListener("keydown", this._handleKeydown);
26222
27047
  }
26223
27048
  updated(changed) {
@@ -26231,14 +27056,18 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26231
27056
  await Promise.all(Array.from(buttons, (button) => button.updateComplete));
26232
27057
  this._fitName();
26233
27058
  }
26234
- /** Cuts the chosen name in the middle to the width it has. Without a width
26235
- * (a hidden field), it falls back to the CSS cut of the first render. */
27059
+ /** Cuts the chosen name in the middle to the room it has: one line, or in a
27060
+ * control as many lines as its texts reserve anyway, so a name never makes
27061
+ * the field taller. A folder keeps its count whole and gives up its name.
27062
+ * Without a width (a hidden field), it falls back to the CSS cut of the
27063
+ * first render. */
26236
27064
  _fitName() {
26237
- const value = this.shadowRoot?.querySelector(".file-field__value");
26238
- const name = this.shadowRoot?.querySelector(".file-field__name");
26239
- if (this._files.length !== 1 || !value || !name) {
26240
- this._fittedName = null;
26241
- this._nameTruncated = false;
27065
+ const root = this.shadowRoot;
27066
+ const value = root?.querySelector(".file-field__value");
27067
+ const folder = this._folderName();
27068
+ const label = folder ? Array.from(root?.querySelectorAll(".file-field__folder") ?? []).find((variant) => variant.checkVisibility()) : root?.querySelector(".file-field__name");
27069
+ if (!value || !label || !folder && this._files.length !== 1) {
27070
+ this._resetFit();
26242
27071
  return;
26243
27072
  }
26244
27073
  if (value !== this._observedValue) {
@@ -26249,39 +27078,126 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26249
27078
  const style = getComputedStyle(value);
26250
27079
  const width = value.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
26251
27080
  if (width <= 0) {
26252
- this._fittedName = null;
26253
- this._nameTruncated = false;
27081
+ this._resetFit();
26254
27082
  return;
26255
27083
  }
26256
- const { measure, done } = textMeasurer(name);
26257
- try {
26258
- const { text, truncated } = truncateMiddle(this._files[0].name, width, measure);
26259
- this._fittedName = text;
27084
+ const lines = this._nameLinesFor(value);
27085
+ this._nameLines = lines;
27086
+ if (folder) {
27087
+ if (lines === 1) {
27088
+ this._fittedFolder = null;
27089
+ this._nameTruncated = false;
27090
+ return;
27091
+ }
27092
+ const text = label.classList.contains("file-field__folder--short") ? this._t("components.file-field.folder-count-short-text", {
27093
+ folder,
27094
+ count: this._files.length
27095
+ }) : this._valueLabel();
27096
+ const at = text.indexOf(folder);
27097
+ const [before, after] = at < 0 ? ["", ""] : [text.slice(0, at), text.slice(at + folder.length)];
27098
+ const { text: fitted, truncated } = this._cutToLines(value, width, lines, folder, (name) => before + name + after, false);
27099
+ this._fittedFolder = fitted;
26260
27100
  this._nameTruncated = truncated;
27101
+ return;
27102
+ }
27103
+ const name = this._files[0].name;
27104
+ if (lines === 1) {
27105
+ const { measure, done } = textMeasurer(label);
27106
+ try {
27107
+ const { text, truncated } = truncateMiddle(name, width, measure);
27108
+ this._fittedName = text;
27109
+ this._nameTruncated = truncated;
27110
+ } finally {
27111
+ done();
27112
+ }
27113
+ return;
27114
+ }
27115
+ const { text, truncated } = this._cutToLines(value, width, lines, name);
27116
+ this._fittedName = text;
27117
+ this._nameTruncated = truncated;
27118
+ }
27119
+ /** `name` cut in the middle until `shown(name)` fits on `lines` lines. */
27120
+ _cutToLines(value, width, lines, name, shown = (text) => text, keepExtension = true) {
27121
+ const { fits, done } = lineFitter(value, width, lines);
27122
+ try {
27123
+ return truncateMiddleToFit(name, (text) => fits(shown(text)), { keepExtension });
26261
27124
  } finally {
26262
27125
  done();
26263
27126
  }
26264
27127
  }
27128
+ /** The lines a control has for its name: what its tallest text takes, the
27129
+ * room around a text off. An area shows one. */
27130
+ _nameLinesFor(value) {
27131
+ const text = this.shadowRoot?.querySelector(".file-field__replace-area .file-field__text");
27132
+ if (this.variant === "area" || !text) return 1;
27133
+ const style = getComputedStyle(text);
27134
+ const room = text.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
27135
+ return Math.max(1, Math.floor((room + .5) / parseFloat(getComputedStyle(value).lineHeight)));
27136
+ }
27137
+ _resetFit() {
27138
+ this._fittedName = null;
27139
+ this._fittedFolder = null;
27140
+ this._nameTruncated = false;
27141
+ this._nameLines = 1;
27142
+ }
26265
27143
  willUpdate(changed) {
26266
- if (changed.has("_files")) {
26267
- this._fittedName = null;
26268
- this._nameTruncated = false;
26269
- }
27144
+ if (changed.has("_files")) this._resetFit();
26270
27145
  if (changed.has("required")) this._updateValidity();
26271
27146
  if (changed.has("accessibleLabel")) this.internals.ariaLabel = this.accessibleLabel || null;
26272
27147
  }
26273
27148
  /** @internal */
26274
- _handleChoose() {
27149
+ _handleChoose(e) {
26275
27150
  this._clearRejection();
27151
+ const menu = this._chooseMenu;
27152
+ if (this.directory && menu && e?.currentTarget instanceof Element) {
27153
+ if (menu.matches(":popover-open")) {
27154
+ menu.hidePopover();
27155
+ return;
27156
+ }
27157
+ if (performance.now() - this._menuClosedAt < REOPEN_GUARD_MS) return;
27158
+ menu.anchorElement = e.currentTarget.classList.contains("file-field__choose-button") && this._pointAt(e) || e.currentTarget;
27159
+ menu.showPopover();
27160
+ return;
27161
+ }
27162
+ this._input?.click();
27163
+ }
27164
+ /** The point a mouse or a finger pressed, as an element the menu can hang
27165
+ * from, so it opens there. Null for the keyboard, whose click has no point
27166
+ * (`detail` 0): the menu then hangs under the button. */
27167
+ _pointAt(e) {
27168
+ const anchor = this._menuAnchor;
27169
+ const field = anchor?.parentElement;
27170
+ if (!(e instanceof MouseEvent) || e.detail === 0 || !anchor || !field) return null;
27171
+ const box = field.getBoundingClientRect();
27172
+ anchor.style.left = `${e.clientX - box.left}px`;
27173
+ anchor.style.top = `${e.clientY - box.top}px`;
27174
+ return anchor;
27175
+ }
27176
+ /** @internal */
27177
+ _handleMenuToggle(e) {
27178
+ this._menuOpen = e.newState === "open";
27179
+ if (!this._menuOpen) this._menuClosedAt = performance.now();
27180
+ }
27181
+ /** @internal Picked in the menu of a field with `directory`. */
27182
+ _chooseFiles() {
26276
27183
  this._input?.click();
26277
27184
  }
27185
+ /** @internal Picked in the menu of a field with `directory`. */
27186
+ _chooseFolder() {
27187
+ this._folderInput?.click();
27188
+ }
26278
27189
  /** @internal */
26279
27190
  _handleInputChange(e) {
26280
27191
  e.stopPropagation();
26281
27192
  const input = e.target;
27193
+ this._action++;
27194
+ this._stopReading();
27195
+ const other = input === this._input ? this._folderInput : this._input;
27196
+ if (other) other.value = "";
26282
27197
  const hadFocus = this.matches(":focus-within");
26283
27198
  this._files = input.files ? Array.from(input.files) : [];
26284
- this._rejection = null;
27199
+ this._paths = this._files.map((file) => file.webkitRelativePath || file.name);
27200
+ this._clearRejection();
26285
27201
  this._commit();
26286
27202
  if (hadFocus) this.updateComplete.then(() => this.focus());
26287
27203
  }
@@ -26290,12 +27206,12 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26290
27206
  * on names and types; without, a drag only on what it shows before the drop. */
26291
27207
  _judge(transfer, files) {
26292
27208
  if (files) {
26293
- if (!this.multiple && files.length > 1) return "count";
26294
- if (holdsFolder(transfer)) return "folder";
27209
+ if (!this._multiple && files.length > 1) return "count";
27210
+ if (holdsFolder(transfer)) return this._multiple ? null : "folder";
26295
27211
  return files.every((file) => fileMatches(this.accept, file)) ? null : "type";
26296
27212
  }
26297
27213
  const items = Array.from(transfer.items).filter((item) => item.kind === "file");
26298
- if (!this.multiple && items.length > 1) return "count";
27214
+ if (!this._multiple && items.length > 1) return "count";
26299
27215
  return items.some((item) => typeRuledOut(this.accept, item.type)) ? "type" : null;
26300
27216
  }
26301
27217
  /** @internal Called by the shared window listeners in file-field.drop.ts. */
@@ -26306,29 +27222,88 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26306
27222
  this._dragRejection = state === "over" && transfer ? this._judge(transfer) : null;
26307
27223
  this._drag = this._dragRejection ? "rejected" : state;
26308
27224
  }
27225
+ /** A drop that passed the count, with its folders read: judged on the types
27226
+ * of the files in it, then taken in place of what the field had. */
27227
+ _takeDrop(dropped) {
27228
+ if (!dropped.every(({ file }) => fileMatches(this.accept, file))) {
27229
+ this._refuse("type");
27230
+ return;
27231
+ }
27232
+ const transfer = new DataTransfer();
27233
+ for (const { file } of dropped) transfer.items.add(file);
27234
+ if (this._input) this._input.files = transfer.files;
27235
+ if (this._folderInput) this._folderInput.value = "";
27236
+ this._files = dropped.map(({ file }) => file);
27237
+ this._paths = dropped.map(({ path }) => path);
27238
+ this._clearRejection();
27239
+ this._announcement = this._t("components.file-field.file-chosen-text", { name: this._valueLabel() });
27240
+ this._commit();
27241
+ }
27242
+ /** Shown for a while, then the field reads as itself again: the message
27243
+ * takes the place of "Bestand kiezen", and a field that kept it looked as if
27244
+ * it no longer did anything. The status line keeps it for a screen reader. */
27245
+ _refuse(rejection) {
27246
+ const hadFocus = this.matches(":focus-within");
27247
+ this._rejection = rejection;
27248
+ clearTimeout(this._rejectionTimer);
27249
+ this._rejectionTimer = setTimeout(() => {
27250
+ this._clearRejection();
27251
+ this._announcement = this._rejectionText(rejection);
27252
+ }, REJECTION_MS);
27253
+ if (hadFocus) this.updateComplete.then(() => this.focus());
27254
+ }
27255
+ _stopReading() {
27256
+ clearTimeout(this._readingTimer);
27257
+ this._reading = false;
27258
+ }
27259
+ /** @internal A press on the message dismisses it, and does nothing else. */
27260
+ _handleDismiss() {
27261
+ this._clearRejection();
27262
+ this.updateComplete.then(() => this.focus());
27263
+ }
27264
+ /** @internal "Alleen PDF, sluit melding, Bijlage": the message as it shows,
27265
+ * what a press does, and for which field. */
27266
+ _dismissAccessibleLabel() {
27267
+ if (!this._rejection) return "";
27268
+ return [
27269
+ this._rejectionText(this._rejection),
27270
+ this._t("components.file-field.dismiss-message-lowercase-action"),
27271
+ this.accessibleLabel
27272
+ ].filter(Boolean).join(", ");
27273
+ }
26309
27274
  /** @internal */
26310
27275
  _handleClear() {
27276
+ this._action++;
27277
+ this._stopReading();
26311
27278
  if (this._input) this._input.value = "";
27279
+ if (this._folderInput) this._folderInput.value = "";
26312
27280
  this._files = [];
27281
+ this._paths = [];
26313
27282
  this._commit();
26314
27283
  this.updateComplete.then(() => this.focus());
26315
27284
  }
26316
27285
  _commit() {
26317
27286
  this.commitFormValue();
26318
27287
  this.dispatchEvent(new CustomEvent("change", {
26319
- detail: { files: this._files },
27288
+ detail: {
27289
+ files: this._files,
27290
+ paths: this._paths
27291
+ },
26320
27292
  bubbles: true,
26321
27293
  composed: true
26322
27294
  }));
26323
27295
  }
26324
27296
  /** Submit one entry per file under `name`, the way a native multiple file
26325
27297
  * input does. A single file is submitted as itself, so a form with one file
26326
- * reads back as a File rather than as FormData wrapping one. */
27298
+ * reads back as a File rather than as FormData wrapping one. A file from a
27299
+ * dropped folder goes with its path as its file name, which is how a native
27300
+ * folder input submits it too. */
26327
27301
  formValue() {
26328
27302
  if (!this.name || this._files.length === 0) return null;
26329
- if (this._files.length === 1) return this._files[0];
27303
+ const nested = this._paths.some((path) => path.includes("/"));
27304
+ if (this._files.length === 1 && !nested) return this._files[0];
26330
27305
  const data = new FormData();
26331
- for (const file of this._files) data.append(this.name, file);
27306
+ this._files.forEach((file, index) => data.append(this.name, file, this._paths[index] ?? file.name));
26332
27307
  return data;
26333
27308
  }
26334
27309
  commitFormValue() {
@@ -26340,15 +27315,27 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26340
27315
  if (this.required && this._files.length === 0) this.internals.setValidity({ valueMissing: true }, this._t("components.file-field.required-error-text"), this._input ?? this);
26341
27316
  else this.internals.setValidity({});
26342
27317
  }
27318
+ /** Back to empty, as a clear, but without a change event, as a native
27319
+ * input resets: a folder still being read is dropped too. */
26343
27320
  formResetCallback() {
27321
+ this._action++;
27322
+ this._stopReading();
27323
+ this._clearRejection();
26344
27324
  if (this._input) this._input.value = "";
27325
+ if (this._folderInput) this._folderInput.value = "";
26345
27326
  this._files = [];
27327
+ this._paths = [];
26346
27328
  this.commitFormValue();
26347
27329
  }
26348
- /** The button that opens the dialog: the whole surface while the field is
26349
- * empty, "Wijzigen" once it has a file. */
27330
+ /** The message of a refused drop while it shows. Otherwise the button that
27331
+ * opens the dialog: the whole surface while the field is
27332
+ * empty, or the first of its two choices in an area with `directory`, and
27333
+ * "Wijzigen" once it has a file, or the menu that holds it in a narrow field. */
26350
27334
  _chooseButton() {
26351
- return this.shadowRoot?.querySelector(".file-field__browse-button, nldd-button") ?? null;
27335
+ const dismiss = this.shadowRoot?.querySelector(".file-field__dismiss-button");
27336
+ if (dismiss) return dismiss;
27337
+ const buttons = this.shadowRoot?.querySelectorAll(".file-field__choose-button, .file-field__choose-button-group nldd-button, .file-field__change-button, .file-field__more-button") ?? [];
27338
+ return Array.from(buttons).find((button) => button.checkVisibility?.() ?? true) ?? buttons[0] ?? null;
26352
27339
  }
26353
27340
  /**
26354
27341
  * Delegates focus to the choose button rather than the hidden input: an input
@@ -26356,6 +27343,7 @@ var NLDDFileField = (_NLDDFileField = class NLDDFileField extends DescribedBy(Fo
26356
27343
  * sees as the control.
26357
27344
  */
26358
27345
  focus(options) {
27346
+ if (deferFocus(this, options)) return;
26359
27347
  this._chooseButton()?.focus(options);
26360
27348
  }
26361
27349
  /** The file input is display:none and therefore not in the accessibility tree.
@@ -26383,6 +27371,10 @@ __decorate([property({
26383
27371
  type: Boolean,
26384
27372
  reflect: true
26385
27373
  })], NLDDFileField.prototype, "multiple", void 0);
27374
+ __decorate([property({
27375
+ type: Boolean,
27376
+ reflect: true
27377
+ })], NLDDFileField.prototype, "directory", void 0);
26386
27378
  __decorate([property({
26387
27379
  type: String,
26388
27380
  attribute: "accessible-label"
@@ -26417,9 +27409,16 @@ __decorate([state()], NLDDFileField.prototype, "_drag", void 0);
26417
27409
  __decorate([state()], NLDDFileField.prototype, "_dragRejection", void 0);
26418
27410
  __decorate([state()], NLDDFileField.prototype, "_fittedName", void 0);
26419
27411
  __decorate([state()], NLDDFileField.prototype, "_nameTruncated", void 0);
27412
+ __decorate([state()], NLDDFileField.prototype, "_fittedFolder", void 0);
27413
+ __decorate([state()], NLDDFileField.prototype, "_nameLines", void 0);
26420
27414
  __decorate([state()], NLDDFileField.prototype, "_announcement", void 0);
27415
+ __decorate([state()], NLDDFileField.prototype, "_reading", void 0);
26421
27416
  __decorate([state()], NLDDFileField.prototype, "_rejection", void 0);
27417
+ __decorate([state()], NLDDFileField.prototype, "_menuOpen", void 0);
26422
27418
  __decorate([query(".file-field__input")], NLDDFileField.prototype, "_input", void 0);
27419
+ __decorate([query(".file-field__folder-input")], NLDDFileField.prototype, "_folderInput", void 0);
27420
+ __decorate([query(".file-field__choose-menu")], NLDDFileField.prototype, "_chooseMenu", void 0);
27421
+ __decorate([query(".file-field__menu-anchor")], NLDDFileField.prototype, "_menuAnchor", void 0);
26423
27422
  NLDDFileField = __decorate([customElement("nldd-file-field")], NLDDFileField);
26424
27423
  // src/components/inputs/multi-line-text-field/multi-line-text-field.styles.ts
26425
27424
  var multiLineTextFieldStyles = css`
@@ -27115,6 +28114,7 @@ var _NLDDNumberField = class NLDDNumberField extends DescribedBy(FormAssociated(
27115
28114
  * `numberFieldEl.focus()` without reaching into shadow DOM.
27116
28115
  */
27117
28116
  focus(options) {
28117
+ if (deferFocus(this, options)) return;
27118
28118
  this.shadowRoot?.querySelector(".number-field__input")?.focus(options);
27119
28119
  }
27120
28120
  render() {
@@ -28585,6 +29585,7 @@ var _NLDDRadioButtonGroup = class NLDDRadioButtonGroup extends LitElement {
28585
29585
  * place.
28586
29586
  */
28587
29587
  focus(options) {
29588
+ if (deferFocus(this, options)) return;
28588
29589
  const fields = this._getEnabledFields();
28589
29590
  (fields.find((field) => field.checked) ?? fields[0])?.focus(options);
28590
29591
  }
@@ -29001,6 +30002,7 @@ var _NLDDSearchField = class NLDDSearchField extends DescribedBy(FormAssociated(
29001
30002
  * `searchFieldEl.focus()` without reaching into shadow DOM.
29002
30003
  */
29003
30004
  focus(options) {
30005
+ if (deferFocus(this, options)) return;
29004
30006
  this._input?.focus(options);
29005
30007
  }
29006
30008
  render() {
@@ -29655,6 +30657,7 @@ var NLDDSegmentedControlItem = (_NLDDSegmentedControlItem = class NLDDSegmentedC
29655
30657
  * `itemEl.focus()` without reaching into shadow DOM.
29656
30658
  */
29657
30659
  focus(options) {
30660
+ if (deferFocus(this, options)) return;
29658
30661
  if (this.inputType === "radio") {
29659
30662
  super.focus(options);
29660
30663
  return;
@@ -29916,6 +30919,7 @@ var NLDDSegmentedControl = (_NLDDSegmentedControl2 = class NLDDSegmentedControl
29916
30919
  * the control.
29917
30920
  */
29918
30921
  focus(options) {
30922
+ if (deferFocus(this, options)) return;
29919
30923
  const items = this._getItems().filter((item) => !item.disabled);
29920
30924
  (items.find((item) => item.selected) ?? items[0])?.focus(options);
29921
30925
  }
@@ -30218,6 +31222,7 @@ var _NLDDStepper = class NLDDStepper extends DescribedBy(FormAssociated(LitEleme
30218
31222
  * disabled, because the spinbutton drops its tabindex then.
30219
31223
  */
30220
31224
  focus(options) {
31225
+ if (deferFocus(this, options)) return;
30221
31226
  this.shadowRoot?.querySelector(".stepper")?.focus(options);
30222
31227
  }
30223
31228
  /** The spinbutton is the control; the buttons beside it are shortcuts to it. */
@@ -30544,6 +31549,7 @@ var NLDDSwitch = (_NLDDSwitch2 = class NLDDSwitch extends DescribedBy(FormAssoci
30544
31549
  * call `switchEl.focus()` without reaching into shadow DOM.
30545
31550
  */
30546
31551
  focus(options) {
31552
+ if (deferFocus(this, options)) return;
30547
31553
  this.shadowRoot?.querySelector(".switch__input")?.focus(options);
30548
31554
  }
30549
31555
  render() {
@@ -30724,6 +31730,7 @@ var _NLDDSwitchField = class NLDDSwitchField extends DescribedBy(LitElement) {
30724
31730
  * reaching into shadow DOM.
30725
31731
  */
30726
31732
  focus(options) {
31733
+ if (deferFocus(this, options)) return;
30727
31734
  this.shadowRoot?.querySelector("nldd-switch")?.focus(options);
30728
31735
  }
30729
31736
  /** The switch it renders knows which element inside itself is the control. */
@@ -33952,7 +34959,12 @@ var markDecorationPlugin = ViewPlugin.fromClass(class {
33952
34959
  if (update.docChanged || update.viewportChanged || update.selectionSet || treeAdvanced(update.startState, update.state)) this.decorations = buildMarkDecorations(update.view);
33953
34960
  }
33954
34961
  }, { decorations: (plugin) => plugin.decorations });
33955
- var HANGING_RE = /^(\s*(?:[-*+]\s+(?:\[[ xX]\]\s+)?|\d+[.)]\s+)|\s*>+\s?)/;
34962
+ var HANGING_RE = /^((?:[ \t]*(?:[-*+][ \t]+(?:\[[ xX]\][ \t]+)?|\d+[.)][ \t]+|>[ \t]?))+)/;
34963
+ /** The length of the list and quote markers a line starts with, which the
34964
+ * hanging indent of the line counts in mono advances. */
34965
+ function prefixLength(text) {
34966
+ return HANGING_RE.exec(text)?.[1].length ?? 0;
34967
+ }
33956
34968
  var prefixMonoDeco = Decoration.mark({ class: "cm-md-listprefix" });
33957
34969
  var hangingLineCache = {};
33958
34970
  function hangingLineDeco(length) {
@@ -34071,9 +35083,10 @@ function renderLead(completion) {
34071
35083
  const { candidate } = completion;
34072
35084
  if (candidate.avatar) {
34073
35085
  const avatar = document.createElement("nldd-avatar");
34074
- avatar.setAttribute("name", candidate.text);
35086
+ avatar.setAttribute("name", candidate.avatar.name ?? candidate.text);
34075
35087
  avatar.setAttribute("size", "32");
34076
35088
  avatar.setAttribute("decorative", "");
35089
+ if (candidate.avatar.initials) avatar.setAttribute("initials", candidate.avatar.initials);
34077
35090
  if (candidate.avatar.src) avatar.setAttribute("src", candidate.avatar.src);
34078
35091
  if (candidate.avatar.type) avatar.setAttribute("type", candidate.avatar.type);
34079
35092
  return avatar;
@@ -34164,9 +35177,10 @@ function emptyMessageFor(lists, query, defaultEmptyText) {
34164
35177
  /**
34165
35178
  * The message in place of an empty list. It sits where the list would, in the
34166
35179
  * same top-layer frame and with the same surface, but it is not an option:
34167
- * nothing to select or apply, so it is a status that a screen reader announces
34168
- * rather than a row in the listbox. It goes when there are candidates again,
34169
- * when the caret leaves the query, on Escape and when the editor loses focus.
35180
+ * nothing to select or apply. A screen reader hears it through the announcer
35181
+ * below, not from this element, which arrives with its text already in it. It
35182
+ * goes when there are candidates again, when the caret leaves the query, on
35183
+ * Escape and when the editor loses focus.
34170
35184
  */
34171
35185
  var emptyMessageField = StateField.define({
34172
35186
  create: () => null,
@@ -34190,7 +35204,6 @@ var emptyMessageField = StateField.define({
34190
35204
  create: () => {
34191
35205
  const dom = document.createElement("div");
34192
35206
  dom.className = "cm-nldd-typeahead-empty";
34193
- dom.setAttribute("role", "status");
34194
35207
  dom.textContent = value.text;
34195
35208
  return { dom };
34196
35209
  }
@@ -34211,6 +35224,37 @@ var emptyMessageClose = [
34211
35224
  })
34212
35225
  ];
34213
35226
  /**
35227
+ * What a screen reader hears about the list: how many candidates there are when
35228
+ * it opens or its length changes, and the message when it is empty.
35229
+ *
35230
+ * One live region that is always there and starts empty, and only its text
35231
+ * changes. A region that arrives together with its text, as the empty message
35232
+ * does, is often skipped: a screen reader reads a change in a region it already
35233
+ * knew. The listbox itself says nothing about its length.
35234
+ */
35235
+ function typeaheadAnnouncer(countText) {
35236
+ return ViewPlugin.fromClass(class {
35237
+ constructor(view) {
35238
+ this.status = document.createElement("div");
35239
+ this.status.className = "cm-nldd-typeahead-status";
35240
+ this.status.setAttribute("role", "status");
35241
+ view.dom.append(this.status);
35242
+ }
35243
+ update(update) {
35244
+ const status = completionStatus(update.state);
35245
+ if (status === "pending") return;
35246
+ const empty = update.state.field(emptyMessageField, false);
35247
+ let text = "";
35248
+ if (empty) text = empty.text;
35249
+ else if (status === "active") text = countText(currentCompletions(update.state).length);
35250
+ if (this.status.textContent !== text) this.status.textContent = text;
35251
+ }
35252
+ destroy() {
35253
+ this.status.remove();
35254
+ }
35255
+ });
35256
+ }
35257
+ /**
34214
35258
  * A frame for the list in the top layer, the way an nldd-menu opens.
34215
35259
  *
34216
35260
  * CodeMirror hangs its tooltip in the editor, so everything around the editor
@@ -34263,107 +35307,12 @@ function topLayerPopups() {
34263
35307
  tooltipSpace: space
34264
35308
  }), keeper];
34265
35309
  }
34266
- var popupTheme = EditorView.theme({
34267
- ".cm-nldd-popups": {
34268
- position: "fixed",
34269
- inset: "0",
34270
- width: "auto",
34271
- height: "auto",
34272
- margin: "0",
34273
- border: "none",
34274
- padding: "0",
34275
- background: "none",
34276
- overflow: "visible",
34277
- pointerEvents: "none"
34278
- },
34279
- ".cm-nldd-popups .cm-tooltip": { pointerEvents: "auto" },
34280
- ".cm-tooltip.cm-tooltip-autocomplete": {
34281
- border: "none",
34282
- borderRadius: "var(--semantics-overlays-corner-radius)",
34283
- backgroundColor: "var(--semantics-surfaces-base-background-color)",
34284
- boxShadow: "var(--semantics-overlays-box-shadow)"
34285
- },
34286
- ".cm-tooltip.cm-tooltip-autocomplete > ul": {
34287
- fontFamily: "var(--primitives-font-family-body)",
34288
- fontSize: "var(--primitives-font-size-100)",
34289
- minWidth: "var(--primitives-area-280)",
34290
- boxSizing: "border-box",
34291
- maxHeight: "14em",
34292
- margin: "0",
34293
- padding: "var(--primitives-space-8)"
34294
- },
34295
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li": {
34296
- display: "flex",
34297
- alignItems: "center",
34298
- gap: "var(--primitives-space-8)",
34299
- minHeight: "var(--semantics-controls-sm-min-size)",
34300
- boxSizing: "border-box",
34301
- padding: "var(--primitives-space-4) var(--primitives-space-8)",
34302
- borderRadius: "var(--semantics-controls-sm-corner-radius)",
34303
- color: "var(--semantics-content-color)",
34304
- cursor: "default"
34305
- },
34306
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li > :is(nldd-avatar, nldd-icon, .cm-nldd-symbol)": { flex: "none" },
34307
- ".cm-nldd-symbol": {
34308
- display: "inline-flex",
34309
- justifyContent: "center",
34310
- inlineSize: "20px"
34311
- },
34312
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar": {
34313
- display: "grid",
34314
- gridTemplateColumns: "auto minmax(0, 1fr)",
34315
- alignContent: "center",
34316
- rowGap: "0",
34317
- minHeight: "var(--semantics-controls-md-min-size)"
34318
- },
34319
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > nldd-avatar": {
34320
- gridRow: "span 2",
34321
- alignSelf: "center"
34322
- },
34323
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > .cm-completionLabel": {
34324
- gridColumn: "2",
34325
- font: "var(--primitives-font-body-md-regular-tight)"
34326
- },
34327
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > .cm-completionDetail": {
34328
- gridColumn: "2",
34329
- marginLeft: "0",
34330
- font: "var(--primitives-font-body-sm-regular-tight)"
34331
- },
34332
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]": {
34333
- backgroundColor: "var(--semantics-list-items-is-highlighted-background-color)",
34334
- color: "var(--semantics-list-items-is-highlighted-content-color)"
34335
- },
34336
- "@media (hover: hover)": { ".cm-tooltip.cm-tooltip-autocomplete > ul > li:not([aria-selected]):hover": {
34337
- backgroundColor: "var(--semantics-list-items-is-hovered-background-color)",
34338
- color: "var(--semantics-list-items-is-hovered-content-color)"
34339
- } },
34340
- ".cm-completionDetail": {
34341
- marginLeft: "auto",
34342
- color: "var(--semantics-content-secondary-color)",
34343
- fontStyle: "normal"
34344
- },
34345
- ".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] .cm-completionDetail": { color: "inherit" },
34346
- ".cm-tooltip.cm-nldd-typeahead-empty": {
34347
- border: "none",
34348
- borderRadius: "var(--semantics-overlays-corner-radius)",
34349
- backgroundColor: "var(--semantics-surfaces-base-background-color)",
34350
- boxShadow: "var(--semantics-overlays-box-shadow)",
34351
- minWidth: "var(--primitives-area-280)",
34352
- maxWidth: "var(--primitives-area-400)",
34353
- boxSizing: "border-box",
34354
- padding: "var(--primitives-space-12) var(--primitives-space-16)",
34355
- color: "var(--semantics-content-secondary-color)",
34356
- fontFamily: "var(--primitives-font-family-body)",
34357
- fontSize: "var(--primitives-font-size-100)"
34358
- },
34359
- "@media (pointer: coarse)": { ".cm-tooltip.cm-tooltip-autocomplete > ul > li": { minHeight: "var(--semantics-controls-md-min-size)" } }
34360
- });
34361
35310
  /**
34362
35311
  * The typeaheads. `getTypeaheads` is read on every keystroke, so the editor can
34363
35312
  * hand over its current lists; choosing a candidate writes what the list's
34364
35313
  * `insert` says and calls `onChoose`. Without lists it is inert.
34365
35314
  */
34366
- function typeaheads(getTypeaheads, onChoose, defaultEmptyText = () => null) {
35315
+ function typeaheads(getTypeaheads, onChoose, defaultEmptyText = () => null, countText = (count) => String(count)) {
34367
35316
  const reopenOnDelete = EditorView.updateListener.of((update) => {
34368
35317
  if (!update.docChanged || completionStatus(update.state) !== null) return;
34369
35318
  if (!update.transactions.some((tr) => tr.isUserEvent("delete"))) return;
@@ -34383,7 +35332,7 @@ function typeaheads(getTypeaheads, onChoose, defaultEmptyText = () => null) {
34383
35332
  reopenOnDelete,
34384
35333
  emptyMessageField,
34385
35334
  emptyMessageClose,
34386
- popupTheme
35335
+ typeaheadAnnouncer(countText)
34387
35336
  ];
34388
35337
  }
34389
35338
  // src/components/inputs/text-editor/text-editor.spellcheck.ts
@@ -35945,13 +36894,7 @@ var stableCursor = [
35945
36894
  }),
35946
36895
  pointerTracker,
35947
36896
  stepOverKeymap,
35948
- typePastBadge,
35949
- EditorView.theme({
35950
- ".cm-cursorLayer": { display: "none" },
35951
- ".cm-nldd-cursorLayer": { pointerEvents: "none" },
35952
- "&.cm-focused > .cm-scroller > .cm-nldd-cursorLayer": { animation: "steps(1) cm-blink 1.2s infinite" },
35953
- "&.cm-focused > .cm-scroller > .cm-nldd-cursorLayer .cm-cursor": { display: "block" }
35954
- })
36897
+ typePastBadge
35955
36898
  ];
35956
36899
  // src/components/inputs/text-editor/text-editor.focus-selection.ts
35957
36900
  /** How long after focus the browser's own selection move is expected, in ms. The
@@ -36108,13 +37051,21 @@ var bullet = Decoration.mark({ class: "cm-md-bullet" });
36108
37051
  var TASK_PREFIX_RE = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/;
36109
37052
  /** The width of the box in mono advances; matches .cm-md-task-box. */
36110
37053
  var TASK_BOX_WIDTH = 2.5;
36111
- var taskIndentCache = {};
36112
- function taskIndent(length) {
36113
- return taskIndentCache[length] ?? (taskIndentCache[length] = Decoration.line({ attributes: { style: `text-indent:calc(${length} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${length} * var(--_text-editor-marker-advance)) !important` } }));
37054
+ var prefixIndentCache = {};
37055
+ function prefixIndent(length) {
37056
+ return prefixIndentCache[length] ?? (prefixIndentCache[length] = Decoration.line({ attributes: { style: `text-indent:calc(${length} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${length} * var(--_text-editor-marker-advance)) !important` } }));
36114
37057
  }
36115
37058
  var ordinal = Decoration.mark({ class: "cm-md-ordinal" });
36116
- var quoteLine = Decoration.line({ class: "cm-md-quote-line" });
37059
+ var quoteLineCache = {};
37060
+ function quoteLine(columns) {
37061
+ const key = columns.join(",");
37062
+ return quoteLineCache[key] ?? (quoteLineCache[key] = Decoration.line({
37063
+ class: "cm-md-quote-line",
37064
+ attributes: { style: `background-image:${columns.map(() => "var(--_text-editor-quote-rule)").join(",")};background-position:${columns.map((column) => `calc(${column} * var(--_text-editor-marker-advance)) 0`).join(",")}` }
37065
+ }));
37066
+ }
36117
37067
  var quoteMark = Decoration.mark({ class: "cm-md-quote-mark-hidden" });
37068
+ var quoteGap = Decoration.mark({ class: "cm-md-quote-gap" });
36118
37069
  var bareCode = Decoration.mark({ class: "cm-md-code-bare" });
36119
37070
  var RuleWidget = class extends WidgetType {
36120
37071
  toDOM() {
@@ -36136,6 +37087,57 @@ function outermostQuote(node) {
36136
37087
  for (let up = node.parent; up; up = up.parent) if (up.name === "Blockquote") outer = up;
36137
37088
  return outer;
36138
37089
  }
37090
+ /** The width of one quote level in mono advances, of "> ". */
37091
+ var QUOTE_STEP = 2;
37092
+ var lazyIndentCache = {};
37093
+ function lazyIndent(prefix, extra) {
37094
+ var _ref;
37095
+ return lazyIndentCache[_ref = `${prefix},${extra}`] ?? (lazyIndentCache[_ref] = Decoration.line({ attributes: { style: `text-indent:calc(${prefix} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${prefix + extra} * var(--_text-editor-marker-advance)) !important` } }));
37096
+ }
37097
+ /** How many quotes each line of a quote lies in, per line start. */
37098
+ function quoteDepths(state, quote) {
37099
+ const depths = /* @__PURE__ */ new Map();
37100
+ syntaxTree(state).iterate({
37101
+ from: quote.from,
37102
+ to: quote.to,
37103
+ enter: (node) => {
37104
+ if (node.name !== "Blockquote") return;
37105
+ forEachLineStart(state, node.from, node.to, (lineFrom) => depths.set(lineFrom, (depths.get(lineFrom) ?? 0) + 1));
37106
+ }
37107
+ });
37108
+ return depths;
37109
+ }
37110
+ /** The start of the last line of a quote with more than its marks on it. */
37111
+ function lastLineWithText(state, quote) {
37112
+ for (let line = state.doc.lineAt(quote.to);; line = state.doc.line(line.number - 1)) if (/[^\s>]/.test(line.text) || line.from <= quote.from) return line.from;
37113
+ }
37114
+ /** The spaces after each `>` beyond the first, as [from, to) columns: 2 to 4
37115
+ * spaces are padding the result ignores, while 5 or more start an indented
37116
+ * code block in the quote, which keeps them. */
37117
+ function spareSpaces(text, marks) {
37118
+ const spare = [];
37119
+ for (const mark of marks) {
37120
+ const run = /^[ ]*/.exec(text.slice(mark + 1))[0].length;
37121
+ if (run >= 2 && run <= 4) spare.push([mark + 2, mark + 1 + run]);
37122
+ }
37123
+ return spare;
37124
+ }
37125
+ /** The column of every `>` in a quote, per line start. */
37126
+ function quoteColumns(state, quote) {
37127
+ const columns = /* @__PURE__ */ new Map();
37128
+ syntaxTree(state).iterate({
37129
+ from: quote.from,
37130
+ to: quote.to,
37131
+ enter: (node) => {
37132
+ if (node.name !== "QuoteMark") return;
37133
+ const line = state.doc.lineAt(node.from);
37134
+ const list = columns.get(line.from) ?? [];
37135
+ list.push(node.from - line.from);
37136
+ columns.set(line.from, list);
37137
+ }
37138
+ });
37139
+ return columns;
37140
+ }
36139
37141
  function revealsAnything(state) {
36140
37142
  return !state.readOnly && state.facet(EditorView.editable);
36141
37143
  }
@@ -36211,7 +37213,30 @@ function buildHidden(view) {
36211
37213
  if (node.name === "Blockquote") {
36212
37214
  const outer = outermostQuote(node.node);
36213
37215
  if (outer !== node.node || revealed(outer.from, outer.to)) return;
36214
- forEachLineStart(state, outer.from, outer.to, (lineFrom) => ranges.push(quoteLine.range(lineFrom)));
37216
+ const columns = quoteColumns(state, outer);
37217
+ const depths = quoteDepths(state, outer);
37218
+ const lastText = lastLineWithText(state, outer);
37219
+ let last = [0];
37220
+ forEachLineStart(state, outer.from, outer.to, (lineFrom) => {
37221
+ if (lineFrom > lastText) return;
37222
+ const line = state.doc.lineAt(lineFrom);
37223
+ const marks = columns.get(lineFrom) ?? [];
37224
+ const spare = spareSpaces(line.text, marks);
37225
+ const hidden = spare.reduce((sum, [from, to]) => sum + to - from, 0);
37226
+ for (const [from, to] of spare) ranges.push(hideMark.range(lineFrom + from, lineFrom + to));
37227
+ const tight = marks.filter((column) => /[^ \t]/.test(line.text.charAt(column + 1)));
37228
+ for (const column of tight) ranges.push(quoteGap.range(lineFrom + column, lineFrom + column + 1));
37229
+ const own = marks.map((column) => column - spare.filter(([from]) => from < column).reduce((sum, [from, to]) => sum + to - from, 0) + tight.filter((mark) => mark < column).length);
37230
+ const depth = Math.max(1, depths.get(lineFrom) ?? 0);
37231
+ const prefix = prefixLength(line.text) - hidden + tight.length;
37232
+ const rules = (own.length ? own : last).slice(0, depth);
37233
+ while (rules.length < depth) rules.push(rules.length ? rules[rules.length - 1] + QUOTE_STEP : 0);
37234
+ const missing = own.length ? (depth - own.length) * QUOTE_STEP : rules[rules.length - 1] + QUOTE_STEP;
37235
+ if (missing > 0) ranges.push(lazyIndent(prefix, missing).range(lineFrom));
37236
+ else if (hidden || tight.length) ranges.push(prefixIndent(prefix).range(lineFrom));
37237
+ ranges.push(quoteLine(rules).range(lineFrom));
37238
+ last = rules;
37239
+ });
36215
37240
  return;
36216
37241
  }
36217
37242
  if (!parent) return;
@@ -36227,7 +37252,7 @@ function buildHidden(view) {
36227
37252
  const task = TASK_PREFIX_RE.exec(line.text);
36228
37253
  const marker = task && node.node.parent?.getChild("Task")?.getChild("TaskMarker");
36229
37254
  if (task && marker) {
36230
- ranges.push(taskIndent(task[1].length + TASK_BOX_WIDTH + task[2].length).range(line.from), hideMark.range(node.from, marker.from), taskBox(state, /x/i.test(state.sliceDoc(marker.from, marker.to))).range(marker.from, marker.to));
37255
+ ranges.push(prefixIndent(task[1].length + TASK_BOX_WIDTH + task[2].length).range(line.from), hideMark.range(node.from, marker.from), taskBox(state, /x/i.test(state.sliceDoc(marker.from, marker.to))).range(marker.from, marker.to));
36231
37256
  return;
36232
37257
  }
36233
37258
  ranges.push(bullet.range(node.from, node.to));
@@ -36462,6 +37487,7 @@ var textEditorStyles = css`
36462
37487
  --_text-editor-rule-thickness: var(--semantics-dividers-thickness);
36463
37488
  --_text-editor-quote-border-width: var(--primitives-border-width-regular);
36464
37489
  --_text-editor-quote-border-color: var(--semantics-content-color);
37490
+ --_text-editor-quote-rule: linear-gradient(var(--_text-editor-quote-border-color), var(--_text-editor-quote-border-color));
36465
37491
  --_text-editor-rule-color: var(--semantics-dividers-color);
36466
37492
  --_text-editor-heading-marker-scale: 75%;
36467
37493
  --_text-editor-token-corner-radius: var(--primitives-corner-radius-sm);
@@ -36514,6 +37540,33 @@ var textEditorStyles = css`
36514
37540
  --_text-editor-mention-token-is-selected-background-color: var(--semantics-mentions-is-selected-background-color);
36515
37541
  --_text-editor-mention-token-is-selected-content-color: var(--semantics-mentions-is-selected-content-color);
36516
37542
  --_text-editor-rows: 6;
37543
+ --_text-editor-popup-corner-radius: var(--semantics-overlays-corner-radius);
37544
+ --_text-editor-popup-background-color: var(--semantics-surfaces-base-background-color);
37545
+ --_text-editor-popup-box-shadow: var(--semantics-overlays-box-shadow);
37546
+ --_text-editor-popup-font-family: var(--primitives-font-family-body);
37547
+ --_text-editor-popup-font-size: var(--primitives-font-size-100);
37548
+ --_text-editor-popup-min-width: var(--primitives-area-280);
37549
+ --_text-editor-popup-max-height: 14em;
37550
+ --_text-editor-popup-padding: var(--primitives-space-8);
37551
+ --_text-editor-popup-row-min-height: var(--semantics-controls-sm-min-size);
37552
+ --_text-editor-popup-row-gap: var(--primitives-space-8);
37553
+ --_text-editor-popup-row-padding-block: var(--primitives-space-4);
37554
+ --_text-editor-popup-row-padding-inline: var(--primitives-space-8);
37555
+ --_text-editor-popup-row-corner-radius: var(--semantics-controls-sm-corner-radius);
37556
+ --_text-editor-popup-row-content-color: var(--semantics-content-color);
37557
+ --_text-editor-popup-row-is-highlighted-background-color: var(--semantics-list-items-is-highlighted-background-color);
37558
+ --_text-editor-popup-row-is-highlighted-content-color: var(--semantics-list-items-is-highlighted-content-color);
37559
+ --_text-editor-popup-row-is-hovered-background-color: var(--semantics-list-items-is-hovered-background-color);
37560
+ --_text-editor-popup-row-is-hovered-content-color: var(--semantics-list-items-is-hovered-content-color);
37561
+ --_text-editor-popup-avatar-row-min-height: var(--semantics-controls-md-min-size);
37562
+ --_text-editor-popup-text-font: var(--primitives-font-body-md-regular-tight);
37563
+ --_text-editor-popup-supporting-text-font: var(--primitives-font-body-sm-regular-tight);
37564
+ --_text-editor-popup-supporting-text-color: var(--semantics-content-secondary-color);
37565
+ --_text-editor-popup-symbol-size: var(--primitives-space-20);
37566
+ --_text-editor-popup-message-max-width: var(--primitives-area-400);
37567
+ --_text-editor-popup-message-padding-block: var(--primitives-space-12);
37568
+ --_text-editor-popup-message-padding-inline: var(--primitives-space-16);
37569
+ --_text-editor-popup-message-color: var(--semantics-content-secondary-color);
36517
37570
 
36518
37571
  ${inheritedTextReset}
36519
37572
  display: flex;
@@ -36529,6 +37582,12 @@ var textEditorStyles = css`
36529
37582
  display: none;
36530
37583
  }
36531
37584
 
37585
+ @media (pointer: coarse) {
37586
+ :host {
37587
+ --_text-editor-popup-row-min-height: var(--semantics-controls-md-min-size);
37588
+ }
37589
+ }
37590
+
36532
37591
 
36533
37592
  /* ## Appearance — input-field adds the framed surface + a default content padding */
36534
37593
 
@@ -36606,6 +37665,24 @@ var textEditorStyles = css`
36606
37665
  min-height: calc(var(--_text-editor-rows) * 1lh);
36607
37666
  }
36608
37667
 
37668
+ /* drawSelection() keeps drawing its own cursors; .cm-nldd-cursorLayer takes
37669
+ over, with the blink CodeMirror gives its own layer. */
37670
+ :host .cm-cursorLayer {
37671
+ display: none;
37672
+ }
37673
+
37674
+ :host .cm-nldd-cursorLayer {
37675
+ pointer-events: none;
37676
+ }
37677
+
37678
+ :host .cm-editor.cm-focused > .cm-scroller > .cm-nldd-cursorLayer {
37679
+ animation: steps(1) cm-blink 1.2s infinite;
37680
+ }
37681
+
37682
+ :host .cm-editor.cm-focused > .cm-scroller > .cm-nldd-cursorLayer .cm-cursor {
37683
+ display: block;
37684
+ }
37685
+
36609
37686
  /* Read-only, like a native read-only field: select and copy, but no caret. */
36610
37687
  :host([readonly]) .cm-nldd-cursorLayer {
36611
37688
  visibility: hidden;
@@ -36914,12 +37991,14 @@ var textEditorStyles = css`
36914
37991
  /* A gradient, not an inset shadow with an offset: iOS Safari leaves a hairline
36915
37992
  of such a shadow along the bottom of a line with a fractional height. */
36916
37993
  .cm-md-quote-line {
36917
- background-image: linear-gradient(var(--_text-editor-quote-border-color), var(--_text-editor-quote-border-color));
36918
37994
  background-repeat: no-repeat;
36919
- background-position: left;
36920
37995
  background-size: var(--_text-editor-quote-border-width) 100%;
36921
37996
  }
36922
37997
 
37998
+ .cm-md-quote-gap {
37999
+ padding-inline-end: var(--_text-editor-marker-advance);
38000
+ }
38001
+
36923
38002
  :host .cm-md-quote-mark-hidden,
36924
38003
  :host .cm-md-quote-mark-hidden * {
36925
38004
  color: transparent;
@@ -37066,6 +38145,137 @@ var textEditorStyles = css`
37066
38145
  }
37067
38146
 
37068
38147
 
38148
+ /* # Typeahead popup */
38149
+
38150
+ /* Only a frame in the top layer for CodeMirror's tooltips, which place
38151
+ themselves against the window: no surface that would swallow a click. */
38152
+ :host .cm-nldd-popups {
38153
+ position: fixed;
38154
+ inset: 0;
38155
+ width: auto;
38156
+ height: auto;
38157
+ margin: 0;
38158
+ border: none;
38159
+ padding: 0;
38160
+ background: none;
38161
+ overflow: visible;
38162
+ pointer-events: none;
38163
+ }
38164
+
38165
+ :host .cm-nldd-popups .cm-tooltip {
38166
+ pointer-events: auto;
38167
+ }
38168
+
38169
+ :host .cm-tooltip.cm-tooltip-autocomplete,
38170
+ :host .cm-tooltip.cm-nldd-typeahead-empty {
38171
+ box-sizing: border-box;
38172
+ border: none;
38173
+ border-radius: var(--_text-editor-popup-corner-radius);
38174
+ box-shadow: var(--_text-editor-popup-box-shadow);
38175
+ background-color: var(--_text-editor-popup-background-color);
38176
+ }
38177
+
38178
+ /* The .cm-tooltip prefix matches CodeMirror's specificity, so these beat its
38179
+ monospace font and cramped rows. */
38180
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul {
38181
+ box-sizing: border-box;
38182
+ margin: 0;
38183
+ padding: var(--_text-editor-popup-padding);
38184
+ min-width: var(--_text-editor-popup-min-width);
38185
+ max-height: var(--_text-editor-popup-max-height);
38186
+ font-family: var(--_text-editor-popup-font-family);
38187
+ font-size: var(--_text-editor-popup-font-size);
38188
+ }
38189
+
38190
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li {
38191
+ box-sizing: border-box;
38192
+ display: flex;
38193
+ border-radius: var(--_text-editor-popup-row-corner-radius);
38194
+ min-height: var(--_text-editor-popup-row-min-height);
38195
+ padding: var(--_text-editor-popup-row-padding-block) var(--_text-editor-popup-row-padding-inline);
38196
+ align-items: center;
38197
+ gap: var(--_text-editor-popup-row-gap);
38198
+ color: var(--_text-editor-popup-row-content-color);
38199
+ cursor: default;
38200
+ }
38201
+
38202
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li > :is(nldd-avatar, nldd-icon, .cm-nldd-symbol) {
38203
+ flex: none;
38204
+ }
38205
+
38206
+ :host .cm-nldd-symbol {
38207
+ display: inline-flex;
38208
+ inline-size: var(--_text-editor-popup-symbol-size);
38209
+ justify-content: center;
38210
+ }
38211
+
38212
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar {
38213
+ display: grid;
38214
+ min-height: var(--_text-editor-popup-avatar-row-min-height);
38215
+ grid-template-columns: auto minmax(0, 1fr);
38216
+ align-content: center;
38217
+ row-gap: 0;
38218
+ }
38219
+
38220
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > nldd-avatar {
38221
+ grid-row: span 2;
38222
+ align-self: center;
38223
+ }
38224
+
38225
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > .cm-completionLabel {
38226
+ grid-column: 2;
38227
+ font: var(--_text-editor-popup-text-font);
38228
+ }
38229
+
38230
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li.cm-nldd-row-avatar > .cm-completionDetail {
38231
+ grid-column: 2;
38232
+ margin-left: 0;
38233
+ font: var(--_text-editor-popup-supporting-text-font);
38234
+ }
38235
+
38236
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] {
38237
+ background-color: var(--_text-editor-popup-row-is-highlighted-background-color);
38238
+ color: var(--_text-editor-popup-row-is-highlighted-content-color);
38239
+ }
38240
+
38241
+ /* CodeMirror keeps the keyboard choice selected under the pointer, so hover
38242
+ gets a quieter look and only on the other rows. */
38243
+ @media (hover: hover) {
38244
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li:not([aria-selected]):hover {
38245
+ background-color: var(--_text-editor-popup-row-is-hovered-background-color);
38246
+ color: var(--_text-editor-popup-row-is-hovered-content-color);
38247
+ }
38248
+ }
38249
+
38250
+ :host .cm-completionDetail {
38251
+ margin-left: auto;
38252
+ color: var(--_text-editor-popup-supporting-text-color);
38253
+ font-style: normal;
38254
+ }
38255
+
38256
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] .cm-completionDetail {
38257
+ color: inherit;
38258
+ }
38259
+
38260
+ :host .cm-nldd-typeahead-status {
38261
+ position: absolute;
38262
+ width: 1px;
38263
+ height: 1px;
38264
+ overflow: hidden;
38265
+ clip-path: inset(50%);
38266
+ white-space: nowrap;
38267
+ }
38268
+
38269
+ :host .cm-tooltip.cm-nldd-typeahead-empty {
38270
+ min-width: var(--_text-editor-popup-min-width);
38271
+ max-width: var(--_text-editor-popup-message-max-width);
38272
+ padding: var(--_text-editor-popup-message-padding-block) var(--_text-editor-popup-message-padding-inline);
38273
+ color: var(--_text-editor-popup-message-color);
38274
+ font-family: var(--_text-editor-popup-font-family);
38275
+ font-size: var(--_text-editor-popup-font-size);
38276
+ }
38277
+
38278
+
37069
38279
  /* # Annotation overlay
37070
38280
  A light body tint marks the annotated text; a solid badge (the nub) sits at
37071
38281
  the end carrying the count, the cue that does not rest on color. One role
@@ -37275,7 +38485,7 @@ var codeCopyLabels = Facet.define({ combine: (values) => values[0] ?? {
37275
38485
  success: () => "Gekopieerd",
37276
38486
  failure: () => "Kopiëren mislukt"
37277
38487
  } });
37278
- var FEEDBACK_MS = 2e3;
38488
+ var COPY_FEEDBACK_DURATION_MS = 2e3;
37279
38489
  function clipboardAvailable() {
37280
38490
  return typeof window !== "undefined" && window.isSecureContext && typeof navigator.clipboard?.writeText === "function";
37281
38491
  }
@@ -37341,7 +38551,7 @@ var CopyButton = class extends WidgetType {
37341
38551
  try {
37342
38552
  await navigator.clipboard.writeText(codeOf(view.state, view.state.doc.lineAt(view.posAtDOM(button)).from));
37343
38553
  setState(button, labels(), "success");
37344
- feedbackTimers.set(wrap, setTimeout(() => setState(button, labels(), "idle"), FEEDBACK_MS));
38554
+ feedbackTimers.set(wrap, setTimeout(() => setState(button, labels(), "idle"), COPY_FEEDBACK_DURATION_MS));
37345
38555
  } catch {
37346
38556
  setState(button, labels(), "failure");
37347
38557
  }
@@ -37470,13 +38680,13 @@ function codeCopy(labels) {
37470
38680
  * @attr {number} rows - Minimum visible rows (the floor in every resize mode). Default: 6.
37471
38681
  * @attr {string} resize - 'none' (fixed) | 'vertical' (drag) | 'auto' (grow, default)
37472
38682
  * @attr {string} appearance - 'simple' (default, bare) | 'input-field' (framed surface)
37473
- * @attr {string} syntax - 'visible' (default): every formatting mark stays in view, dimmed, a bullet as the character you typed (`-`, `*` or `+`). 'hidden': the marks of bold, italic, strikethrough, inline code, links and the `#` of a heading are hidden and come back where the caret or the selection touches that construct, so the text reads closer to the result while what you edit is still the markdown. A bullet reads as a dot, and shows its character on the line the caret is on. A quote reads as a line on the left; with the caret anywhere in it, its `>` marks show instead, in the same place. A `---` line reads as a divider until the caret is on it, and a code block loses its closing ``` line until the caret is in it, since its own tint and edge already say what it is. Its opening line stays as the head of the block, with only the backticks hidden: the language as a label on the left, the copy button on the right. The numbers of a numbered list stay, in the color of the text: they are content. Read-only and disabled hide every mark, which makes a clean read view. The value is plain markdown either way.
38683
+ * @attr {string} syntax - 'visible' (default): every formatting mark stays in view, dimmed, a bullet as the character you typed (`-`, `*` or `+`). 'hidden': the marks of bold, italic, strikethrough, inline code, links and the `#` of a heading are hidden and come back where the caret or the selection touches that construct, so the text reads closer to the result while what you edit is still the markdown. A bullet reads as a dot, and shows its character on the line the caret is on. A quote reads as a line on the left per level, at the level the result gives each line, as in nldd-rich-text, with the spaces after a `>` beyond the first hidden and a missing one made room for, so every level is the same step; with the caret anywhere in it, its `>` marks and spaces show instead. A `---` line reads as a divider until the caret is on it, and a code block loses its closing ``` line until the caret is in it, since its own tint and edge already say what it is. Its opening line stays as the head of the block, with only the backticks hidden: the language as a label on the left, the copy button on the right. The numbers of a numbered list stay, in the color of the text: they are content. Read-only and disabled hide every mark, which makes a clean read view. The value is plain markdown either way.
37474
38684
  * @attr {string} accessible-label - Accessible label forwarded to the editor. Set automatically by nldd-form-field.
37475
38685
  *
37476
38686
  * @prop {MentionSource} mentionSource - Consumer-supplied @-mention candidate source (property only). Without it, @-typeahead is inert.
37477
38687
  * @prop {string} mentionQuery - What may follow the `@` of a mention, as a regular expression source (property only). Default: letters with any accent, digits, `_`, `.`, `+` and `-`. Allow one space to search on a full name, as in `@sam jansen`.
37478
38688
  * @prop {Function} mentionEmptyText - What to say when the @-list has no candidates, called with the typed query (property only). Without it the list says "Typ om te zoeken" or "Niets gevonden", both translatable. Return null to close the list without a word.
37479
- * @prop {Typeahead[]} typeaheads - Your own typeahead lists next to the @-mention (property only): each a trigger character (`#`, `:`, `/`), a `source` that returns candidates for the text typed after it, an optional `query` (a regular expression for what may follow the trigger, such as a space in a full name), an optional `emptyText` (what to say when there are no candidates, instead of the translated default) and an optional `insert` that decides what a choice writes (by default the trigger, the text and a space). Lists on one trigger are merged in order. A candidate is `{ id, text, supportingText? }` and can carry an `avatar` (its row then takes two lines, the supporting text under the text), an `icon` or a `symbol` for its row.
38689
+ * @prop {Typeahead[]} typeaheads - Your own typeahead lists next to the @-mention (property only): each a trigger character (`#`, `:`, `/`), a `source` that returns candidates for the text typed after it, an optional `query` (a regular expression for what may follow the trigger, such as a space in a full name), an optional `emptyText` (what to say when there are no candidates, instead of the translated default) and an optional `insert` that decides what a choice writes (by default the trigger, the text and a space). Lists on one trigger are merged in order. A screen reader hears how many candidates there are when the list opens or changes length, and the empty text when there are none. A candidate is `{ id, text, supportingText? }` and can carry an `avatar` (its row then takes two lines, the supporting text under the text; `avatar.name` or `avatar.initials` set the initials when `text` is not the name), an `icon` or a `symbol` for its row.
37480
38690
  * @attr {boolean} annotatable - Enable the annotation overlay (off by default). Annotations only render when this is set.
37481
38691
  * @prop {Annotation[]} annotations - Consumer-supplied annotation overlay (property only). Anchored by offset and mapped through edits; the text stays clean. Requires `annotatable`. Assign a NEW array to apply changes (Lit dirty-checks by identity, so in-place mutation like `.push()` won't re-render): `editor.annotations = [...editor.annotations, next]`.
37482
38692
  * @attr {object} translations - Override the editor's assistive-tech strings (the open-in-new-tab link badge, the annotation count badge, the label of a task's box and the copy button of a code block). Unset keys fall back to Dutch.
@@ -37569,14 +38779,14 @@ var _NLDDTextEditor = class NLDDTextEditor extends NLDDCodeMirrorInput {
37569
38779
  "components.text-editor.annotation-plural-lowercase",
37570
38780
  "components.text-editor.task-open-label",
37571
38781
  "components.text-editor.task-done-label",
37572
- "components.text-editor.code-copy-action"
38782
+ "components.text-editor.copy-code-action"
37573
38783
  ].map((key) => this._t(key)).join("\n");
37574
38784
  }
37575
38785
  buildExtensions() {
37576
38786
  return [
37577
38787
  nlddCodeMirrorTheme,
37578
38788
  markdownEditing,
37579
- typeaheads(() => this._typeaheadLists(), (choice) => this._onTypeaheadChosen(choice), (query) => this._t(query ? "components.text-editor.typeahead-no-results-text" : "components.text-editor.typeahead-start-typing-text")),
38789
+ typeaheads(() => this._typeaheadLists(), (choice) => this._onTypeaheadChosen(choice), (query) => this._t(query ? "components.text-editor.typeahead-no-results-text" : "components.text-editor.typeahead-start-typing-text"), (count) => count === 1 ? this._t("components.text-editor.typeahead-one-result-text") : this._t("components.text-editor.typeahead-results-text", { count })),
37580
38790
  Prec.low(orderedListRenumber),
37581
38791
  annotations((count, quote) => this._t("components.text-editor.annotation-count-label", {
37582
38792
  count,
@@ -37585,7 +38795,7 @@ var _NLDDTextEditor = class NLDDTextEditor extends NLDDCodeMirrorInput {
37585
38795
  })),
37586
38796
  Prec.highest(linkOpenBadge((url) => this._t("components.text-editor.open-in-new-tab-label", { url }))),
37587
38797
  codeCopy({
37588
- copy: () => this._t("components.text-editor.code-copy-action"),
38798
+ copy: () => this._t("components.text-editor.copy-code-action"),
37589
38799
  success: () => this._t("components.text-editor.code-copy-success-text"),
37590
38800
  failure: () => this._t("components.text-editor.code-copy-failure-text")
37591
38801
  }),
@@ -38415,6 +39625,7 @@ var NLDDTextField = (_NLDDTextField = class NLDDTextField extends DescribedBy(Fo
38415
39625
  * `textFieldEl.focus()` without reaching into shadow DOM.
38416
39626
  */
38417
39627
  focus(options) {
39628
+ if (deferFocus(this, options)) return;
38418
39629
  this._input?.focus(options);
38419
39630
  }
38420
39631
  render() {
@@ -39454,6 +40665,7 @@ var NLDDTimePicker = (_NLDDTimePicker = class NLDDTimePicker extends DescribedBy
39454
40665
  * the arrow keys dead until the user tabbed into the selection themselves.
39455
40666
  */
39456
40667
  focus(options) {
40668
+ if (deferFocus(this, options)) return;
39457
40669
  const hour = this.shadowRoot?.querySelector(".time-picker__value");
39458
40670
  if (hour) hour.focus(options);
39459
40671
  else super.focus(options);
@@ -40833,6 +42045,7 @@ var _NLDDToggleButton = class NLDDToggleButton extends DescribedBy(FormAssociate
40833
42045
  * reaching into shadow DOM.
40834
42046
  */
40835
42047
  focus(options) {
42048
+ if (deferFocus(this, options)) return;
40836
42049
  if (this.type === "radio") {
40837
42050
  super.focus(options);
40838
42051
  return;
@@ -41134,6 +42347,7 @@ var _NLDDToggleButtonGroup = class NLDDToggleButtonGroup extends LitElement {
41134
42347
  * selected; focus goes to the first of them, in DOM order.
41135
42348
  */
41136
42349
  focus(options) {
42350
+ if (deferFocus(this, options)) return;
41137
42351
  const buttons = this._getEnabledButtons();
41138
42352
  (buttons.find((button) => button.selected) ?? buttons[0])?.focus(options);
41139
42353
  }
@@ -41439,7 +42653,7 @@ function renderToken(component, value, index) {
41439
42653
  control="menu"
41440
42654
  tabindex=${tabindex}
41441
42655
  ?roving=${!component.readonly}
41442
- menu-text=${`${component._t("components.token-field.token-menu-action")} "${label}"`}
42656
+ menu-text=${`${component._t("components.token-field.open-token-menu-action")} "${label}"`}
41443
42657
  ?disabled=${component.disabled}
41444
42658
  data-value=${value}
41445
42659
  @keydown=${(e) => component._handleTokenKeydown(e, index)}
@@ -41503,6 +42717,10 @@ function tokenFieldTemplate(component) {
41503
42717
  * in the field and the keystroke found nothing to show, the menu opens then.
41504
42718
  * After Escape, or once the user left the field, it stays shut.
41505
42719
  *
42720
+ * After typing, a screen reader hears how many options are shown ("2 resultaten"),
42721
+ * or the empty text when none are, also for options that a server sends in
42722
+ * later. Only the number it lands on: it waits until the options settle.
42723
+ *
41506
42724
  * @element nldd-token-field
41507
42725
  * @attr {string} values - Initial token values as a comma-separated string (e.g. "nl, be, de"). Not reflected; the live value is the `.values` array property. Values can't contain commas.
41508
42726
  * @attr {string} placeholder - Placeholder shown in the input
@@ -41703,6 +42921,7 @@ var NLDDTokenField = (_NLDDTokenField2 = class NLDDTokenField extends DescribedB
41703
42921
  /** Programmatic focus goes to the inner input, or — when it is hidden (all values
41704
42922
  * in, no custom, no options left) — to the token holding the roving tabindex. */
41705
42923
  focus(options) {
42924
+ if (deferFocus(this, options)) return;
41706
42925
  if (this._input) this._input.focus(options);
41707
42926
  else this._focusTokenAt(this._rovingIndex);
41708
42927
  }
@@ -41805,6 +43024,7 @@ var NLDDTokenField = (_NLDDTokenField2 = class NLDDTokenField extends DescribedB
41805
43024
  this._syncMenuItems();
41806
43025
  if (!this._isOpen) this._openMenu();
41807
43026
  this._openPending = this._text !== "" && !this._menu?.matches(":popover-open");
43027
+ this._menu?._announceResults();
41808
43028
  this.dispatchEvent(new CustomEvent("input", {
41809
43029
  detail: { value: this._text },
41810
43030
  bubbles: true,
@@ -42088,11 +43308,13 @@ var NLDDTokenField = (_NLDDTokenField2 = class NLDDTokenField extends DescribedB
42088
43308
  if (!this._menu || this.shadowRoot?.activeElement !== this._input) return;
42089
43309
  if (this._menu.matches(":popover-open")) {
42090
43310
  if (this._visibleOptionCount === 0) this._closeMenu();
43311
+ else this._menu._announceResults();
42091
43312
  return;
42092
43313
  }
42093
43314
  if (this._openPending && this._visibleOptionCount > 0) {
42094
43315
  this._openPending = false;
42095
43316
  this._openMenu();
43317
+ this._menu._announceResults();
42096
43318
  }
42097
43319
  }
42098
43320
  _closeMenu() {
@@ -42235,12 +43457,14 @@ var sliderStyles = css`
42235
43457
  --_slider-thumb-is-hovered-border-color: light-dark(var(--primitives-color-neutral-650), var(--primitives-color-neutral-750));
42236
43458
  --_slider-thumb-is-active-border-color: light-dark(var(--primitives-color-neutral-750), var(--primitives-color-neutral-850));
42237
43459
  --_slider-histogram-height: var(--primitives-space-48);
43460
+ --_slider-histogram-track-gap: var(--primitives-space-2);
42238
43461
  --_slider-histogram-gap: var(--primitives-space-1);
42239
43462
  --_slider-histogram-color: light-dark(var(--primitives-color-neutral-150), var(--primitives-color-neutral-300));
42240
- --_slider-histogram-selected-color: color-mix(in oklab, var(--_slider-fill-color) 40%, transparent);
43463
+ --_slider-histogram-selected-color: var(--_slider-fill-color);
42241
43464
  --_slider-histogram-bar-corner-radius: var(--primitives-space-2);
42242
43465
  --_slider-histogram-bar-height: 0;
42243
43466
  --_slider-tooltip-offset: var(--primitives-space-8);
43467
+ --_slider-tooltip-touch-offset: var(--primitives-space-32);
42244
43468
  --_slider-tooltip-shift: 0px;
42245
43469
  --_slider-tooltip-background-color: var(--semantics-tooltips-background-color);
42246
43470
  --_slider-tooltip-content-color: var(--semantics-tooltips-content-color);
@@ -42346,16 +43570,16 @@ var sliderStyles = css`
42346
43570
  /* # Histogram */
42347
43571
 
42348
43572
  .slider__control.has-histogram {
42349
- margin-top: calc(var(--_slider-histogram-height) - (var(--_slider-control-height) - var(--_slider-track-height)) / 2);
43573
+ margin-top: calc(var(--_slider-histogram-height) + var(--_slider-histogram-track-gap) - (var(--_slider-control-height) - var(--_slider-track-height)) / 2);
42350
43574
  }
42351
43575
 
42352
43576
  .slider__histogram {
42353
43577
  display: flex;
42354
43578
  position: absolute;
42355
- bottom: 50%;
42356
- inset-inline: 0;
43579
+ bottom: calc(50% + var(--_slider-track-height) / 2 + var(--_slider-histogram-track-gap));
43580
+ inset-inline: calc(var(--_slider-thumb-size) / 2);
42357
43581
  pointer-events: none;
42358
- height: calc(var(--_slider-histogram-height) + var(--_slider-track-height) / 2);
43582
+ height: var(--_slider-histogram-height);
42359
43583
  gap: var(--_slider-histogram-gap);
42360
43584
  align-items: flex-end;
42361
43585
  }
@@ -42364,7 +43588,7 @@ var sliderStyles = css`
42364
43588
  border-start-start-radius: var(--_slider-histogram-bar-corner-radius);
42365
43589
  border-start-end-radius: var(--_slider-histogram-bar-corner-radius);
42366
43590
  background-color: var(--_slider-histogram-color);
42367
- height: calc(var(--_slider-track-height) / 2 + var(--_slider-histogram-bar-height) * var(--_slider-histogram-height));
43591
+ height: calc(var(--_slider-histogram-bar-height) * var(--_slider-histogram-height));
42368
43592
  flex-grow: 1;
42369
43593
  flex-shrink: 1;
42370
43594
  flex-basis: 0;
@@ -42500,7 +43724,6 @@ var sliderStyles = css`
42500
43724
  box-sizing: border-box;
42501
43725
  position: absolute;
42502
43726
  z-index: 3;
42503
- bottom: calc(100% + var(--_slider-tooltip-offset));
42504
43727
  inset-inline-start: calc(var(--_slider-thumb-size) / 2 + (100% - var(--_slider-thumb-size)) * var(--_slider-end));
42505
43728
  visibility: hidden;
42506
43729
  opacity: 0;
@@ -42516,6 +43739,14 @@ var sliderStyles = css`
42516
43739
  white-space: nowrap;
42517
43740
  transition: opacity var(--_slider-tooltip-transition-duration), visibility var(--_slider-tooltip-transition-duration);
42518
43741
  transform: translateX(calc(-50% + var(--_slider-tooltip-shift)));
43742
+
43743
+ @media not (pointer: coarse) {
43744
+ bottom: calc(50% + var(--_slider-thumb-size) / 2 + var(--_slider-tooltip-offset));
43745
+ }
43746
+
43747
+ @media (pointer: coarse) {
43748
+ bottom: calc(50% + var(--_slider-tooltip-touch-offset));
43749
+ }
42519
43750
  }
42520
43751
 
42521
43752
  :host(:dir(rtl)) .slider__tooltip {
@@ -42523,7 +43754,7 @@ var sliderStyles = css`
42523
43754
  }
42524
43755
 
42525
43756
  .slider__control.has-histogram .slider__tooltip {
42526
- bottom: calc(50% + var(--_slider-track-height) / 2 + var(--_slider-histogram-height) + var(--_slider-tooltip-offset));
43757
+ bottom: calc(50% + var(--_slider-track-height) / 2 + var(--_slider-histogram-track-gap) + var(--_slider-histogram-height) + var(--_slider-tooltip-offset));
42527
43758
  }
42528
43759
 
42529
43760
  .slider__tooltip--start {
@@ -42534,11 +43765,11 @@ var sliderStyles = css`
42534
43765
  inset-inline-start: calc(var(--_slider-thumb-size) / 2 + (100% - var(--_slider-thumb-size)) * (var(--_slider-start) + var(--_slider-end)) / 2);
42535
43766
  }
42536
43767
 
42537
- /* Shown while the pointer is over the slider, a thumb has keyboard focus or
42538
- is dragged: each thumb its own, or the two of a range as one where they
42539
- would overlap. */
42540
- .slider:not(.is-merged) .slider__control:is(:hover, .is-active, :has(.slider__input:focus-visible)) :is(.slider__tooltip--value, .slider__tooltip--start, .slider__tooltip--end),
42541
- .slider.is-merged .slider__control:is(:hover, .is-active, :has(.slider__input:focus-visible)) .slider__tooltip--both {
43768
+ /* Shown while the pointer is over the slider or its icons, a thumb has
43769
+ keyboard focus or is pressed: each thumb its own, or the two of a range as
43770
+ one where they would overlap. */
43771
+ .slider:not(.is-merged):is(:hover, :has(.slider__control.is-active, .slider__input:focus-visible)) :is(.slider__tooltip--value, .slider__tooltip--start, .slider__tooltip--end),
43772
+ .slider.is-merged:is(:hover, :has(.slider__control.is-active, .slider__input:focus-visible)) .slider__tooltip--both {
42542
43773
  visibility: visible;
42543
43774
  opacity: 1;
42544
43775
  }
@@ -42576,6 +43807,7 @@ function thumbInput(component, thumb, value) {
42576
43807
  aria-invalid=${component.invalid ? "true" : nothing}
42577
43808
  ?disabled=${component.disabled}
42578
43809
  @input=${(event) => component._handleInput(event, thumb)}
43810
+ @keydown=${(event) => component._handleKeyDown(event, thumb)}
42579
43811
  @change=${component._handleChange}
42580
43812
  >
42581
43813
  `;
@@ -42621,9 +43853,13 @@ function sliderTemplate(component) {
42621
43853
  const startOnTop = range && start === end && start > (component.min + component.max) / 2;
42622
43854
  const tooltips = component.tooltipTiming !== "never";
42623
43855
  return html`
42624
- <div class="slider">
43856
+ <div class="slider"
43857
+ @pointerdown=${component._handlePointerDown}
43858
+ >
42625
43859
  ${component.startIcon ? html`
42626
- <span class="slider__start-icon">
43860
+ <span class="slider__start-icon"
43861
+ @click=${range ? nothing : () => component._handleIconClick(-1)}
43862
+ >
42627
43863
  <nldd-icon icon=${component.startIcon}></nldd-icon>
42628
43864
  </span>
42629
43865
  ` : nothing}
@@ -42638,7 +43874,6 @@ function sliderTemplate(component) {
42638
43874
  "--_slider-start": String(component._fraction(start)),
42639
43875
  "--_slider-end": String(component._fraction(end))
42640
43876
  })}
42641
- @pointerdown=${component._handlePointerDown}
42642
43877
  >
42643
43878
  ${component.histogram.length ? histogram(component, start, end) : nothing}
42644
43879
  <span class="slider__track"></span>
@@ -42657,7 +43892,9 @@ function sliderTemplate(component) {
42657
43892
  `}
42658
43893
  </div>
42659
43894
  ${component.endIcon ? html`
42660
- <span class="slider__end-icon">
43895
+ <span class="slider__end-icon"
43896
+ @click=${range ? nothing : () => component._handleIconClick(1)}
43897
+ >
42661
43898
  <nldd-icon icon=${component.endIcon}></nldd-icon>
42662
43899
  </span>
42663
43900
  ` : nothing}
@@ -42686,13 +43923,13 @@ function sliderTemplate(component) {
42686
43923
  * on one value, the first move picks one, to the left the start one.
42687
43924
  *
42688
43925
  * The value shows in a tooltip above the thumb while the pointer is over the
42689
- * slider, while a thumb has keyboard focus and while it is dragged; with
42690
- * `tooltip-timing="never"` it does not, for a slider whose value already shows
42691
- * elsewhere. Where the
42692
- * two tooltips of a range would overlap, they show as one ("200 – 1.200").
42693
- * `formatValue` turns a number into the text of the tooltip and of what a
42694
- * screen reader hears, such as `(value) => \`€ ${value}\``; without it the
42695
- * number is written the Dutch way.
43926
+ * slider or its icons, while a thumb has keyboard focus and while it or an icon
43927
+ * is pressed; with `tooltip-timing="never"` it does not, for a slider whose
43928
+ * value already shows elsewhere. Where the two tooltips of a range would
43929
+ * overlap, they show as one ("200 – 1.200"). `formatValue` turns a number into
43930
+ * the text of the tooltip and of what a screen reader hears, such as
43931
+ * `(value) => \`€ ${value}\``; without it the number is written in the
43932
+ * language of the page (`lang`), and in Dutch where none is set.
42696
43933
  *
42697
43934
  * `histogram` draws counts as bars above the track, such as how many results
42698
43935
  * there are at each price, so the range can be chosen with the spread in view.
@@ -42703,6 +43940,13 @@ function sliderTemplate(component) {
42703
43940
  * within the chosen value or range is colored. The bars are decoration for a
42704
43941
  * screen reader: say what they show in the text around it.
42705
43942
  *
43943
+ * A larger step than the arrow keys take is a tenth of the range, and at least
43944
+ * one `step`: what Page Up and Page Down do, what Shift with an arrow key does
43945
+ * (a Mac keyboard has no Page Up), and what a click on `start-icon` or
43946
+ * `end-icon` does. The icons stay out of the tab order and out of the
43947
+ * accessibility tree, because the keyboard already has those keys. In a range
43948
+ * they only explain the ends, since a click could not say which thumb to move.
43949
+ *
42706
43950
  * In a form a slider submits its value under `name`; a range submits both ends
42707
43951
  * under it, the start first.
42708
43952
  *
@@ -42710,8 +43954,8 @@ function sliderTemplate(component) {
42710
43954
  * @attr {string} size - Slider size: 'xs' | 'sm' | 'md' (default: 'md'), with the height of the other controls of that size. Set automatically by nldd-form-field.
42711
43955
  * @attr {boolean} range - Picks a range, with a thumb for each end: `start-value` and `end-value` in place of `value`
42712
43956
  * @attr {string} histogram - Counts drawn as bars above the track, one per bucket of (max - min) / n, comma- or space-separated; as a property, an array of numbers. The bars within the chosen value or range are colored.
42713
- * @attr {string} start-icon - Icon at the start of the track, such as a quiet speaker for a volume
42714
- * @attr {string} end-icon - Icon at the end of the track
43957
+ * @attr {string} start-icon - Icon at the start of the track, such as a quiet speaker for a volume. A click on it moves the value a tenth of the range down (not in a range).
43958
+ * @attr {string} end-icon - Icon at the end of the track. A click on it moves the value a tenth of the range up (not in a range).
42715
43959
  * @attr {string} accessible-label - Accessible name; a range adds "minimum" and "maximum" to it for its thumbs. Set automatically by nldd-form-field.
42716
43960
  * @attr {string} tooltip-timing - When the value shows above the thumb: 'instant' (the default: on hover, keyboard focus and while dragging) or 'never', for a slider whose value shows elsewhere, such as in fields above it
42717
43961
  * @attr {boolean} invalid - Marks the control as invalid. Announced with aria-invalid; nothing is drawn for it.
@@ -42731,7 +43975,25 @@ function sliderTemplate(component) {
42731
43975
  * @fires change - When a thumb is let go, or a key moved it; detail as for input
42732
43976
  */
42733
43977
  var _NLDDSlider;
42734
- var NUMBER = new Intl.NumberFormat("nl-NL", { maximumFractionDigits: 6 });
43978
+ /** A number written the way of a language, one formatter per language. */
43979
+ var formats = /* @__PURE__ */ new Map();
43980
+ function numberFormat(lang) {
43981
+ let format = formats.get(lang);
43982
+ if (!format) {
43983
+ try {
43984
+ format = new Intl.NumberFormat(lang, { maximumFractionDigits: 6 });
43985
+ } catch {
43986
+ format = new Intl.NumberFormat("nl-NL", { maximumFractionDigits: 6 });
43987
+ }
43988
+ formats.set(lang, format);
43989
+ }
43990
+ return format;
43991
+ }
43992
+ /** The decimals of a number, also written with an exponent ("1e-7"). */
43993
+ function decimalsOf(number) {
43994
+ const [digits, exponent] = String(number).split("e");
43995
+ return Math.max(0, (digits.split(".")[1] ?? "").length - Number(exponent ?? 0));
43996
+ }
42735
43997
  var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssociated(LitElement)) {
42736
43998
  constructor(..._args) {
42737
43999
  super(..._args);
@@ -42763,7 +44025,8 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42763
44025
  this._active = true;
42764
44026
  window.addEventListener("pointerup", this._handlePointerUp, { once: true });
42765
44027
  window.addEventListener("pointercancel", this._handlePointerUp, { once: true });
42766
- if (!this.range || event.target.matches(".slider__input")) return;
44028
+ const target = event.target;
44029
+ if (!this.range || !target.closest(".slider__control") || target.matches(".slider__input")) return;
42767
44030
  window.addEventListener("pointermove", this._handleTrackMove);
42768
44031
  event.preventDefault();
42769
44032
  if (this._start === this._end && this._onThumb(event.clientX)) {
@@ -42798,7 +44061,7 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42798
44061
  this._layoutTooltips = () => {
42799
44062
  const root = this.shadowRoot;
42800
44063
  const slider = root?.querySelector(".slider");
42801
- if (!root || !slider) return;
44064
+ if (!root || !slider || this.tooltipTiming === "never") return;
42802
44065
  const tooltips = Array.from(root.querySelectorAll(".slider__tooltip"));
42803
44066
  for (const tooltip of tooltips) tooltip.style.removeProperty("--_slider-tooltip-shift");
42804
44067
  if (this.range && tooltips.length) {
@@ -42839,7 +44102,7 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42839
44102
  }
42840
44103
  /** @internal A value as the tooltip and a screen reader say it. */
42841
44104
  _format(value) {
42842
- return this.formatValue ? this.formatValue(value) : NUMBER.format(value);
44105
+ return this.formatValue ? this.formatValue(value) : numberFormat(langOf(this) ?? "nl-NL").format(value);
42843
44106
  }
42844
44107
  /** @internal The name of a thumb for a screen reader. */
42845
44108
  _label(thumb) {
@@ -42851,7 +44114,7 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42851
44114
  _snap(value) {
42852
44115
  const step = this.step > 0 ? this.step : 1;
42853
44116
  const snapped = this.min + Math.round((value - this.min) / step) * step;
42854
- const decimals = (String(step).split(".")[1] ?? "").length;
44117
+ const decimals = Math.max(decimalsOf(step), decimalsOf(this.min));
42855
44118
  return Math.max(this.min, Math.min(this.max, Number(snapped.toFixed(decimals))));
42856
44119
  }
42857
44120
  connectedCallback() {
@@ -42881,10 +44144,16 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42881
44144
  data.append(this.name, String(this._end));
42882
44145
  return data;
42883
44146
  }
44147
+ /** Back to the values in the attributes, as a native input resets to its
44148
+ * `value` attribute, or else to what it had when it was first connected. */
42884
44149
  formResetCallback() {
42885
- this.value = this._initial.value;
42886
- this.startValue = this._initial.startValue;
42887
- this.endValue = this._initial.endValue;
44150
+ const attribute = (name) => {
44151
+ const value = parseFloat(this.getAttribute(name) ?? "");
44152
+ return Number.isFinite(value) ? value : void 0;
44153
+ };
44154
+ this.value = attribute("value") ?? this._initial.value;
44155
+ this.startValue = attribute("start-value") ?? this._initial.startValue;
44156
+ this.endValue = attribute("end-value") ?? this._initial.endValue;
42888
44157
  }
42889
44158
  formStateRestoreCallback(state) {
42890
44159
  const number = (entry) => {
@@ -42904,6 +44173,7 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42904
44173
  }
42905
44174
  /** Moves focus to the thumb (the start one of a range). */
42906
44175
  focus(options) {
44176
+ if (deferFocus(this, options)) return;
42907
44177
  this._inputs?.[0]?.focus(options);
42908
44178
  }
42909
44179
  describedTarget() {
@@ -42920,6 +44190,40 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42920
44190
  event.stopPropagation();
42921
44191
  this._emit("change");
42922
44192
  }
44193
+ /** Moves the value a tenth of the range, at least one step, down (-1) or up (1).
44194
+ * @internal */
44195
+ _handleIconClick(direction) {
44196
+ if (this.disabled) return;
44197
+ this._page("value", direction);
44198
+ }
44199
+ /** Shift with an arrow key takes the larger step; the native input only
44200
+ * takes one step for it.
44201
+ * @internal */
44202
+ _handleKeyDown(event, thumb) {
44203
+ if (!event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
44204
+ const rtl = getComputedStyle(this).direction === "rtl";
44205
+ const direction = {
44206
+ ArrowUp: 1,
44207
+ ArrowDown: -1,
44208
+ ArrowRight: rtl ? -1 : 1,
44209
+ ArrowLeft: rtl ? 1 : -1
44210
+ }[event.key];
44211
+ if (!direction) return;
44212
+ event.preventDefault();
44213
+ this._page(thumb, direction);
44214
+ }
44215
+ /** Moves a thumb a tenth of the range, at least one step, the jump the
44216
+ * native input takes on Page Up and Page Down. */
44217
+ _page(thumb, direction) {
44218
+ const page = Math.max(this.step > 0 ? this.step : 1, (this.max - this.min) / 10);
44219
+ const current = () => thumb === "value" ? this._value : thumb === "start" ? this._start : this._end;
44220
+ const before = current();
44221
+ const input = this.shadowRoot?.querySelector(`.slider__input--${thumb}`) ?? void 0;
44222
+ this._set(thumb, before + direction * page, input);
44223
+ if (current() === before) return;
44224
+ this._emit("input");
44225
+ this._emit("change");
44226
+ }
42923
44227
  /** Makes a thumb the one a press drags, and gives it focus. */
42924
44228
  _grab(thumb) {
42925
44229
  this._trackThumb = thumb;
@@ -42933,25 +44237,32 @@ var NLDDSlider = (_NLDDSlider = class NLDDSlider extends DescribedBy(FormAssocia
42933
44237
  this._trackThumb = null;
42934
44238
  this._stackedPress = null;
42935
44239
  }
42936
- /** The value under a point of the track, the way the native thumb places it. */
42937
- _valueAt(x) {
42938
- const control = this.shadowRoot.querySelector(".slider__control");
42939
- const rect = control.getBoundingClientRect();
42940
- const thumb = parseFloat(getComputedStyle(control).getPropertyValue("--_slider-thumb-size")) || 0;
42941
- let fraction = (x - rect.left - thumb / 2) / Math.max(1, rect.width - thumb);
42942
- if (getComputedStyle(this).direction === "rtl") fraction = 1 - fraction;
42943
- return this._snap(this.min + Math.max(0, Math.min(1, fraction)) * (this.max - this.min));
42944
- }
42945
- /** Whether a point lies on the pressable area of the stacked thumbs. */
42946
- _onThumb(x) {
44240
+ /** Where the middle of the native thumb runs: from `start` over `length`
44241
+ * pixels, in the direction of the text, and how wide it takes a press. */
44242
+ _thumbPath() {
42947
44243
  const control = this.shadowRoot.querySelector(".slider__control");
42948
44244
  const rect = control.getBoundingClientRect();
42949
44245
  const style = getComputedStyle(control);
42950
44246
  const thumb = parseFloat(style.getPropertyValue("--_slider-thumb-size")) || 0;
42951
44247
  const hit = parseFloat(style.getPropertyValue("--_slider-thumb-hit-size")) || thumb;
42952
- let fraction = this._fraction(this._start);
42953
- if (getComputedStyle(this).direction === "rtl") fraction = 1 - fraction;
42954
- return Math.abs(x - (rect.left + thumb / 2 + (rect.width - thumb) * fraction)) <= hit / 2;
44248
+ return {
44249
+ start: rect.left + thumb / 2,
44250
+ length: Math.max(1, rect.width - thumb),
44251
+ rtl: getComputedStyle(this).direction === "rtl",
44252
+ hit
44253
+ };
44254
+ }
44255
+ /** The value under a point of the track, the way the native thumb places it. */
44256
+ _valueAt(x) {
44257
+ const { start, length, rtl } = this._thumbPath();
44258
+ const fraction = Math.max(0, Math.min(1, (x - start) / length));
44259
+ return this._snap(this.min + (rtl ? 1 - fraction : fraction) * (this.max - this.min));
44260
+ }
44261
+ /** Whether a point lies on the pressable area of the stacked thumbs. */
44262
+ _onThumb(x) {
44263
+ const { start, length, rtl, hit } = this._thumbPath();
44264
+ const fraction = this._fraction(this._start);
44265
+ return Math.abs(x - (start + length * (rtl ? 1 - fraction : fraction))) <= hit / 2;
42955
44266
  }
42956
44267
  /** Sets a thumb, keeps the thumbs of a range from passing each other, and
42957
44268
  * puts the native input back where the value landed. */
@@ -49049,8 +50360,8 @@ function collectionTemplate(component) {
49049
50360
  return html`
49050
50361
  <div class="collection__scroll-area">
49051
50362
  <div class="collection__items"
50363
+ role="list"
49052
50364
  tabindex=${ifDefined(scrollable ? "0" : void 0)}
49053
- role=${ifDefined(scrollable ? "region" : void 0)}
49054
50365
  aria-label=${ifDefined(scrollable ? component._t("components.collection.region-label") : void 0)}
49055
50366
  >
49056
50367
  <slot @slotchange=${(e) => component._onSlotChange(e)}></slot>
@@ -49094,6 +50405,25 @@ function collectionTemplate(component) {
49094
50405
  </footer>
49095
50406
  `;
49096
50407
  }
50408
+ // src/utilities/list-items.ts
50409
+ /** Elements whose own role a list item would hide. A custom element or a
50410
+ * plain div or span has none worth keeping. */
50411
+ var OWN_ROLE = /^(a|article|aside|button|details|dialog|fieldset|figure|footer|form|h[1-6]|header|hr|img|input|li|main|nav|ol|section|select|table|textarea|ul)$/;
50412
+ /**
50413
+ * Gives slotted children `role="listitem"`, for a component that renders the
50414
+ * `role="list"` around its slot.
50415
+ *
50416
+ * A child with a role of its own, written or implied by its element, keeps it:
50417
+ * a consumer's `<article>` stays an article. An nldd-card carries its article
50418
+ * inside its shadow root, so its host has room for the list item.
50419
+ */
50420
+ function markListItems(elements) {
50421
+ for (const el of elements) {
50422
+ if (el.hasAttribute("role") && el.getAttribute("role") !== "listitem") continue;
50423
+ if (OWN_ROLE.test(el.localName)) continue;
50424
+ el.setAttribute("role", "listitem");
50425
+ }
50426
+ }
49097
50427
  // src/components/layout/collection/collection.ts
49098
50428
  /**
49099
50429
  * Nederlandse Digitale Dienst Collection Component (Lit + TypeScript)
@@ -49178,6 +50508,24 @@ var _NLDDCollection = class NLDDCollection extends LitElement {
49178
50508
  if (!wasAtEnd && this._atEnd) this._handOffControlFocus("next");
49179
50509
  };
49180
50510
  this._scrollListenerAttached = false;
50511
+ this._onFocusIn = (event) => {
50512
+ const el = this._itemsEl;
50513
+ if (this.layout !== "horizontal-scroll" || !el) return;
50514
+ const target = event.target;
50515
+ const items = this._itemStarts();
50516
+ const focused = items.find(({ item }) => item === target || item.contains(target));
50517
+ if (!focused) return;
50518
+ const inset = parseFloat(getComputedStyle(el).scrollPaddingInlineStart) || 0;
50519
+ const width = el.clientWidth - inset * 2;
50520
+ const current = el.scrollLeft;
50521
+ let left;
50522
+ if (focused.start < current - 1) left = focused.start;
50523
+ else if (focused.end > current + inset + width + 1) left = items.map(({ start }) => start).find((start) => start > current && focused.end <= start + inset + width + 1) ?? focused.start;
50524
+ if (left !== void 0) el.scrollTo({
50525
+ left,
50526
+ behavior: "smooth"
50527
+ });
50528
+ };
49181
50529
  }
49182
50530
  _t(key) {
49183
50531
  return translate(this.translations, nlddCollectionTranslations, key);
@@ -49196,9 +50544,11 @@ var _NLDDCollection = class NLDDCollection extends LitElement {
49196
50544
  connectedCallback() {
49197
50545
  super.connectedCallback();
49198
50546
  this._visibleCount = this.maxItems;
50547
+ this.addEventListener("focusin", this._onFocusIn);
49199
50548
  }
49200
50549
  disconnectedCallback() {
49201
50550
  super.disconnectedCallback();
50551
+ this.removeEventListener("focusin", this._onFocusIn);
49202
50552
  this._intersectionObserver?.disconnect();
49203
50553
  this._teardownScrollListeners();
49204
50554
  }
@@ -49253,6 +50603,7 @@ var _NLDDCollection = class NLDDCollection extends LitElement {
49253
50603
  }
49254
50604
  _onSlotChange(e) {
49255
50605
  const items = e.target.assignedElements();
50606
+ markListItems(items);
49256
50607
  queueMicrotask(() => {
49257
50608
  this._totalCount = items.length;
49258
50609
  });
@@ -49279,11 +50630,8 @@ var _NLDDCollection = class NLDDCollection extends LitElement {
49279
50630
  _scrollBy(direction) {
49280
50631
  const el = this._itemsEl;
49281
50632
  if (!el) return;
49282
- const items = el.querySelector("slot")?.assignedElements() ?? [];
49283
- if (items.length === 0) return;
49284
- const scrollerLeft = el.getBoundingClientRect().left;
49285
- const inset = parseFloat(getComputedStyle(el).scrollPaddingInlineStart) || 0;
49286
- const starts = items.map((item) => Math.round(item.getBoundingClientRect().left - scrollerLeft + el.scrollLeft - inset));
50633
+ const starts = this._itemStarts().map(({ start }) => start);
50634
+ if (starts.length === 0) return;
49287
50635
  const epsilon = 2;
49288
50636
  const current = el.scrollLeft;
49289
50637
  const target = direction === 1 ? starts.find((start) => start > current + epsilon) : starts.filter((start) => start < current - epsilon).pop();
@@ -49293,6 +50641,23 @@ var _NLDDCollection = class NLDDCollection extends LitElement {
49293
50641
  behavior: "smooth"
49294
50642
  });
49295
50643
  }
50644
+ /** Each item with the scroll position that parks it at the padded start,
50645
+ * where scroll-snap parks it, and its end in scroll coordinates. */
50646
+ _itemStarts() {
50647
+ const el = this._itemsEl;
50648
+ const items = (el?.querySelector("slot"))?.assignedElements() ?? [];
50649
+ if (!el || items.length === 0) return [];
50650
+ const scrollerLeft = el.getBoundingClientRect().left;
50651
+ const inset = parseFloat(getComputedStyle(el).scrollPaddingInlineStart) || 0;
50652
+ return items.map((item) => {
50653
+ const rect = item.getBoundingClientRect();
50654
+ return {
50655
+ item,
50656
+ start: Math.round(rect.left - scrollerLeft + el.scrollLeft - inset),
50657
+ end: Math.round(rect.right - scrollerLeft + el.scrollLeft)
50658
+ };
50659
+ });
50660
+ }
49296
50661
  render() {
49297
50662
  return collectionTemplate(this);
49298
50663
  }
@@ -49818,7 +51183,11 @@ var pageFooterStyles = css`
49818
51183
  margin-top: var(--_page-footer-ribbon-height);
49819
51184
  }
49820
51185
 
49821
- .page-footer::after {
51186
+ :host([no-ribbon]) .page-footer {
51187
+ --_page-footer-ribbon-height: 0px;
51188
+ }
51189
+
51190
+ :host(:not([no-ribbon])) .page-footer::after {
49822
51191
  content: '';
49823
51192
  position: absolute;
49824
51193
  bottom: 0;
@@ -49830,7 +51199,7 @@ var pageFooterStyles = css`
49830
51199
  }
49831
51200
 
49832
51201
  @media (forced-colors: active) {
49833
- .page-footer::after {
51202
+ :host(:not([no-ribbon])) .page-footer::after {
49834
51203
  background-color: ButtonText;
49835
51204
  }
49836
51205
  }
@@ -49845,36 +51214,46 @@ var pageFooterStyles = css`
49845
51214
  .page-footer__breadcrumbs,
49846
51215
  .page-footer__legal-bar {
49847
51216
  @container (max-width: ${smMax$3}) {
49848
- padding-block: var(--primitives-space-16);
51217
+ --_page-footer-section-padding-block: var(--primitives-space-16);
49849
51218
  }
49850
51219
 
49851
51220
  @container (min-width: ${mdMin$2}) and (max-width: ${mdMax$1}) {
49852
- padding-block: var(--primitives-space-24);
51221
+ --_page-footer-section-padding-block: var(--primitives-space-24);
49853
51222
  }
49854
51223
 
49855
51224
  @container (min-width: ${lgMin$1}) {
49856
- padding-block: var(--primitives-space-24);
51225
+ --_page-footer-section-padding-block: var(--primitives-space-24);
49857
51226
  }
49858
51227
  }
49859
51228
 
49860
51229
  .page-footer__main {
49861
51230
  @container (max-width: ${smMax$3}) {
49862
- padding-block: var(--primitives-space-24);
51231
+ --_page-footer-section-padding-block: var(--primitives-space-24);
49863
51232
  }
49864
51233
 
49865
51234
  @container (min-width: ${mdMin$2}) and (max-width: ${mdMax$1}) {
49866
- padding-block: var(--primitives-space-32);
51235
+ --_page-footer-section-padding-block: var(--primitives-space-32);
49867
51236
  }
49868
51237
 
49869
51238
  @container (min-width: ${lgMin$1}) {
49870
- padding-block: var(--primitives-space-48);
51239
+ --_page-footer-section-padding-block: var(--primitives-space-48);
49871
51240
  }
49872
51241
  }
49873
51242
 
51243
+ .page-footer__breadcrumbs,
51244
+ .page-footer__main,
51245
+ .page-footer__legal-bar {
51246
+ padding-block: var(--_page-footer-section-padding-block);
51247
+ }
51248
+
49874
51249
  .page-footer__body > div:not([hidden]):not(:has(~ div:not([hidden]))) {
49875
51250
  padding-bottom: calc(var(--primitives-space-16) + var(--_page-footer-ribbon-height));
49876
51251
  }
49877
51252
 
51253
+ :host([no-ribbon]:not([single-slot])) .page-footer__body > div:not([hidden]):not(:has(~ div:not([hidden]))) {
51254
+ padding-bottom: var(--_page-footer-section-padding-block);
51255
+ }
51256
+
49878
51257
  :host([single-slot]) .page-footer__body > div:not([hidden]) {
49879
51258
  padding-top: calc(var(--primitives-space-16) + var(--_page-footer-ribbon-height));
49880
51259
  }
@@ -50020,6 +51399,7 @@ function pageFooterLegalBarTemplate(component) {
50020
51399
  ?hidden=${!component._hasStart && !component._hasEnd}
50021
51400
  >
50022
51401
  <div class="page-footer__legal-bar-start"
51402
+ role="list"
50023
51403
  ?hidden=${!component._hasStart}
50024
51404
  >
50025
51405
  <slot
@@ -50028,6 +51408,7 @@ function pageFooterLegalBarTemplate(component) {
50028
51408
  ></slot>
50029
51409
  </div>
50030
51410
  <div class="page-footer__legal-bar-end"
51411
+ role="list"
50031
51412
  ?hidden=${!component._hasEnd}
50032
51413
  >
50033
51414
  <slot
@@ -50067,6 +51448,7 @@ function pageFooterLegalBarItemTemplate(component) {
50067
51448
  *
50068
51449
  * @element nldd-page-footer
50069
51450
  *
51451
+ * @attr {boolean} no-ribbon - Leaves out the ribbon under the footer, and the room it takes, as `no-logo` does on nldd-top-navigation-bar. The ribbon belongs to the house style of the Rijksoverheid, so a site outside it, or one anyone may run, turns it off. An empty footer then takes no height at all.
50070
51452
  * @attr {string} [width] - Body max-width, mirroring a page section: 'full' removes the constraint so the content spans the full width; any CSS length (e.g. '480px') overrides the default max-width.
50071
51453
  *
50072
51454
  * @slot breadcrumbs - `nldd-breadcrumbs` for the top row.
@@ -50131,6 +51513,7 @@ var NLDDPageFooterLegalBar = class extends LitElement {
50131
51513
  this._hasEnd = false;
50132
51514
  this._onSlotChange = (e) => {
50133
51515
  const slot = e.target;
51516
+ markListItems(slot.assignedElements());
50134
51517
  const hasContent = slot.assignedElements().length > 0;
50135
51518
  const name = slot.getAttribute("name") ?? "";
50136
51519
  if (name === "start") this._hasStart = hasContent;
@@ -50159,6 +51542,7 @@ var NLDDPageFooter = (_NLDDPageFooter = class NLDDPageFooter extends LitElement
50159
51542
  constructor(..._args3) {
50160
51543
  super(..._args3);
50161
51544
  this.width = "";
51545
+ this.noRibbon = false;
50162
51546
  this._hasBreadcrumbs = false;
50163
51547
  this._hasMain = false;
50164
51548
  this._hasLegalBar = false;
@@ -50200,6 +51584,11 @@ __decorate([property({
50200
51584
  reflect: true,
50201
51585
  converter: reflectNonDefault("")
50202
51586
  })], NLDDPageFooter.prototype, "width", void 0);
51587
+ __decorate([property({
51588
+ type: Boolean,
51589
+ reflect: true,
51590
+ attribute: "no-ribbon"
51591
+ })], NLDDPageFooter.prototype, "noRibbon", void 0);
50203
51592
  __decorate([state()], NLDDPageFooter.prototype, "_hasBreadcrumbs", void 0);
50204
51593
  __decorate([state()], NLDDPageFooter.prototype, "_hasMain", void 0);
50205
51594
  __decorate([state()], NLDDPageFooter.prototype, "_hasLegalBar", void 0);
@@ -50872,7 +52261,7 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
50872
52261
  event.stopPropagation();
50873
52262
  };
50874
52263
  this._holdTouch = (event) => {
50875
- event.preventDefault();
52264
+ if (this._drag) event.preventDefault();
50876
52265
  };
50877
52266
  this._preventContextMenu = (event) => {
50878
52267
  event.preventDefault();
@@ -50910,11 +52299,13 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
50910
52299
  super.connectedCallback();
50911
52300
  this.addEventListener("pointerdown", this._onPointerDown);
50912
52301
  this.addEventListener("keydown", this._onKeyDown);
52302
+ this.addEventListener("touchmove", this._holdTouch, { passive: false });
50913
52303
  }
50914
52304
  disconnectedCallback() {
50915
52305
  super.disconnectedCallback();
50916
52306
  this.removeEventListener("pointerdown", this._onPointerDown);
50917
52307
  this.removeEventListener("keydown", this._onKeyDown);
52308
+ this.removeEventListener("touchmove", this._holdTouch);
50918
52309
  this._scrollObserver?.disconnect();
50919
52310
  this._scrollObserver = null;
50920
52311
  this._endPress();
@@ -51080,7 +52471,6 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
51080
52471
  document.getSelection()?.removeAllRanges();
51081
52472
  document.documentElement.style.setProperty("user-select", "none");
51082
52473
  document.documentElement.style.setProperty("-webkit-user-select", "none");
51083
- window.addEventListener("touchmove", this._holdTouch, { passive: false });
51084
52474
  window.addEventListener("contextmenu", this._preventContextMenu);
51085
52475
  window.addEventListener("keydown", this._onDragKeyDown, true);
51086
52476
  for (const column of this.columns) column._dropState = "available";
@@ -51208,7 +52598,6 @@ var NLDDTaskBoard = (_NLDDTaskBoard = class NLDDTaskBoard extends withTranslatio
51208
52598
  this._grabbing = null;
51209
52599
  document.documentElement.style.removeProperty("user-select");
51210
52600
  document.documentElement.style.removeProperty("-webkit-user-select");
51211
- window.removeEventListener("touchmove", this._holdTouch);
51212
52601
  window.removeEventListener("contextmenu", this._preventContextMenu);
51213
52602
  window.removeEventListener("keydown", this._onDragKeyDown, true);
51214
52603
  this._dragging = false;
@@ -51485,7 +52874,7 @@ var listItemSegmentStyles = css`
51485
52874
  }
51486
52875
  `;
51487
52876
  // src/components/lists-and-tables/list-item-segment/list-item-segment.template.ts
51488
- function template$9(control, href, target, rel, download, checked, expanded, current, disabled, accessibleLabel, actionTabindex, popupType, popovertarget, popoverTargetElement, popoverTargetAction, linkHint = "") {
52877
+ function template$9(control, href, target, rel, download, checked, expanded, current, disabled, accessibleLabel, actionTabindex, popupType, popoverTargetElement, popoverTargetAction, linkHint = "") {
51489
52878
  const content = html`<slot></slot>`;
51490
52879
  const ariaExpanded = expanded === void 0 ? popupType ? "false" : nothing : String(expanded);
51491
52880
  const ariaCurrent = current ?? nothing;
@@ -51505,7 +52894,6 @@ function template$9(control, href, target, rel, download, checked, expanded, cur
51505
52894
  if (control === "checkbox" || control === "button") return html`<button class="list-item-segment"
51506
52895
  type="button"
51507
52896
  aria-haspopup=${popupType || nothing}
51508
- popovertarget=${popovertarget ?? nothing}
51509
52897
  .popoverTargetElement=${popoverTargetElement ?? null}
51510
52898
  .popoverTargetAction=${popoverTargetAction ?? "toggle"}
51511
52899
  role=${control === "checkbox" ? "checkbox" : nothing}
@@ -51541,6 +52929,7 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
51541
52929
  e.stopPropagation();
51542
52930
  return;
51543
52931
  }
52932
+ if (this._control instanceof HTMLButtonElement) this._control.popoverTargetElement = popoverTargetOf(this, this.popovertarget, this.popoverTargetElement);
51544
52933
  this._control?.focus();
51545
52934
  if (this._controlType !== "checkbox") return;
51546
52935
  if (!e.composedPath().includes(this._control)) return;
@@ -51611,6 +53000,7 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
51611
53000
  }
51612
53001
  /** Delegates focus to the inner control so consumers needn't reach into shadow DOM. */
51613
53002
  focus(options) {
53003
+ if (deferFocus(this, options)) return;
51614
53004
  this._control?.focus(options);
51615
53005
  }
51616
53006
  /** The open state has to reach the styles, and it lives in a property (the
@@ -51623,7 +53013,7 @@ var _NLDDListItemSegment = class NLDDListItemSegment extends withTranslations(Li
51623
53013
  render() {
51624
53014
  const hintKey = this._controlType === "link" ? downloadLinkHintKey(this.href, this.target, this.download) : null;
51625
53015
  if (this._controlType === "link") markDownloadTarget(this, this.download, this.target);
51626
- return template$9(this._controlType, this.href, this.target, this.rel, this.download, this.checked, this.disclosure ? this._rowExpanded : this.expanded, this.current ? this.currentType : void 0, this.disabled, this.accessibleLabel, this._tabbable === void 0 ? void 0 : this._tabbable ? "0" : "-1", this.popupType, this.popovertarget, this.popoverTargetElement, this.popoverTargetAction, hintKey ? this._t(`components.list-item-segment.${hintKey}`) : "");
53016
+ return template$9(this._controlType, this.href, this.target, this.rel, this.download, this.checked, this.disclosure ? this._rowExpanded : this.expanded, this.current ? this.currentType : void 0, this.disabled, this.accessibleLabel, this._tabbable === void 0 ? void 0 : this._tabbable ? "0" : "-1", this.popupType, popoverTargetOf(this, this.popovertarget, this.popoverTargetElement), this.popoverTargetAction, hintKey ? this._t(`components.list-item-segment.${hintKey}`) : "");
51627
53017
  }
51628
53018
  };
51629
53019
  var NLDDListItemSegment = (_NLDDListItemSegment.styles = [listItemSegmentStyles], _NLDDListItemSegment);
@@ -51869,6 +53259,16 @@ function tableRowTemplate(onSlotChange) {
51869
53259
  * Header: put one `<nldd-table-row slot="header">` in the `header` slot. Its
51870
53260
  * cells become column headers (role="columnheader").
51871
53261
  *
53262
+ * Row headers: give the cell that says what a row is about `row-header`
53263
+ * (`nldd-cell`, `nldd-title-cell`, `nldd-text-cell`, `nldd-description-cell`).
53264
+ * The row then gives it role="rowheader" instead of "cell", so a screen
53265
+ * reader names the row along with every other cell in it, like
53266
+ * `<th scope="row">`. The attribute goes on the cell, not as a column index on
53267
+ * the row or table, so it survives columns hidden at a breakpoint and needs
53268
+ * no counting. It changes the semantics only: the cell variant still decides
53269
+ * the look. The cell above the row headers, in the header row, stays a
53270
+ * columnheader. Headers that span rows or columns are not supported.
53271
+ *
51872
53272
  * Responsive: two complementary strategies. (1) Give columns a minimum width
51873
53273
  * (e.g. `minmax(160px,1fr)`) — the table is its own scroll container, so it
51874
53274
  * scrolls horizontally when too narrow (no wrapper needed).
@@ -51901,6 +53301,14 @@ function tableRowTemplate(onSlotChange) {
51901
53301
  *
51902
53302
  * @attr {boolean} selected - Highlights the row (same treatment as nldd-list-item[selected])
51903
53303
  *
53304
+ * Assigns each slotted cell its role: "columnheader" in a header row,
53305
+ * "rowheader" for a body cell with `row-header`, "cell" otherwise.
53306
+ *
53307
+ * An `nldd-title-cell` without a `size` gets `size="6"`: the same
53308
+ * size as the other cells, in bold. Its default of 5 is made to stand out
53309
+ * above the supporting text of a list item, and in a table it towers over the
53310
+ * row. A `size` in the markup wins, 5 included.
53311
+ *
51904
53312
  * @slot - The row's cells (`nldd-cell` and variants), one per column
51905
53313
  */
51906
53314
  var _NLDDTable = class NLDDTable extends LitElement {
@@ -52061,6 +53469,17 @@ var NLDDTableRow = (_NLDDTableRow = class NLDDTableRow extends LitElement {
52061
53469
  super.connectedCallback();
52062
53470
  this.setAttribute("role", "row");
52063
53471
  this._syncAriaSelected();
53472
+ this._rowHeaderObserver = new MutationObserver(() => this._syncCellRoles());
53473
+ this._rowHeaderObserver.observe(this, {
53474
+ subtree: true,
53475
+ attributes: true,
53476
+ attributeFilter: ["row-header"]
53477
+ });
53478
+ }
53479
+ disconnectedCallback() {
53480
+ super.disconnectedCallback();
53481
+ this._rowHeaderObserver?.disconnect();
53482
+ this._rowHeaderObserver = void 0;
52064
53483
  }
52065
53484
  updated(changed) {
52066
53485
  if (changed.has("selected")) this._syncAriaSelected();
@@ -52079,13 +53498,25 @@ var NLDDTableRow = (_NLDDTableRow = class NLDDTableRow extends LitElement {
52079
53498
  }
52080
53499
  _onSlotChange(e) {
52081
53500
  const cells = e.target.assignedElements();
52082
- const cellRole = this._isHeader ? "columnheader" : "cell";
53501
+ this._syncCellRoles();
52083
53502
  for (const cell of cells) {
52084
- cell.setAttribute("role", cellRole);
52085
53503
  if (cell.localName === "nldd-cell") {
52086
53504
  const w = cell.getAttribute("width");
52087
53505
  if (w === null || w === "" || w === "fit-content") cell.setAttribute("width", "full");
52088
53506
  }
53507
+ if (cell.localName === "nldd-title-cell" && !cell.hasAttribute("size") && cell.size === void 0) cell.setAttribute("size", "6");
53508
+ }
53509
+ }
53510
+ /** Cells need explicit roles since the grid layout drops native table
53511
+ * semantics. A header row's cells are column headers whatever they say,
53512
+ * so the cell above a row-header column stays a columnheader. */
53513
+ _syncCellRoles() {
53514
+ const slot = this.shadowRoot?.querySelector("slot");
53515
+ for (const cell of slot?.assignedElements() ?? []) {
53516
+ let role = "cell";
53517
+ if (this._isHeader) role = "columnheader";
53518
+ else if (cell.hasAttribute("row-header")) role = "rowheader";
53519
+ cell.setAttribute("role", role);
52089
53520
  }
52090
53521
  }
52091
53522
  render() {
@@ -52367,7 +53798,7 @@ var template$8 = function() {
52367
53798
  * slotted content is rendered as-is.
52368
53799
  *
52369
53800
  * @element nldd-title-cell
52370
- * @attr {1|2|3|4|5|6} size - Visual size of the title (default: 5)
53801
+ * @attr {1|2|3|4|5|6} size - Visual size of the title (unset: looks like 5, and becomes 6 in an `nldd-table-row`, where a title the size of the other cells reads better)
52371
53802
  * @attr {'content' | 'secondary' | 'accent' | 'success' | 'warning' | 'critical'} color - Text color variant (default: 'content'). `secondary` demotes the title to match the muted overline/supporting-text. `accent`, `success`, `warning` and `critical` tint all three regions so the cell reads as a coherent state.
52372
53803
  * @attr {string} width - 'full' | 'fit-content' | CSS length (e.g. '200px', '20rem'). Default: 'full'
52373
53804
  * @attr {string} min-width - Minimum width as CSS length (e.g. '80px', '5rem')
@@ -52400,10 +53831,9 @@ var template$8 = function() {
52400
53831
  * @attr {string} query - Query substring to bold-highlight across text fields. Empty = no marking.
52401
53832
  * @attr {string} query-mark-mode - 'match' | 'predictive' (default: 'predictive')
52402
53833
  */
52403
- var _NLDDTitleCell = class NLDDTitleCell extends VisibilityMixin(LitElement, "cells-container") {
53834
+ var _NLDDTitleCell = class NLDDTitleCell extends RowHeaderMixin(VisibilityMixin(LitElement, "cells-container")) {
52404
53835
  constructor(..._args) {
52405
53836
  super(..._args);
52406
- this.size = 5;
52407
53837
  this.color = "content";
52408
53838
  this.width = "full";
52409
53839
  this.horizontalAlignment = "left";
@@ -52669,7 +54099,7 @@ var template$7 = () => html`
52669
54099
  * @slot title - The label displayed above the description
52670
54100
  * @slot description - The description content
52671
54101
  */
52672
- var _NLDDDescriptionCell = class NLDDDescriptionCell extends VisibilityMixin(LitElement, "cells-container") {
54102
+ var _NLDDDescriptionCell = class NLDDDescriptionCell extends RowHeaderMixin(VisibilityMixin(LitElement, "cells-container")) {
52673
54103
  constructor(..._args) {
52674
54104
  super(..._args);
52675
54105
  this.width = "full";
@@ -53544,6 +54974,15 @@ var menuBarStyles = css`
53544
54974
 
53545
54975
  /* # Elements */
53546
54976
 
54977
+ .menu-bar__list {
54978
+ display: flex;
54979
+ min-width: 0;
54980
+ flex-direction: row;
54981
+ flex-grow: 1;
54982
+ flex-shrink: 1;
54983
+ align-items: center;
54984
+ }
54985
+
53547
54986
  .menu-bar__overflow-button {
53548
54987
  display: none;
53549
54988
  }
@@ -53554,26 +54993,32 @@ function template$5(component) {
53554
54993
  <nav class="menu-bar"
53555
54994
  aria-label=${component.accessibleLabel || nothing}
53556
54995
  >
53557
- <slot></slot>
53558
- <div class="menu-bar__overflow-button">
53559
- <nldd-menu-bar-item
53560
- text="${component._overflowText}"
53561
- icon="ellipsis"
53562
- icon-only
53563
- haspopup="menu"
53564
- ?expanded=${component._menuOpen}
53565
- @pointerdown=${component._handleOverflowButtonPointerdown}
53566
- @click=${component._toggleOverflowMenu}
54996
+ <div class="menu-bar__list"
54997
+ role="list"
54998
+ >
54999
+ <slot></slot>
55000
+ <div class="menu-bar__overflow-button"
55001
+ role="listitem"
53567
55002
  >
53568
- <!-- The overflow popover is opened/closed explicitly by
53569
- _toggleOverflowMenu (same mechanism as an expandable
53570
- nldd-menu-bar-item's own submenu): anchored to this
53571
- always-visible trigger + a reopen guard. aria-controls
53572
- omitted: ARIA IDREF attributes cannot cross shadow DOM
53573
- boundaries and the menu is reparented to document.body;
53574
- haspopup + expanded forward to the inner button and give
53575
- sufficient AT context for WCAG 2.1 AA. -->
53576
- </nldd-menu-bar-item>
55003
+ <nldd-menu-bar-item
55004
+ text="${component._overflowText}"
55005
+ icon="ellipsis"
55006
+ icon-only
55007
+ haspopup="menu"
55008
+ ?expanded=${component._menuOpen}
55009
+ @pointerdown=${component._handleOverflowButtonPointerdown}
55010
+ @click=${component._toggleOverflowMenu}
55011
+ >
55012
+ <!-- The overflow popover is opened/closed explicitly by
55013
+ _toggleOverflowMenu (same mechanism as an expandable
55014
+ nldd-menu-bar-item's own submenu): anchored to this
55015
+ always-visible trigger + a reopen guard. aria-controls
55016
+ omitted: ARIA IDREF attributes cannot cross shadow DOM
55017
+ boundaries and the menu is reparented to document.body;
55018
+ haspopup + expanded forward to the inner button and give
55019
+ sufficient AT context for WCAG 2.1 AA. -->
55020
+ </nldd-menu-bar-item>
55021
+ </div>
53577
55022
  </div>
53578
55023
  </nav>
53579
55024
  `;
@@ -53915,6 +55360,11 @@ var _NLDDMenuBarItem = class NLDDMenuBarItem extends LitElement {
53915
55360
  if (this._menuOpen) this._pointerdownWhileMenuOpen = true;
53916
55361
  };
53917
55362
  this._handleClick = (event) => {
55363
+ const menu = this._findMenu();
55364
+ if (menu && event.composedPath().includes(menu)) {
55365
+ this._pointerdownWhileMenuOpen = false;
55366
+ return;
55367
+ }
53918
55368
  if (this.disabled) {
53919
55369
  event.preventDefault();
53920
55370
  event.stopPropagation();
@@ -53951,6 +55401,7 @@ var _NLDDMenuBarItem = class NLDDMenuBarItem extends LitElement {
53951
55401
  this._unwireMenu();
53952
55402
  }
53953
55403
  focus(options) {
55404
+ if (deferFocus(this, options)) return;
53954
55405
  (this.shadowRoot?.querySelector("button, a"))?.focus(options);
53955
55406
  }
53956
55407
  _findMenu() {
@@ -54089,6 +55540,7 @@ var _NLDDMenuBar = class NLDDMenuBar extends withTranslations(LitElement, nlddMe
54089
55540
  this._overflowRAF = null;
54090
55541
  this._setupRAF = null;
54091
55542
  this._onSlotChange = () => {
55543
+ markListItems(this._defaultSlot?.assignedElements({ flatten: true }) ?? []);
54092
55544
  this._syncCompactAttribute();
54093
55545
  this._scheduleOverflowUpdate();
54094
55546
  this._syncEmpty();
@@ -54171,7 +55623,10 @@ var _NLDDMenuBar = class NLDDMenuBar extends withTranslations(LitElement, nlddMe
54171
55623
  this._scheduleOverflowUpdate();
54172
55624
  });
54173
55625
  this._resizeObserver.observe(this);
54174
- if (this._defaultSlot) this._defaultSlot.addEventListener("slotchange", this._onSlotChange);
55626
+ if (this._defaultSlot) {
55627
+ this._defaultSlot.addEventListener("slotchange", this._onSlotChange);
55628
+ markListItems(this._defaultSlot.assignedElements({ flatten: true }));
55629
+ }
54175
55630
  this._scheduleOverflowUpdate();
54176
55631
  });
54177
55632
  }
@@ -54448,10 +55903,6 @@ var linkStyles = css`
54448
55903
  text-underline-offset: 0.15em;
54449
55904
  }
54450
55905
 
54451
- .link:focus-visible .link__label {
54452
- text-decoration: none;
54453
- }
54454
-
54455
55906
  .link__start-icon,
54456
55907
  .link__end-icon {
54457
55908
  display: inline-flex;
@@ -55611,7 +57062,7 @@ async function loadDependencies() {
55611
57062
  Promise.resolve().then(() => list_item_exports),
55612
57063
  Promise.resolve().then(() => text_cell_exports),
55613
57064
  Promise.resolve().then(() => icon_cell_exports),
55614
- import("./icon-IgCyk9ui.js").then((n) => n.n)
57065
+ import("./icon-BPNDyhu9.js").then((n) => n.n)
55615
57066
  ]);
55616
57067
  }
55617
57068
  /** The rows of a level, read from its container: the global menu bar's items
@@ -56466,6 +57917,7 @@ var _NLDDTabBarItem = class NLDDTabBarItem extends LitElement {
56466
57917
  this.setAttribute("variant", this._effectiveVariant);
56467
57918
  }
56468
57919
  focus(options) {
57920
+ if (deferFocus(this, options)) return;
56469
57921
  this.shadowRoot?.querySelector(".tab-bar__item")?.focus(options);
56470
57922
  }
56471
57923
  _onIconSlotChange(e) {
@@ -57302,7 +58754,7 @@ function documentTabBarTemplate(component) {
57302
58754
  "is-hidden": !hasOverflow
57303
58755
  })}>
57304
58756
  <nldd-icon-button
57305
- text=${component._t("components.document-tab-bar.overflow-action")}
58757
+ text=${component._t("components.document-tab-bar.show-more-tabs-action")}
57306
58758
  appearance="neutral-tinted"
57307
58759
  icon="ellipsis"
57308
58760
  tooltip-timing="never"
@@ -57401,10 +58853,10 @@ function documentTabBarItemTemplate(component) {
57401
58853
  *
57402
58854
  * @element nldd-document-tab-bar
57403
58855
  * @attr {string} accessible-label - Accessible name for the navigation landmark
57404
- * @attr {object} translations - Translation overrides; unset keys fall back to Dutch. Available keys: 'components.document-tab-bar.overflow-action' (default: 'Meer')
58856
+ * @attr {object} translations - Translation overrides; unset keys fall back to Dutch. Available keys: 'components.document-tab-bar.show-more-tabs-action' (default: 'Toon meer tabbladen')
57405
58857
  *
57406
58858
  * @migration The `overflow-button-label` attribute has been removed.
57407
- * Use `translations` property instead: `.translations=${{ 'components.document-tab-bar.overflow-action': 'Tabs' }}`
58859
+ * Use `translations` property instead: `.translations=${{ 'components.document-tab-bar.show-more-tabs-action': 'Tabs' }}`
57408
58860
  * @attr {boolean} navigation - Renders a nav landmark instead of tablist; use when items have hrefs
57409
58861
  *
57410
58862
  * The tabs can always be put in another order: drag one, or move the focused
@@ -57479,6 +58931,7 @@ var NLDDDocumentTabBarItem = (_NLDDDocumentTabBarItem2 = class NLDDDocumentTabBa
57479
58931
  this._isShort = Number.isFinite(threshold) && this.getBoundingClientRect().width < threshold;
57480
58932
  }
57481
58933
  focus(options) {
58934
+ if (deferFocus(this, options)) return;
57482
58935
  this.shadowRoot?.querySelector(".document-tab-bar__item-tab")?.focus(options);
57483
58936
  }
57484
58937
  _handleClick() {
@@ -58438,7 +59891,7 @@ function paginationTemplate(component) {
58438
59891
  const isDisabled = component.disabled;
58439
59892
  const renderPageButton = (page) => {
58440
59893
  const isCurrent = page === component.current;
58441
- const label = t("components.pagination.page-action", { page });
59894
+ const label = t("components.pagination.go-to-page-action", { page });
58442
59895
  if (hasHref) return html`
58443
59896
  <a class="pagination__page-button ${isCurrent ? "is-current" : ""}"
58444
59897
  href=${!isDisabled ? component._hrefForPage(page) : nothing}
@@ -58473,7 +59926,7 @@ function paginationTemplate(component) {
58473
59926
  <div class="pagination__previous-button">
58474
59927
  <nldd-icon-button
58475
59928
  icon="chevron-left-small"
58476
- text=${t("components.pagination.previous-action")}
59929
+ text=${t("components.pagination.go-to-previous-page-action")}
58477
59930
  appearance="neutral-tinted"
58478
59931
  no-highlight-border
58479
59932
  ?disabled=${isDisabled || atFirst}
@@ -58522,7 +59975,7 @@ function paginationTemplate(component) {
58522
59975
  <div class="pagination__next-button">
58523
59976
  <nldd-icon-button
58524
59977
  icon="chevron-right-small"
58525
- text=${t("components.pagination.next-action")}
59978
+ text=${t("components.pagination.go-to-next-page-action")}
58526
59979
  appearance="neutral-tinted"
58527
59980
  no-highlight-border
58528
59981
  ?disabled=${isDisabled || atLast}
@@ -58676,6 +60129,13 @@ var modalDialogStyles = css`
58676
60129
 
58677
60130
  :host {
58678
60131
  --_modal-dialog-max-height: 90vh;
60132
+ --_modal-dialog-padding: var(--primitives-space-16);
60133
+ --_modal-dialog-content-max-width: var(--primitives-area-360);
60134
+
60135
+ @media (min-width: ${mdMin}) {
60136
+ --_modal-dialog-padding: var(--primitives-space-24);
60137
+ }
60138
+
58679
60139
  --_modal-dialog-animation-duration: 150ms;
58680
60140
  --_modal-dialog-animation-easing: ease;
58681
60141
 
@@ -58705,14 +60165,10 @@ var modalDialogStyles = css`
58705
60165
  box-shadow: var(--semantics-overlays-box-shadow);
58706
60166
  background-color: var(--semantics-surfaces-base-background-color);
58707
60167
  width: calc(100% - var(--primitives-space-16) * 2);
58708
- max-width: var(--primitives-area-480);
60168
+ max-width: calc(var(--_modal-dialog-content-max-width) + var(--_modal-dialog-padding) * 2);
58709
60169
  max-height: var(--_modal-dialog-max-height);
58710
60170
  overflow-y: auto;
58711
- padding: var(--primitives-space-16);
58712
-
58713
- @media (min-width: ${mdMin}) {
58714
- padding: var(--primitives-space-24);
58715
- }
60171
+ padding: var(--_modal-dialog-padding);
58716
60172
  }
58717
60173
 
58718
60174
  .modal-dialog:not([open]) {
@@ -58829,7 +60285,7 @@ function modalDialogTemplate(component) {
58829
60285
  * @attr {string} accessible-label - Accessible name for the dialog (aria-label); falls back to text
58830
60286
  * @attr {boolean} open - Whether the dialog is open. Set it to open or close the dialog, as an alternative to show() and hide(). The dialog clears it itself when it closes another way (Escape, the backdrop), so bind it together with the close event.
58831
60287
  *
58832
- * @slot - Optional custom content, forwarded to nldd-inline-dialog
60288
+ * @slot - Optional custom content, forwarded to nldd-inline-dialog. Puts no space between its children, as a sheet or card does not: the app decides the distance. Put an nldd-spacer between different components, and a group of the same, such as form fields, in an nldd-container with layout="stack" and a gap.
58833
60289
  * @slot actions - nldd-button elements, forwarded to nldd-inline-dialog
58834
60290
  * @slot notifications - Where the notifications area lands while this overlay is open, so a notification is not left inert behind it. Filled by the package; leave it alone.
58835
60291
  *