@bk2k/ui 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/BUILDING.md +56 -2
  2. package/CHANGELOG.md +136 -0
  3. package/USAGE.md +89 -26
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/chart-tokens.js +1 -1
  6. package/dist/charts/fields.d.ts +20 -0
  7. package/dist/charts/fields.js +27 -0
  8. package/dist/charts/frame.js +2 -1
  9. package/dist/clipboard.js +1 -0
  10. package/dist/components/bk-alert.js +2 -1
  11. package/dist/components/bk-avatar-group.js +4 -6
  12. package/dist/components/bk-avatar.d.ts +10 -0
  13. package/dist/components/bk-avatar.js +17 -0
  14. package/dist/components/bk-bar.js +2 -0
  15. package/dist/components/bk-button-group.js +1 -1
  16. package/dist/components/bk-button-top.js +2 -1
  17. package/dist/components/bk-button.d.ts +37 -14
  18. package/dist/components/bk-button.js +52 -16
  19. package/dist/components/bk-card.d.ts +4 -0
  20. package/dist/components/bk-card.js +15 -2
  21. package/dist/components/bk-carousel-controls.d.ts +2 -0
  22. package/dist/components/bk-carousel-controls.js +4 -2
  23. package/dist/components/bk-chart-area.d.ts +6 -0
  24. package/dist/components/bk-chart-bar.d.ts +17 -0
  25. package/dist/components/bk-chart-bar.js +25 -4
  26. package/dist/components/bk-chart-line.d.ts +13 -0
  27. package/dist/components/bk-chart-line.js +11 -1
  28. package/dist/components/bk-chip-group.d.ts +2 -2
  29. package/dist/components/bk-chip-group.js +4 -0
  30. package/dist/components/bk-chip.d.ts +53 -8
  31. package/dist/components/bk-chip.js +43 -7
  32. package/dist/components/bk-code.js +6 -2
  33. package/dist/components/bk-columns.d.ts +11 -0
  34. package/dist/components/bk-columns.js +8 -1
  35. package/dist/components/bk-combobox.d.ts +1 -1
  36. package/dist/components/bk-combobox.js +2 -1
  37. package/dist/components/bk-delta.d.ts +10 -0
  38. package/dist/components/bk-delta.js +8 -6
  39. package/dist/components/bk-dialog.d.ts +12 -5
  40. package/dist/components/bk-dialog.js +14 -6
  41. package/dist/components/bk-disclosure.js +4 -2
  42. package/dist/components/bk-drop-target.d.ts +7 -1
  43. package/dist/components/bk-drop-target.js +20 -4
  44. package/dist/components/bk-error-summary.d.ts +5 -0
  45. package/dist/components/bk-error-summary.js +13 -4
  46. package/dist/components/bk-facts.js +3 -2
  47. package/dist/components/bk-footnote.d.ts +73 -0
  48. package/dist/components/bk-footnote.js +97 -0
  49. package/dist/components/bk-footnotes-item.d.ts +92 -0
  50. package/dist/components/bk-footnotes-item.js +139 -0
  51. package/dist/components/bk-footnotes.d.ts +51 -0
  52. package/dist/components/bk-footnotes.js +43 -0
  53. package/dist/components/bk-icon.js +2 -2
  54. package/dist/components/bk-image-compare.d.ts +33 -5
  55. package/dist/components/bk-image-compare.js +72 -24
  56. package/dist/components/bk-image-crop.d.ts +3 -3
  57. package/dist/components/bk-image-editor.d.ts +1 -1
  58. package/dist/components/bk-image-viewer.d.ts +107 -11
  59. package/dist/components/bk-image-viewer.js +205 -34
  60. package/dist/components/bk-input-inline.d.ts +15 -6
  61. package/dist/components/bk-input-inline.js +22 -6
  62. package/dist/components/bk-input-number.js +2 -1
  63. package/dist/components/bk-input-search.d.ts +1 -1
  64. package/dist/components/bk-input-search.js +2 -1
  65. package/dist/components/bk-input-text.d.ts +11 -0
  66. package/dist/components/bk-input-text.js +17 -3
  67. package/dist/components/bk-input-time.js +2 -1
  68. package/dist/components/bk-item.js +2 -1
  69. package/dist/components/bk-lightbox.d.ts +12 -3
  70. package/dist/components/bk-lightbox.js +6 -3
  71. package/dist/components/bk-link.d.ts +9 -1
  72. package/dist/components/bk-link.js +14 -4
  73. package/dist/components/bk-menu-item.d.ts +40 -0
  74. package/dist/components/bk-menu-item.js +57 -9
  75. package/dist/components/bk-menu-label.js +2 -1
  76. package/dist/components/bk-menu-list.d.ts +1 -0
  77. package/dist/components/bk-menu-list.js +10 -0
  78. package/dist/components/bk-menu.d.ts +8 -1
  79. package/dist/components/bk-menu.js +16 -5
  80. package/dist/components/bk-message-feedback.d.ts +4 -3
  81. package/dist/components/bk-message-feedback.js +7 -5
  82. package/dist/components/bk-message-list.js +2 -1
  83. package/dist/components/bk-message-source.d.ts +1 -2
  84. package/dist/components/bk-message-source.js +3 -11
  85. package/dist/components/bk-message.js +2 -0
  86. package/dist/components/bk-nav-group.js +1 -1
  87. package/dist/components/bk-nav-item.d.ts +18 -0
  88. package/dist/components/bk-nav-item.js +18 -5
  89. package/dist/components/bk-nav.d.ts +1 -1
  90. package/dist/components/bk-page-cta.js +2 -0
  91. package/dist/components/bk-page-section.d.ts +1 -1
  92. package/dist/components/bk-page-section.js +3 -9
  93. package/dist/components/bk-pane.d.ts +1 -0
  94. package/dist/components/bk-pane.js +7 -5
  95. package/dist/components/bk-panel.d.ts +1 -1
  96. package/dist/components/bk-panel.js +6 -5
  97. package/dist/components/bk-picture.d.ts +17 -4
  98. package/dist/components/bk-picture.js +8 -1
  99. package/dist/components/bk-segmented-item.d.ts +24 -4
  100. package/dist/components/bk-segmented-item.js +37 -5
  101. package/dist/components/bk-segmented.js +2 -13
  102. package/dist/components/bk-select-cascade.d.ts +1 -1
  103. package/dist/components/bk-select-tree.d.ts +1 -1
  104. package/dist/components/bk-select.d.ts +1 -1
  105. package/dist/components/bk-shell-app.d.ts +10 -4
  106. package/dist/components/bk-shell-app.js +32 -9
  107. package/dist/components/bk-shell-sites.d.ts +2 -1
  108. package/dist/components/bk-shell-sites.js +3 -5
  109. package/dist/components/bk-sortable.js +7 -17
  110. package/dist/components/bk-split-grid.d.ts +104 -3
  111. package/dist/components/bk-split-grid.js +425 -2
  112. package/dist/components/bk-stat-group.js +2 -1
  113. package/dist/components/bk-stat.d.ts +17 -0
  114. package/dist/components/bk-stat.js +7 -3
  115. package/dist/components/bk-steps.js +2 -1
  116. package/dist/components/bk-surface.d.ts +2 -0
  117. package/dist/components/bk-surface.js +6 -3
  118. package/dist/components/bk-table.d.ts +1 -1
  119. package/dist/components/bk-table.js +9 -12
  120. package/dist/components/bk-tabs-item.d.ts +45 -7
  121. package/dist/components/bk-tabs-item.js +51 -20
  122. package/dist/components/bk-tabs-panel.d.ts +6 -3
  123. package/dist/components/bk-tabs-panel.js +6 -0
  124. package/dist/components/bk-tabs.d.ts +50 -7
  125. package/dist/components/bk-tabs.js +168 -96
  126. package/dist/components/bk-text.js +2 -1
  127. package/dist/components/bk-toast-group.d.ts +3 -1
  128. package/dist/components/bk-toast-group.js +11 -1
  129. package/dist/components/bk-tooltip.d.ts +3 -1
  130. package/dist/components/bk-tooltip.js +2 -1
  131. package/dist/components/bk-video.js +2 -2
  132. package/dist/components/bk-zoom.d.ts +3 -1
  133. package/dist/components/confirm.d.ts +15 -0
  134. package/dist/components/confirm.js +27 -4
  135. package/dist/i18n/de.js +12 -1
  136. package/dist/i18n/en.d.ts +2 -0
  137. package/dist/i18n/en.js +3 -0
  138. package/dist/i18n.d.ts +16 -2
  139. package/dist/i18n.js +28 -4
  140. package/dist/icons/brands-static.d.ts +3 -0
  141. package/dist/icons/brands-static.js +5 -0
  142. package/dist/icons/core.d.ts +1 -0
  143. package/dist/icons/core.js +2 -0
  144. package/dist/icons/load-static.d.ts +3 -0
  145. package/dist/icons/load-static.js +5 -0
  146. package/dist/icons/load.js +1 -0
  147. package/dist/icons/registry.js +1 -1
  148. package/dist/icons/set/save-as.d.ts +3 -0
  149. package/dist/icons/set/save-as.js +7 -0
  150. package/dist/index.d.ts +3 -0
  151. package/dist/index.js +3 -0
  152. package/dist/internal/announcer.d.ts +8 -1
  153. package/dist/internal/announcer.js +26 -10
  154. package/dist/internal/backdrop.d.ts +19 -0
  155. package/dist/internal/backdrop.js +29 -0
  156. package/dist/internal/busy.d.ts +3 -2
  157. package/dist/internal/busy.js +4 -5
  158. package/dist/internal/choice-field.js +1 -1
  159. package/dist/internal/choice-item.d.ts +17 -6
  160. package/dist/internal/choice-item.js +20 -9
  161. package/dist/internal/cloak.js +3 -0
  162. package/dist/internal/crop-frame.d.ts +1 -1
  163. package/dist/internal/crop-frame.js +2 -7
  164. package/dist/internal/date-field.js +2 -1
  165. package/dist/internal/drag.d.ts +11 -0
  166. package/dist/internal/drag.js +23 -0
  167. package/dist/internal/english-static.d.ts +3 -0
  168. package/dist/internal/english-static.js +5 -0
  169. package/dist/internal/english.d.ts +8 -0
  170. package/dist/internal/english.js +6 -0
  171. package/dist/internal/footnotes.d.ts +56 -0
  172. package/dist/internal/footnotes.js +143 -0
  173. package/dist/internal/handle-menu.js +2 -5
  174. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  175. package/dist/internal/late/bk-shell-app.js +7 -0
  176. package/dist/internal/late/bk-table.d.ts +4 -0
  177. package/dist/internal/late/bk-table.js +17 -0
  178. package/dist/internal/late/handle-menu.d.ts +4 -0
  179. package/dist/internal/late/handle-menu.js +9 -0
  180. package/dist/internal/late/static.d.ts +7 -0
  181. package/dist/internal/late/static.js +5 -0
  182. package/dist/internal/late.d.ts +8 -3
  183. package/dist/internal/late.js +19 -4
  184. package/dist/internal/link.d.ts +2 -0
  185. package/dist/internal/link.js +11 -1
  186. package/dist/internal/own-text.d.ts +8 -0
  187. package/dist/internal/own-text.js +7 -0
  188. package/dist/internal/scope.js +1 -1
  189. package/dist/internal/scroll-lock.d.ts +4 -1
  190. package/dist/internal/scroll-lock.js +17 -4
  191. package/dist/internal/slider.js +2 -1
  192. package/dist/internal/styles.js +3 -0
  193. package/dist/internal/submit.d.ts +23 -0
  194. package/dist/internal/submit.js +57 -0
  195. package/dist/jsx.d.ts +141 -52
  196. package/dist/reset.css +10 -0
  197. package/dist/standalone/all.js +226 -222
  198. package/dist/standalone/appearance.js +1 -1
  199. package/dist/standalone/bk-accordion-item.js +4 -4
  200. package/dist/standalone/bk-accordion.js +2 -2
  201. package/dist/standalone/bk-action-bar.js +3 -3
  202. package/dist/standalone/bk-alert-offline.js +1 -2
  203. package/dist/standalone/bk-alert.js +13 -12
  204. package/dist/standalone/bk-app-state.js +1 -1
  205. package/dist/standalone/bk-attachment.js +4 -4
  206. package/dist/standalone/bk-avatar-group.js +12 -10
  207. package/dist/standalone/bk-avatar.js +14 -4
  208. package/dist/standalone/bk-badge.js +2 -2
  209. package/dist/standalone/bk-bar.js +3 -1
  210. package/dist/standalone/bk-brand.js +3 -3
  211. package/dist/standalone/bk-breadcrumbs.js +5 -5
  212. package/dist/standalone/bk-button-copy.js +5 -5
  213. package/dist/standalone/bk-button-group.js +5 -5
  214. package/dist/standalone/bk-button-share.js +5 -5
  215. package/dist/standalone/bk-button-top.js +9 -8
  216. package/dist/standalone/bk-button.js +62 -30
  217. package/dist/standalone/bk-calendar-event.js +1 -1
  218. package/dist/standalone/bk-calendar-week.js +3 -3
  219. package/dist/standalone/bk-calendar.js +4 -4
  220. package/dist/standalone/bk-card.js +20 -7
  221. package/dist/standalone/bk-carousel-controls.js +7 -6
  222. package/dist/standalone/bk-carousel-item.js +2 -2
  223. package/dist/standalone/bk-carousel.js +1 -1
  224. package/dist/standalone/bk-chart-area.js +1 -1
  225. package/dist/standalone/bk-chart-bar-list.js +8 -8
  226. package/dist/standalone/bk-chart-bar.js +145 -117
  227. package/dist/standalone/bk-chart-bridge.js +7 -7
  228. package/dist/standalone/bk-chart-bullet.js +6 -6
  229. package/dist/standalone/bk-chart-calendar.js +7 -7
  230. package/dist/standalone/bk-chart-heatmap.js +7 -7
  231. package/dist/standalone/bk-chart-histogram.js +5 -5
  232. package/dist/standalone/bk-chart-legend.js +6 -6
  233. package/dist/standalone/bk-chart-line.js +116 -103
  234. package/dist/standalone/bk-chart-mark.js +1 -1
  235. package/dist/standalone/bk-chart-scatter.js +6 -6
  236. package/dist/standalone/bk-chart-sparkline.js +6 -6
  237. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  238. package/dist/standalone/bk-chart-tracker.js +6 -6
  239. package/dist/standalone/bk-chart-waterfall.js +6 -6
  240. package/dist/standalone/bk-checkbox-group.js +4 -4
  241. package/dist/standalone/bk-checkbox.js +4 -4
  242. package/dist/standalone/bk-chip-group.js +9 -5
  243. package/dist/standalone/bk-chip.js +56 -17
  244. package/dist/standalone/bk-cluster.js +1 -1
  245. package/dist/standalone/bk-code-diff.js +4 -4
  246. package/dist/standalone/bk-code-stack.js +4 -4
  247. package/dist/standalone/bk-code.js +10 -6
  248. package/dist/standalone/bk-color-panel.js +5 -5
  249. package/dist/standalone/bk-columns.js +13 -5
  250. package/dist/standalone/bk-combobox.js +9 -8
  251. package/dist/standalone/bk-command-menu.js +6 -6
  252. package/dist/standalone/bk-command-palette.js +6 -5
  253. package/dist/standalone/bk-composer.js +6 -6
  254. package/dist/standalone/bk-delta.js +11 -10
  255. package/dist/standalone/bk-diagram.js +1 -1
  256. package/dist/standalone/bk-dialog.js +1 -1
  257. package/dist/standalone/bk-disclosure.js +7 -5
  258. package/dist/standalone/bk-divider.js +2 -2
  259. package/dist/standalone/bk-drawer.js +3 -3
  260. package/dist/standalone/bk-drop-target.js +12 -6
  261. package/dist/standalone/bk-empty-state.js +3 -3
  262. package/dist/standalone/bk-error-summary.js +9 -6
  263. package/dist/standalone/bk-facts-item.js +2 -2
  264. package/dist/standalone/bk-facts.js +9 -8
  265. package/dist/standalone/bk-feature.js +3 -3
  266. package/dist/standalone/bk-fieldset.js +3 -3
  267. package/dist/standalone/bk-filter-bar.js +4 -4
  268. package/dist/standalone/bk-folder-browser.js +4 -4
  269. package/dist/standalone/bk-footnote.js +82 -0
  270. package/dist/standalone/bk-footnotes-item.js +122 -0
  271. package/dist/standalone/bk-footnotes.js +37 -0
  272. package/dist/standalone/bk-form-guard.js +2 -2
  273. package/dist/standalone/bk-form-steps.js +3 -3
  274. package/dist/standalone/bk-grid.js +1 -1
  275. package/dist/standalone/bk-icon-tile.js +3 -3
  276. package/dist/standalone/bk-icon.js +1 -1
  277. package/dist/standalone/bk-image-compare.js +88 -47
  278. package/dist/standalone/bk-image-crop.js +6 -6
  279. package/dist/standalone/bk-image-editor.js +1 -1
  280. package/dist/standalone/bk-image-viewer.js +180 -59
  281. package/dist/standalone/bk-input-code.js +4 -4
  282. package/dist/standalone/bk-input-color.js +4 -4
  283. package/dist/standalone/bk-input-date-range.js +2 -2
  284. package/dist/standalone/bk-input-date.js +2 -2
  285. package/dist/standalone/bk-input-file.js +5 -5
  286. package/dist/standalone/bk-input-group.js +4 -4
  287. package/dist/standalone/bk-input-inline.js +17 -10
  288. package/dist/standalone/bk-input-number.js +9 -8
  289. package/dist/standalone/bk-input-rating.js +6 -6
  290. package/dist/standalone/bk-input-rich.js +1 -1
  291. package/dist/standalone/bk-input-search.js +23 -22
  292. package/dist/standalone/bk-input-slider-range.js +5 -5
  293. package/dist/standalone/bk-input-slider.js +5 -5
  294. package/dist/standalone/bk-input-text.js +1 -1
  295. package/dist/standalone/bk-input-time-zone.js +1 -1
  296. package/dist/standalone/bk-input-time.js +29 -28
  297. package/dist/standalone/bk-item-group.js +3 -3
  298. package/dist/standalone/bk-item.js +12 -11
  299. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  300. package/dist/standalone/bk-kbd.js +68 -1
  301. package/dist/standalone/bk-lightbox.js +11 -7
  302. package/dist/standalone/bk-lines.js +1 -1
  303. package/dist/standalone/bk-link.js +33 -19
  304. package/dist/standalone/bk-listbox-columns.js +6 -6
  305. package/dist/standalone/bk-listbox-item.js +1 -1
  306. package/dist/standalone/bk-listbox-search.js +7 -7
  307. package/dist/standalone/bk-listbox-transfer.js +6 -6
  308. package/dist/standalone/bk-listbox.js +7 -7
  309. package/dist/standalone/bk-logo-wall.js +2 -2
  310. package/dist/standalone/bk-logo.js +3 -3
  311. package/dist/standalone/bk-menu-bar.js +3 -3
  312. package/dist/standalone/bk-menu-context.js +1 -1
  313. package/dist/standalone/bk-menu-divider.js +2 -2
  314. package/dist/standalone/bk-menu-item.js +73 -29
  315. package/dist/standalone/bk-menu-label.js +7 -6
  316. package/dist/standalone/bk-menu-list.js +10 -4
  317. package/dist/standalone/bk-menu.js +19 -10
  318. package/dist/standalone/bk-message-approval.js +4 -4
  319. package/dist/standalone/bk-message-branches.js +3 -3
  320. package/dist/standalone/bk-message-citation.js +10 -10
  321. package/dist/standalone/bk-message-feedback.js +10 -6
  322. package/dist/standalone/bk-message-list.js +6 -5
  323. package/dist/standalone/bk-message-reasoning.js +5 -5
  324. package/dist/standalone/bk-message-source.js +13 -21
  325. package/dist/standalone/bk-message-tool-group.js +5 -5
  326. package/dist/standalone/bk-message-tool.js +5 -5
  327. package/dist/standalone/bk-message.js +6 -4
  328. package/dist/standalone/bk-meter.js +3 -3
  329. package/dist/standalone/bk-model-viewer.js +1 -1
  330. package/dist/standalone/bk-nav-divider.js +2 -2
  331. package/dist/standalone/bk-nav-group.js +6 -6
  332. package/dist/standalone/bk-nav-item.js +31 -23
  333. package/dist/standalone/bk-nav-toc.js +3 -3
  334. package/dist/standalone/bk-nav.js +3 -3
  335. package/dist/standalone/bk-overflow.js +3 -3
  336. package/dist/standalone/bk-page-cta.js +5 -3
  337. package/dist/standalone/bk-page-footer-column.js +2 -2
  338. package/dist/standalone/bk-page-footer.js +3 -3
  339. package/dist/standalone/bk-page-header.js +3 -3
  340. package/dist/standalone/bk-page-hero.js +3 -3
  341. package/dist/standalone/bk-page-pager.js +5 -5
  342. package/dist/standalone/bk-page-section.js +6 -6
  343. package/dist/standalone/bk-pagination.js +6 -6
  344. package/dist/standalone/bk-pane.js +10 -9
  345. package/dist/standalone/bk-panel.js +9 -10
  346. package/dist/standalone/bk-period-nav.js +4 -4
  347. package/dist/standalone/bk-picture.js +24 -15
  348. package/dist/standalone/bk-popover-help.js +3 -3
  349. package/dist/standalone/bk-popover.js +2 -2
  350. package/dist/standalone/bk-presence-cursor.js +2 -2
  351. package/dist/standalone/bk-preview.js +4 -4
  352. package/dist/standalone/bk-progress.js +3 -3
  353. package/dist/standalone/bk-prose.js +3 -3
  354. package/dist/standalone/bk-qr-code.js +1 -1
  355. package/dist/standalone/bk-radio-group.js +4 -4
  356. package/dist/standalone/bk-radio.js +3 -3
  357. package/dist/standalone/bk-rating.js +5 -5
  358. package/dist/standalone/bk-scroll.js +3 -3
  359. package/dist/standalone/bk-segmented-item.js +40 -16
  360. package/dist/standalone/bk-segmented.js +15 -13
  361. package/dist/standalone/bk-select-cascade.js +3 -3
  362. package/dist/standalone/bk-select-tree.js +4 -4
  363. package/dist/standalone/bk-select.js +5 -5
  364. package/dist/standalone/bk-shell-app.js +1 -1221
  365. package/dist/standalone/bk-shell-centered.js +2 -2
  366. package/dist/standalone/bk-shell-sites.js +5 -7
  367. package/dist/standalone/bk-skeleton.js +2 -2
  368. package/dist/standalone/bk-sortable.js +55 -60
  369. package/dist/standalone/bk-spinner.js +2 -2
  370. package/dist/standalone/bk-split-grid.js +318 -41
  371. package/dist/standalone/bk-split.js +4 -4
  372. package/dist/standalone/bk-stack.js +1 -1
  373. package/dist/standalone/bk-stat-group.js +8 -7
  374. package/dist/standalone/bk-stat.js +11 -8
  375. package/dist/standalone/bk-status-dot.js +3 -3
  376. package/dist/standalone/bk-steps-item.js +5 -5
  377. package/dist/standalone/bk-steps.js +8 -7
  378. package/dist/standalone/bk-surface.js +1 -1
  379. package/dist/standalone/bk-swatch-group.js +4 -4
  380. package/dist/standalone/bk-swatch-palette.js +1 -1
  381. package/dist/standalone/bk-swatch.js +2 -2
  382. package/dist/standalone/bk-switch.js +4 -4
  383. package/dist/standalone/bk-table.js +1 -1937
  384. package/dist/standalone/bk-tabs-item.js +58 -35
  385. package/dist/standalone/bk-tabs-panel.js +7 -3
  386. package/dist/standalone/bk-tabs.js +160 -98
  387. package/dist/standalone/bk-tasks-item.js +4 -4
  388. package/dist/standalone/bk-tasks.js +2 -2
  389. package/dist/standalone/bk-testimonial.js +3 -3
  390. package/dist/standalone/bk-text.js +19 -18
  391. package/dist/standalone/bk-time-countdown.js +4 -4
  392. package/dist/standalone/bk-time-relative.js +3 -3
  393. package/dist/standalone/bk-timeline-item.js +4 -4
  394. package/dist/standalone/bk-timeline.js +2 -2
  395. package/dist/standalone/bk-toast-group.js +1 -1
  396. package/dist/standalone/bk-toast.js +4 -4
  397. package/dist/standalone/bk-toolbar.js +2 -2
  398. package/dist/standalone/bk-tooltip.js +8 -7
  399. package/dist/standalone/bk-tree-item.js +6 -6
  400. package/dist/standalone/bk-tree.js +3 -3
  401. package/dist/standalone/bk-video.js +6 -6
  402. package/dist/standalone/bk-visually-hidden.js +2 -2
  403. package/dist/standalone/bk-zoom.js +5 -5
  404. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  405. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  406. package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  407. package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-Biz7t8sL.js} +4 -4
  408. package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-D_fQf6SF.js} +5 -5
  409. package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DwZyUUHh.js} +59 -25
  410. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  411. package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-BADsoLRL.js} +5 -5
  412. package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  413. package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-CFhW6vRa.js} +6 -6
  414. package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-DviyLBqj.js} +63 -54
  415. package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-w_Ah4Tvs.js} +4 -4
  416. package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CYMovNVl.js} +3 -3
  417. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  418. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  419. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  420. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  421. package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-CoL6W7uk.js} +27 -24
  422. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  423. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  424. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  425. package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-poOTerh1.js} +6 -6
  426. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  427. package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
  428. package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
  429. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  430. package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-B-fCXa2D.js} +48 -47
  431. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  432. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  433. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  434. package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-CHpfKAKa.js} +2 -2
  435. package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
  436. package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BgYUbGO2.js} +26 -19
  437. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  438. package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
  439. package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
  440. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  441. package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
  442. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  443. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  444. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  445. package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
  446. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  447. package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
  448. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  449. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  450. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  451. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  452. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  453. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  454. package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
  455. package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CqhJSAwZ.js} +4 -4
  456. package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-lvZbQtGW.js} +2 -2
  457. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  458. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  459. package/dist/standalone/confirm.js +27 -14
  460. package/dist/standalone/i18n-de.js +13 -2
  461. package/dist/standalone/icons.js +100 -98
  462. package/dist/standalone/links.js +1 -1
  463. package/dist/standalone/reset.css +10 -0
  464. package/dist/standalone/toast.js +1 -1
  465. package/dist/standalone/tokens.css +6 -5
  466. package/dist/tokens.css +6 -5
  467. package/dist/tokens.js +4 -3
  468. package/package.json +25 -2
  469. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  470. package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
  471. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -20,8 +20,9 @@ const choiceItemStyles = [base, countBadge, css`
20
20
  :host(:not([disabled])) .item:hover { color: var(--_bk-ci-hover-fg); background: var(--_bk-ci-hover-bg); }
21
21
  }
22
22
  :host(:not([disabled])) .item:active { color: var(--_bk-ci-hover-fg); background: var(--_bk-ci-pressed-bg); }
23
- a.item:focus { outline: none; }
24
- :host(:focus-visible) .item, a.item:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
23
+ /* The link or the inner box takes the focus: the ring only for keyboard focus, inside the item (the row clips). */
24
+ .item:focus { outline: none; }
25
+ :host(:focus-visible) .item, .item:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
25
26
  :host([disabled]) .item { opacity: var(--bk-disabled-opacity); cursor: not-allowed; background: transparent; }
26
27
  .icon-only { padding: 0; }
27
28
  .icon-only .label { display: none; }
@@ -43,6 +44,8 @@ class ChoiceItem extends LitElement {
43
44
  label: {},
44
45
  href: { reflect: true },
45
46
  target: {},
47
+ rel: {},
48
+ download: {},
46
49
  disabled: { type: Boolean, reflect: true }
47
50
  };
48
51
  ownLabel = false;
@@ -53,11 +56,15 @@ class ChoiceItem extends LitElement {
53
56
  this.value = "";
54
57
  this.disabled = false;
55
58
  }
59
+ /** True when the host has the role of the option and so takes the `aria-label`. A subclass that renders the role inside returns false. */
60
+ get labelOnHost() {
61
+ return true;
62
+ }
56
63
  willUpdate(changed) {
57
64
  super.willUpdate(changed);
58
65
  if (!changed.has("label") && !changed.has("href"))
59
66
  return;
60
- if (this.label && !this.href) {
67
+ if (this.label && !this.href && this.labelOnHost) {
61
68
  this.setAttribute("aria-label", this.label);
62
69
  this.ownLabel = true;
63
70
  } else if (this.ownLabel) {
@@ -65,11 +72,11 @@ class ChoiceItem extends LitElement {
65
72
  this.ownLabel = false;
66
73
  }
67
74
  }
68
- /** Focuses the option (its link in link mode). */
75
+ /** Focuses the option: its link in link mode, its inner box when the box has the role (`labelOnHost` false). */
69
76
  focus(options) {
70
- const link = this.href ? this.renderRoot?.querySelector("a") : null;
71
- if (link)
72
- link.focus(options);
77
+ const inner = this.href ? this.renderRoot?.querySelector("a") : !this.labelOnHost ? this.renderRoot?.querySelector("span.item") : null;
78
+ if (inner)
79
+ inner.focus(options);
73
80
  else
74
81
  super.focus(options);
75
82
  }
@@ -77,6 +84,10 @@ class ChoiceItem extends LitElement {
77
84
  get tip() {
78
85
  return this.label;
79
86
  }
87
+ /** The box of an option that is not a link. A subclass that renders the role inside adds the ARIA attributes here. */
88
+ renderBox(cls, inner) {
89
+ return html`<span class=${cls} part="base" title=${ifDefined(this.tip)}>${inner}</span>`;
90
+ }
80
91
  /** A subclass adds a mark between the label and the count here. */
81
92
  renderMark() {
82
93
  return nothing;
@@ -90,12 +101,12 @@ class ChoiceItem extends LitElement {
90
101
  <slot name="end">${this.renderMark()}${hasCount ? html`<span class="count${current ? " selected" : ""}" part="count">${this.count}</span>` : nothing}</slot>`;
91
102
  if (this.href) {
92
103
  return html`<a class=${cls} part="base" href=${ifDefined(this.disabled ? void 0 : this.links.href(this.href))} target=${ifDefined(this.target)}
93
- rel=${ifDefined(this.target === "_blank" ? "noopener noreferrer" : void 0)}
104
+ rel=${ifDefined(this.rel ?? (this.target === "_blank" ? "noopener noreferrer" : void 0))} download=${ifDefined(this.download)}
94
105
  role=${ifDefined(this.disabled ? "link" : void 0)} aria-disabled=${ifDefined(this.disabled ? "true" : void 0)}
95
106
  aria-current=${ifDefined(current ? "page" : void 0)}
96
107
  aria-label=${ifDefined(this.label)} title=${ifDefined(this.tip)}>${inner}</a>`;
97
108
  }
98
- return html`<span class=${cls} part="base" title=${ifDefined(this.tip)}>${inner}</span>`;
109
+ return this.renderBox(cls, inner);
99
110
  }
100
111
  }
101
112
  export {
@@ -69,6 +69,9 @@ const cloakTags = [
69
69
  "bk-fieldset",
70
70
  "bk-filter-bar",
71
71
  "bk-folder-browser",
72
+ "bk-footnote",
73
+ "bk-footnotes",
74
+ "bk-footnotes-item",
72
75
  "bk-form-guard",
73
76
  "bk-form-steps",
74
77
  "bk-grid",
@@ -92,7 +92,7 @@ export declare class CropFrame implements ReactiveController {
92
92
  pointerMove(e: PointerEvent, stage: HTMLElement): void;
93
93
  /** The frame after a drag of a grip: the opposite side stays; with a ratio the frame keeps its shape. */
94
94
  private resize;
95
- /** The end of a press: a click without a drag moves the centre of the frame to the point (a grip only resizes). */
95
+ /** The end of a press. A click without a drag changes nothing: the frame moves only on a drag. */
96
96
  pointerUp(e: PointerEvent): void;
97
97
  /**
98
98
  * The keys: the arrows move the frame, Shift and the arrows change its width or height, Plus and Minus zoom the
@@ -210,18 +210,13 @@ class CropFrame {
210
210
  const y = d.hy > 0 ? ay : d.hy < 0 ? ay - h : s.y + s.h / 2 - h / 2;
211
211
  return this.clamp({ x, y, w, h });
212
212
  }
213
- /** The end of a press: a click without a drag moves the centre of the frame to the point (a grip only resizes). */
213
+ /** The end of a press. A click without a drag changes nothing: the frame moves only on a drag. */
214
214
  pointerUp(e) {
215
215
  const d = this.drag;
216
216
  if (!d || e.pointerId !== d.id)
217
217
  return;
218
218
  this.drag = void 0;
219
- if (!d.moved && d.kind !== "resize" && e.type === "pointerup") {
220
- const s = d.start;
221
- this.sel = this.clamp({ ...s, x: d.px - s.w / 2, y: d.py - s.h / 2 });
222
- this.keepInView();
223
- this.options.changed("change");
224
- } else if (d.moved) {
219
+ if (d.moved) {
225
220
  this.keepInView();
226
221
  this.options.changed("change");
227
222
  }
@@ -10,6 +10,7 @@ import { popupMotion, popupSurface } from "./styles.js";
10
10
  import { TextField } from "./text-field.js";
11
11
  import "../components/bk-calendar.js";
12
12
  import "../components/bk-icon.js";
13
+ import { submitImplicitly } from "./submit.js";
13
14
  import "../icons/set/calendar.js";
14
15
  const DIGIT_ZEROS = [1632, 1776, 1984, 2406, 2534, 2662, 2790, 2918, 3046, 3174, 3302, 3430, 3664, 3792, 3872, 4160, 6112, 6160, 65296];
15
16
  function asciiDigits(text) {
@@ -453,7 +454,7 @@ class DateField extends TextField {
453
454
  return;
454
455
  const form = this.internals.form;
455
456
  if (form)
456
- setTimeout(() => form.requestSubmit());
457
+ setTimeout(() => submitImplicitly(form));
457
458
  }
458
459
  /* ---------- popup ---------- */
459
460
  onTriggerPointerdown() {
@@ -0,0 +1,11 @@
1
+ /** Distance (px) that a mouse or pen moves before a press becomes a drag. A shorter movement stays a click. */
2
+ export declare const DRAG_THRESHOLD = 4;
3
+ /** Fields where a press selects text instead of starting a drag. */
4
+ export declare const EDITABLE = "input, textarea, select, [contenteditable]:not([contenteditable='false'])";
5
+ /** Controls that keep their own press and click inside a drag handle (a button in the header of a pane). */
6
+ export declare const INTERACTIVE = "a[href], button, summary, label, input, textarea, select, [contenteditable]:not([contenteditable='false']), [role=button], [role=link], [role=menuitem], [role=checkbox], [role=switch], [role=tab], [role=slider], [role=textbox]";
7
+ /** Calls `preventDefault()`. A listener for events that a drag stops (text selection, touch scrolling). */
8
+ export declare function preventEvent(e: Event): void;
9
+ /** Stops the click that follows the release of a drag: the release must not click the element under the pointer. */
10
+ export declare function suppressClick(): void;
11
+ //# sourceMappingURL=drag.d.ts.map
@@ -0,0 +1,23 @@
1
+ const DRAG_THRESHOLD = 4;
2
+ const EDITABLE = "input, textarea, select, [contenteditable]:not([contenteditable='false'])";
3
+ const INTERACTIVE = `a[href], button, summary, label, ${EDITABLE}, [role=button], [role=link], [role=menuitem], [role=checkbox], [role=switch], [role=tab], [role=slider], [role=textbox]`;
4
+ function preventEvent(e) {
5
+ e.preventDefault();
6
+ }
7
+ function stopClick(e) {
8
+ e.preventDefault();
9
+ e.stopPropagation();
10
+ window.removeEventListener("click", stopClick, true);
11
+ }
12
+ function suppressClick() {
13
+ window.addEventListener("click", stopClick, true);
14
+ setTimeout(() => window.removeEventListener("click", stopClick, true), 0);
15
+ }
16
+ export {
17
+ DRAG_THRESHOLD,
18
+ EDITABLE,
19
+ INTERACTIVE,
20
+ preventEvent,
21
+ suppressClick
22
+ };
23
+ //# sourceMappingURL=drag.js.map
@@ -0,0 +1,3 @@
1
+ /** No built-in English texts: the bundle contains only the catalogs that the app imports (see english.ts). */
2
+ export declare const builtInEnglish: () => undefined;
3
+ //# sourceMappingURL=english-static.d.ts.map
@@ -0,0 +1,5 @@
1
+ const builtInEnglish = () => void 0;
2
+ export {
3
+ builtInEnglish
4
+ };
5
+ //# sourceMappingURL=english-static.js.map
@@ -0,0 +1,8 @@
1
+ import { en } from "../i18n.js";
2
+ /**
3
+ * The catalog that i18n.ts uses as the built-in English texts. The condition `bk-static` replaces this module with
4
+ * english-static.ts: then an app loads English like any other language (`import "@bk2k/ui/i18n/en.js"`).
5
+ * A function, not a value: i18n.ts calls it after `en` exists (the two modules import each other).
6
+ */
7
+ export declare const builtInEnglish: () => typeof en | undefined;
8
+ //# sourceMappingURL=english.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { en } from "../i18n.js";
2
+ const builtInEnglish = () => en;
3
+ export {
4
+ builtInEnglish
5
+ };
6
+ //# sourceMappingURL=english.js.map
@@ -0,0 +1,56 @@
1
+ /** The place of a marker: the number of its note, and its position among the markers of the note. */
2
+ export interface FootnoteRef {
3
+ /** The number of the note. */
4
+ number: number;
5
+ /** The position of the marker among the markers of the note, from 0. */
6
+ index: number;
7
+ /** The number of markers of the note. */
8
+ count: number;
9
+ /** The note. */
10
+ note: FootnoteNote;
11
+ }
12
+ /** A marker (`bk-footnote`). */
13
+ export interface FootnoteMarker extends HTMLElement {
14
+ /** The id of the note. */
15
+ readonly note: string;
16
+ /** Gives the marker its place, or `undefined` when the page has no note with its id. */
17
+ setFootnoteRef(ref: FootnoteRef | undefined): void;
18
+ /** Moves the focus to the marker and shows it. */
19
+ reveal(): void;
20
+ }
21
+ /** A note (`bk-footnotes-item`). */
22
+ export interface FootnoteNote extends HTMLElement {
23
+ /** Gives the note its number and its markers. */
24
+ setFootnoteState(number: number | undefined, markers: FootnoteMarker[]): void;
25
+ /** Moves the focus to the note and shows it. */
26
+ reveal(): void;
27
+ }
28
+ /** Registers a connected marker. */
29
+ export declare function addFootnoteMarker(marker: FootnoteMarker): void;
30
+ /** Removes a disconnected marker. */
31
+ export declare function removeFootnoteMarker(marker: FootnoteMarker): void;
32
+ /** Registers a connected note. */
33
+ export declare function addFootnoteNote(note: FootnoteNote): void;
34
+ /** Removes a disconnected note. */
35
+ export declare function removeFootnoteNote(note: FootnoteNote): void;
36
+ /** Numbers the markers and the notes again in a microtask (once for all changes of a task). */
37
+ export declare function scheduleFootnotes(): void;
38
+ /** Resolves when the numbers are current. */
39
+ export declare function footnotesSettled(): Promise<void>;
40
+ /**
41
+ * Marks the element that a footnote link jumped to (`:state(target)`, as `:target` for a fragment). Only one element
42
+ * of the page is the target: the mark of the earlier target goes away.
43
+ */
44
+ export declare function markFootnoteTarget(el: HTMLElement, internals: ElementInternals): void;
45
+ /** Removes the mark of a target that leaves the page. */
46
+ export declare function clearFootnoteTarget(el: HTMLElement): void;
47
+ /**
48
+ * Shows the target of a footnote link: it moves the focus to `focusable` and scrolls `el` into view. The scroll is
49
+ * smooth, except with reduced motion. `scroll-margin` of `el` keeps it clear of a sticky header.
50
+ */
51
+ export declare function revealFootnoteTarget(el: HTMLElement, internals: ElementInternals, focusable: HTMLElement | null | undefined): void;
52
+ /** The letter of the n-th marker of a note (from 0): a, b, …, z, aa, ab, … */
53
+ export declare function footnoteLetter(index: number): string;
54
+ /** A plain click: the primary button and no modifier key. Other clicks keep the default of the browser. */
55
+ export declare function isPlainClick(e: MouseEvent): boolean;
56
+ //# sourceMappingURL=footnotes.d.ts.map
@@ -0,0 +1,143 @@
1
+ import { isServer } from "lit";
2
+ const markers = /* @__PURE__ */ new Set();
3
+ const notes = /* @__PURE__ */ new Set();
4
+ let pending;
5
+ function addFootnoteMarker(marker) {
6
+ markers.add(marker);
7
+ scheduleFootnotes();
8
+ }
9
+ function removeFootnoteMarker(marker) {
10
+ markers.delete(marker);
11
+ scheduleFootnotes();
12
+ }
13
+ function addFootnoteNote(note) {
14
+ notes.add(note);
15
+ scheduleFootnotes();
16
+ }
17
+ function removeFootnoteNote(note) {
18
+ notes.delete(note);
19
+ scheduleFootnotes();
20
+ }
21
+ function scheduleFootnotes() {
22
+ if (isServer || pending)
23
+ return;
24
+ pending = Promise.resolve().then(() => {
25
+ pending = void 0;
26
+ numberFootnotes();
27
+ });
28
+ }
29
+ function footnotesSettled() {
30
+ return pending ?? Promise.resolve();
31
+ }
32
+ function flatParent(node) {
33
+ if (node instanceof Element && node.assignedSlot)
34
+ return node.assignedSlot;
35
+ if (node instanceof ShadowRoot)
36
+ return node.host;
37
+ return node.parentNode;
38
+ }
39
+ function flatPath(node) {
40
+ const path = [];
41
+ for (let n = node; n; n = flatParent(n))
42
+ path.push(n);
43
+ return path.reverse();
44
+ }
45
+ function compareFlat(a, b) {
46
+ let i = 0;
47
+ while (i < a.length && i < b.length && a[i] === b[i])
48
+ i++;
49
+ if (i === a.length)
50
+ return -1;
51
+ if (i === b.length)
52
+ return 1;
53
+ const x = a[i], y = b[i];
54
+ if (x instanceof ShadowRoot)
55
+ return -1;
56
+ if (y instanceof ShadowRoot)
57
+ return 1;
58
+ return x.compareDocumentPosition(y) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
59
+ }
60
+ function inFlatOrder(nodes) {
61
+ const paths = /* @__PURE__ */ new Map();
62
+ for (const n of nodes)
63
+ paths.set(n, flatPath(n));
64
+ return [...paths.keys()].sort((a, b) => compareFlat(paths.get(a), paths.get(b)));
65
+ }
66
+ function numberFootnotes() {
67
+ const ordered = inFlatOrder(notes);
68
+ const byId = /* @__PURE__ */ new Map();
69
+ for (const note of ordered)
70
+ if (note.id && !byId.has(note.id))
71
+ byId.set(note.id, note);
72
+ const listOf = (note) => note.closest("bk-footnotes");
73
+ const counters = /* @__PURE__ */ new Map();
74
+ const numbers = /* @__PURE__ */ new Map();
75
+ const refs = /* @__PURE__ */ new Map();
76
+ const next = (note) => {
77
+ const list = listOf(note);
78
+ const n = (counters.get(list) ?? 0) + 1;
79
+ counters.set(list, n);
80
+ numbers.set(note, n);
81
+ refs.set(note, []);
82
+ };
83
+ const placed = [];
84
+ for (const marker of inFlatOrder(markers)) {
85
+ const note = marker.note ? byId.get(marker.note) : void 0;
86
+ if (note && !numbers.has(note))
87
+ next(note);
88
+ if (note)
89
+ refs.get(note).push(marker);
90
+ placed.push([marker, note]);
91
+ }
92
+ for (const note of ordered)
93
+ if (byId.get(note.id) === note && !numbers.has(note))
94
+ next(note);
95
+ for (const [marker, note] of placed) {
96
+ const all = note && refs.get(note);
97
+ marker.setFootnoteRef(note && all ? { number: numbers.get(note), index: all.indexOf(marker), count: all.length, note } : void 0);
98
+ }
99
+ for (const note of notes)
100
+ note.setFootnoteState(numbers.get(note), refs.get(note) ?? []);
101
+ }
102
+ let target;
103
+ function markFootnoteTarget(el, internals) {
104
+ if (target && target.el !== el)
105
+ target.internals.states.delete("target");
106
+ target = { el, internals };
107
+ internals.states.add("target");
108
+ }
109
+ function clearFootnoteTarget(el) {
110
+ if (target?.el !== el)
111
+ return;
112
+ target.internals.states.delete("target");
113
+ target = void 0;
114
+ }
115
+ function revealFootnoteTarget(el, internals, focusable) {
116
+ markFootnoteTarget(el, internals);
117
+ focusable?.focus({ preventScroll: true });
118
+ const calm = matchMedia("(prefers-reduced-motion: reduce)").matches;
119
+ el.scrollIntoView({ block: "nearest", behavior: calm ? "instant" : "smooth" });
120
+ }
121
+ function footnoteLetter(index) {
122
+ let s = "";
123
+ for (let n = index + 1; n > 0; n = Math.floor((n - 1) / 26))
124
+ s = String.fromCharCode(97 + (n - 1) % 26) + s;
125
+ return s;
126
+ }
127
+ function isPlainClick(e) {
128
+ return e.button === 0 && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey;
129
+ }
130
+ export {
131
+ addFootnoteMarker,
132
+ addFootnoteNote,
133
+ clearFootnoteTarget,
134
+ footnoteLetter,
135
+ footnotesSettled,
136
+ isPlainClick,
137
+ markFootnoteTarget,
138
+ removeFootnoteMarker,
139
+ removeFootnoteNote,
140
+ revealFootnoteTarget,
141
+ scheduleFootnotes
142
+ };
143
+ //# sourceMappingURL=footnotes.js.map
@@ -1,10 +1,7 @@
1
1
  import { css, html, nothing } from "lit";
2
2
  import { LateLoad } from "./late.js";
3
- const menuParts = new LateLoad(() => Promise.all([
4
- import("../components/bk-menu-context.js"),
5
- import("../components/bk-menu-item.js"),
6
- import("../components/bk-menu-divider.js")
7
- ]));
3
+ import { lateParts } from "#bk/internal/late/handle-menu.js";
4
+ const menuParts = new LateLoad(lateParts, "bk-menu-context", "bk-menu-item", "bk-menu-divider");
8
5
  function loadHandleMenu() {
9
6
  return menuParts.start();
10
7
  }
@@ -0,0 +1,4 @@
1
+ import type { LateParts } from "../late.js";
2
+ /** The drawer of bk-shell-app on a narrow screen. The condition `bk-static` replaces this module with static.ts. */
3
+ export declare const lateParts: LateParts;
4
+ //# sourceMappingURL=bk-shell-app.d.ts.map
@@ -0,0 +1,7 @@
1
+ const lateParts = {
2
+ "bk-drawer": () => import("../../components/bk-drawer.js")
3
+ };
4
+ export {
5
+ lateParts
6
+ };
7
+ //# sourceMappingURL=bk-shell-app.js.map
@@ -0,0 +1,4 @@
1
+ import type { LateParts } from "../late.js";
2
+ /** The elements of the optional features of bk-table. The condition `bk-static` replaces this module with static.ts. */
3
+ export declare const lateParts: LateParts;
4
+ //# sourceMappingURL=bk-table.d.ts.map
@@ -0,0 +1,17 @@
1
+ const lateParts = {
2
+ "bk-checkbox": () => import("../../components/bk-checkbox.js"),
3
+ "bk-filter-bar": () => import("../../components/bk-filter-bar.js"),
4
+ "bk-popover": () => import("../../components/bk-popover.js"),
5
+ "bk-menu-context": () => import("../../components/bk-menu-context.js"),
6
+ "bk-menu-item": () => import("../../components/bk-menu-item.js"),
7
+ "bk-menu-divider": () => import("../../components/bk-menu-divider.js"),
8
+ "bk-menu-label": () => import("../../components/bk-menu-label.js"),
9
+ "bk-input-number": () => import("../../components/bk-input-number.js"),
10
+ "bk-input-text": () => import("../../components/bk-input-text.js"),
11
+ "bk-skeleton": () => import("../../components/bk-skeleton.js"),
12
+ "bk-select": () => import("../../components/bk-select.js")
13
+ };
14
+ export {
15
+ lateParts
16
+ };
17
+ //# sourceMappingURL=bk-table.js.map
@@ -0,0 +1,4 @@
1
+ import type { LateParts } from "../late.js";
2
+ /** The elements of the handle menu (internal/handle-menu.ts). The condition `bk-static` replaces this module with static.ts. */
3
+ export declare const lateParts: LateParts;
4
+ //# sourceMappingURL=handle-menu.d.ts.map
@@ -0,0 +1,9 @@
1
+ const lateParts = {
2
+ "bk-menu-context": () => import("../../components/bk-menu-context.js"),
3
+ "bk-menu-item": () => import("../../components/bk-menu-item.js"),
4
+ "bk-menu-divider": () => import("../../components/bk-menu-divider.js")
5
+ };
6
+ export {
7
+ lateParts
8
+ };
9
+ //# sourceMappingURL=handle-menu.js.map
@@ -0,0 +1,7 @@
1
+ import type { LateParts } from "../late.js";
2
+ /**
3
+ * The late parts of every component in a bundle with the condition `bk-static`: none. The bundle then contains no
4
+ * element that a page does not import. A feature whose element no code defines shows a warning (internal/late.ts).
5
+ */
6
+ export declare const lateParts: LateParts;
7
+ //# sourceMappingURL=static.d.ts.map
@@ -0,0 +1,5 @@
1
+ const lateParts = {};
2
+ export {
3
+ lateParts
4
+ };
5
+ //# sourceMappingURL=static.js.map
@@ -1,14 +1,19 @@
1
+ /** The loader of each element that a component loads late, by tag. */
2
+ export type LateParts = Readonly<Record<string, () => Promise<unknown>>>;
1
3
  /**
2
- * The modules of one optional feature. `start()` loads them once and returns the promise while the load
4
+ * The elements of one optional feature. `start()` loads them once and returns the promise while the load
3
5
  * runs. After the load, and on the server, it returns undefined: the caller can go on at once.
6
+ * An element that is defined already does not load again.
4
7
  */
5
8
  export declare class LateLoad {
6
- private load;
9
+ private parts;
7
10
  /** True when the modules are loaded. The server never loads them: it renders no optional part. */
8
11
  loaded: boolean;
9
12
  private promise?;
10
- constructor(load: () => Promise<unknown>);
13
+ private readonly tags;
14
+ constructor(parts: LateParts, ...tags: string[]);
11
15
  start(): Promise<void> | undefined;
16
+ private load;
12
17
  }
13
18
  /** One promise for the loads that run, or undefined when no load runs. */
14
19
  export declare function lateLoads(...loads: (Promise<void> | undefined | false | null | 0 | "")[]): Promise<unknown> | undefined;
@@ -1,16 +1,19 @@
1
1
  import { isServer } from "lit";
2
+ const warned = /* @__PURE__ */ new Set();
2
3
  class LateLoad {
3
- load;
4
+ parts;
4
5
  /** True when the modules are loaded. The server never loads them: it renders no optional part. */
5
6
  loaded = isServer;
6
7
  promise;
7
- constructor(load) {
8
- this.load = load;
8
+ tags;
9
+ constructor(parts, ...tags) {
10
+ this.parts = parts;
11
+ this.tags = tags;
9
12
  }
10
13
  start() {
11
14
  if (this.loaded)
12
15
  return void 0;
13
- this.promise ??= this.load().then(() => {
16
+ this.promise ??= Promise.all(this.tags.map((tag) => this.load(tag))).then(() => {
14
17
  this.loaded = true;
15
18
  }, (error) => {
16
19
  this.loaded = true;
@@ -18,6 +21,18 @@ class LateLoad {
18
21
  });
19
22
  return this.promise;
20
23
  }
24
+ load(tag) {
25
+ if (customElements.get(tag))
26
+ return void 0;
27
+ const load = this.parts[tag];
28
+ if (load)
29
+ return load();
30
+ if (!warned.has(tag)) {
31
+ warned.add(tag);
32
+ console.warn(`@bk2k/ui: a feature needs <${tag}>, but no code defines it. Add: import "@bk2k/ui/${tag}.js";`);
33
+ }
34
+ return void 0;
35
+ }
21
36
  }
22
37
  function lateLoads(...loads) {
23
38
  const running = loads.filter((l) => !!l);
@@ -5,6 +5,8 @@ export interface NavigateDetail {
5
5
  }
6
6
  /** A function that turns the `href` of an element into the `href` of its `<a>`. */
7
7
  export type LinkResolver = (href: string) => string;
8
+ /** The host name of a link without `www.`, or "". A source shows it as the short name of its address. */
9
+ export declare function sourceHost(href: string | undefined): string;
8
10
  /**
9
11
  * Sets the function that resolves the `href` of every element of the library, for example to add the
10
12
  * locale of the app (`/models` → `/de/models`). `undefined` removes it. The connected elements render again.
@@ -1,5 +1,14 @@
1
1
  import { emitDetail } from "./events.js";
2
2
  let resolver;
3
+ function sourceHost(href) {
4
+ if (!href)
5
+ return "";
6
+ try {
7
+ return new URL(href, globalThis.location?.href).hostname.replace(/^www\./, "");
8
+ } catch {
9
+ return "";
10
+ }
11
+ }
3
12
  const hosts = /* @__PURE__ */ new Set();
4
13
  function setLinkResolver(resolve) {
5
14
  resolver = resolve;
@@ -94,6 +103,7 @@ export {
94
103
  navigateClick,
95
104
  resolveAnchors,
96
105
  resolveHref,
97
- setLinkResolver
106
+ setLinkResolver,
107
+ sourceHost
98
108
  };
99
109
  //# sourceMappingURL=link.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The text of the default slot of an element: its text nodes and the text of its children without a `slot`.
3
+ * Comments do not count: a template library (Lit) puts marker comments into the light DOM, and their data
4
+ * is not text that a user sees. The text of a child element never contains comments (`textContent` of an
5
+ * element reads only its text nodes).
6
+ */
7
+ export declare function ownText(host: Node, separator?: string): string;
8
+ //# sourceMappingURL=own-text.d.ts.map
@@ -0,0 +1,7 @@
1
+ function ownText(host, separator = "") {
2
+ return Array.from(host.childNodes).filter((n) => n.nodeType === Node.TEXT_NODE || n.nodeType === Node.ELEMENT_NODE && !n.hasAttribute("slot")).map((n) => n.textContent ?? "").join(separator);
3
+ }
4
+ export {
5
+ ownText
6
+ };
7
+ //# sourceMappingURL=own-text.js.map
@@ -1,6 +1,6 @@
1
1
  import { unsafeCSS } from "lit";
2
2
  import { tokensCss } from "../tokens.js";
3
- const SCOPE = ":root, [data-theme], [data-bk-scope] {";
3
+ const SCOPE = ":root, [data-theme], [data-bk-scope], :is(:state(bk-scope)) {";
4
4
  function scopeBlock() {
5
5
  const start = tokensCss.indexOf(SCOPE);
6
6
  if (start < 0)
@@ -1,5 +1,8 @@
1
1
  /** `holder` asks for the lock. Asking again does nothing. */
2
2
  export declare function lockScroll(holder: object): void;
3
- /** `holder` gives the lock back. The page scrolls again when no holder is left. */
3
+ /**
4
+ * `holder` gives the lock back. The page scrolls again when no holder is left. The position stays where it is
5
+ * (also where the app scrolled while the modal was open): scroll anchoring does not apply what changed meanwhile.
6
+ */
4
7
  export declare function unlockScroll(holder: object): void;
5
8
  //# sourceMappingURL=scroll-lock.d.ts.map