@bk2k/ui 0.6.8 → 0.7.1

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 (503) hide show
  1. package/BUILDING.md +56 -2
  2. package/CHANGELOG.md +199 -0
  3. package/USAGE.md +102 -28
  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.d.ts +2 -0
  9. package/dist/charts/frame.js +2 -1
  10. package/dist/clipboard.js +1 -0
  11. package/dist/components/bk-alert.js +3 -2
  12. package/dist/components/bk-avatar-group.js +4 -6
  13. package/dist/components/bk-avatar.d.ts +10 -0
  14. package/dist/components/bk-avatar.js +17 -0
  15. package/dist/components/bk-bar.js +2 -0
  16. package/dist/components/bk-button-group.js +1 -1
  17. package/dist/components/bk-button-top.js +2 -1
  18. package/dist/components/bk-button.d.ts +42 -14
  19. package/dist/components/bk-button.js +67 -20
  20. package/dist/components/bk-card.d.ts +7 -0
  21. package/dist/components/bk-card.js +21 -2
  22. package/dist/components/bk-carousel-controls.d.ts +2 -0
  23. package/dist/components/bk-carousel-controls.js +4 -2
  24. package/dist/components/bk-chart-area.d.ts +10 -0
  25. package/dist/components/bk-chart-bar.d.ts +17 -0
  26. package/dist/components/bk-chart-bar.js +25 -4
  27. package/dist/components/bk-chart-line.d.ts +28 -0
  28. package/dist/components/bk-chart-line.js +27 -7
  29. package/dist/components/bk-chip-group.d.ts +2 -2
  30. package/dist/components/bk-chip-group.js +4 -0
  31. package/dist/components/bk-chip.d.ts +55 -8
  32. package/dist/components/bk-chip.js +46 -8
  33. package/dist/components/bk-code.js +6 -2
  34. package/dist/components/bk-columns.d.ts +11 -0
  35. package/dist/components/bk-columns.js +8 -1
  36. package/dist/components/bk-combobox.d.ts +3 -3
  37. package/dist/components/bk-combobox.js +9 -21
  38. package/dist/components/bk-delta.d.ts +10 -0
  39. package/dist/components/bk-delta.js +8 -6
  40. package/dist/components/bk-dialog.d.ts +12 -5
  41. package/dist/components/bk-dialog.js +14 -6
  42. package/dist/components/bk-disclosure.js +4 -2
  43. package/dist/components/bk-drop-target.d.ts +7 -1
  44. package/dist/components/bk-drop-target.js +20 -4
  45. package/dist/components/bk-error-summary.d.ts +5 -0
  46. package/dist/components/bk-error-summary.js +13 -4
  47. package/dist/components/bk-facts.js +3 -2
  48. package/dist/components/bk-footnote.d.ts +73 -0
  49. package/dist/components/bk-footnote.js +97 -0
  50. package/dist/components/bk-footnotes-item.d.ts +92 -0
  51. package/dist/components/bk-footnotes-item.js +139 -0
  52. package/dist/components/bk-footnotes.d.ts +51 -0
  53. package/dist/components/bk-footnotes.js +43 -0
  54. package/dist/components/bk-icon.js +2 -2
  55. package/dist/components/bk-image-compare.d.ts +69 -6
  56. package/dist/components/bk-image-compare.js +116 -32
  57. package/dist/components/bk-image-crop.d.ts +3 -3
  58. package/dist/components/bk-image-editor.d.ts +1 -1
  59. package/dist/components/bk-image-viewer.d.ts +178 -11
  60. package/dist/components/bk-image-viewer.js +310 -52
  61. package/dist/components/bk-input-color.d.ts +2 -5
  62. package/dist/components/bk-input-color.js +0 -14
  63. package/dist/components/bk-input-file.d.ts +17 -0
  64. package/dist/components/bk-input-file.js +18 -8
  65. package/dist/components/bk-input-inline.d.ts +15 -6
  66. package/dist/components/bk-input-inline.js +22 -6
  67. package/dist/components/bk-input-number.js +2 -1
  68. package/dist/components/bk-input-search.d.ts +1 -1
  69. package/dist/components/bk-input-search.js +2 -1
  70. package/dist/components/bk-input-tags.d.ts +219 -0
  71. package/dist/components/bk-input-tags.js +293 -0
  72. package/dist/components/bk-input-text.d.ts +20 -0
  73. package/dist/components/bk-input-text.js +34 -4
  74. package/dist/components/bk-input-time.js +2 -1
  75. package/dist/components/bk-item.js +2 -1
  76. package/dist/components/bk-lightbox.d.ts +37 -4
  77. package/dist/components/bk-lightbox.js +13 -3
  78. package/dist/components/bk-link.d.ts +9 -1
  79. package/dist/components/bk-link.js +14 -4
  80. package/dist/components/bk-menu-item.d.ts +40 -0
  81. package/dist/components/bk-menu-item.js +57 -9
  82. package/dist/components/bk-menu-label.js +2 -1
  83. package/dist/components/bk-menu-list.d.ts +1 -0
  84. package/dist/components/bk-menu-list.js +10 -0
  85. package/dist/components/bk-menu.d.ts +8 -1
  86. package/dist/components/bk-menu.js +16 -5
  87. package/dist/components/bk-message-feedback.d.ts +4 -3
  88. package/dist/components/bk-message-feedback.js +7 -5
  89. package/dist/components/bk-message-list.js +2 -1
  90. package/dist/components/bk-message-source.d.ts +1 -2
  91. package/dist/components/bk-message-source.js +3 -11
  92. package/dist/components/bk-message.js +2 -0
  93. package/dist/components/bk-nav-group.js +1 -1
  94. package/dist/components/bk-nav-item.d.ts +18 -0
  95. package/dist/components/bk-nav-item.js +18 -5
  96. package/dist/components/bk-nav.d.ts +1 -1
  97. package/dist/components/bk-page-cta.d.ts +2 -0
  98. package/dist/components/bk-page-cta.js +10 -1
  99. package/dist/components/bk-page-section.d.ts +1 -1
  100. package/dist/components/bk-page-section.js +3 -9
  101. package/dist/components/bk-pane.d.ts +1 -0
  102. package/dist/components/bk-pane.js +7 -5
  103. package/dist/components/bk-panel.d.ts +1 -1
  104. package/dist/components/bk-panel.js +6 -5
  105. package/dist/components/bk-picture.d.ts +17 -4
  106. package/dist/components/bk-picture.js +8 -1
  107. package/dist/components/bk-segmented-item.d.ts +24 -4
  108. package/dist/components/bk-segmented-item.js +37 -5
  109. package/dist/components/bk-segmented.js +2 -13
  110. package/dist/components/bk-select-cascade.d.ts +1 -1
  111. package/dist/components/bk-select-tree.d.ts +1 -1
  112. package/dist/components/bk-select.d.ts +1 -1
  113. package/dist/components/bk-shell-app.d.ts +10 -4
  114. package/dist/components/bk-shell-app.js +32 -9
  115. package/dist/components/bk-shell-sites.d.ts +2 -1
  116. package/dist/components/bk-shell-sites.js +3 -5
  117. package/dist/components/bk-sortable.js +7 -17
  118. package/dist/components/bk-split-grid.d.ts +104 -3
  119. package/dist/components/bk-split-grid.js +430 -2
  120. package/dist/components/bk-stat-group.js +2 -1
  121. package/dist/components/bk-stat.d.ts +19 -0
  122. package/dist/components/bk-stat.js +8 -4
  123. package/dist/components/bk-steps.js +2 -1
  124. package/dist/components/bk-surface.d.ts +2 -0
  125. package/dist/components/bk-surface.js +6 -3
  126. package/dist/components/bk-table.d.ts +3 -1
  127. package/dist/components/bk-table.js +10 -13
  128. package/dist/components/bk-tabs-item.d.ts +45 -7
  129. package/dist/components/bk-tabs-item.js +51 -20
  130. package/dist/components/bk-tabs-panel.d.ts +6 -3
  131. package/dist/components/bk-tabs-panel.js +6 -0
  132. package/dist/components/bk-tabs.d.ts +52 -8
  133. package/dist/components/bk-tabs.js +181 -97
  134. package/dist/components/bk-text.js +2 -1
  135. package/dist/components/bk-toast-group.d.ts +3 -1
  136. package/dist/components/bk-toast-group.js +11 -1
  137. package/dist/components/bk-tooltip.d.ts +3 -1
  138. package/dist/components/bk-tooltip.js +2 -1
  139. package/dist/components/bk-video.js +2 -2
  140. package/dist/components/bk-zoom.d.ts +3 -1
  141. package/dist/components/confirm.d.ts +15 -0
  142. package/dist/components/confirm.js +27 -4
  143. package/dist/i18n/de.js +12 -1
  144. package/dist/i18n/en.d.ts +2 -0
  145. package/dist/i18n/en.js +3 -0
  146. package/dist/i18n.d.ts +16 -2
  147. package/dist/i18n.js +28 -4
  148. package/dist/icons/brands-static.d.ts +3 -0
  149. package/dist/icons/brands-static.js +5 -0
  150. package/dist/icons/core.d.ts +1 -0
  151. package/dist/icons/core.js +2 -0
  152. package/dist/icons/load-static.d.ts +3 -0
  153. package/dist/icons/load-static.js +5 -0
  154. package/dist/icons/load.js +1 -0
  155. package/dist/icons/registry.js +1 -1
  156. package/dist/icons/set/save-as.d.ts +3 -0
  157. package/dist/icons/set/save-as.js +7 -0
  158. package/dist/index.d.ts +4 -0
  159. package/dist/index.js +4 -0
  160. package/dist/internal/announcer.d.ts +14 -1
  161. package/dist/internal/announcer.js +33 -12
  162. package/dist/internal/backdrop.d.ts +19 -0
  163. package/dist/internal/backdrop.js +29 -0
  164. package/dist/internal/busy.d.ts +3 -2
  165. package/dist/internal/busy.js +4 -5
  166. package/dist/internal/choice-field.js +1 -1
  167. package/dist/internal/choice-item.d.ts +17 -6
  168. package/dist/internal/choice-item.js +20 -9
  169. package/dist/internal/cloak.js +4 -0
  170. package/dist/internal/crop-frame.d.ts +1 -1
  171. package/dist/internal/crop-frame.js +2 -7
  172. package/dist/internal/date-field.js +2 -1
  173. package/dist/internal/define.d.ts +9 -0
  174. package/dist/internal/define.js +47 -1
  175. package/dist/internal/drag.d.ts +11 -0
  176. package/dist/internal/drag.js +23 -0
  177. package/dist/internal/elements.d.ts +6 -0
  178. package/dist/internal/elements.js +5 -0
  179. package/dist/internal/english-static.d.ts +3 -0
  180. package/dist/internal/english-static.js +5 -0
  181. package/dist/internal/english.d.ts +8 -0
  182. package/dist/internal/english.js +6 -0
  183. package/dist/internal/footnotes.d.ts +56 -0
  184. package/dist/internal/footnotes.js +143 -0
  185. package/dist/internal/handle-menu.js +2 -5
  186. package/dist/internal/hue.d.ts +8 -0
  187. package/dist/internal/hue.js +15 -4
  188. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  189. package/dist/internal/late/bk-shell-app.js +7 -0
  190. package/dist/internal/late/bk-table.d.ts +4 -0
  191. package/dist/internal/late/bk-table.js +17 -0
  192. package/dist/internal/late/bk-tabs.d.ts +4 -0
  193. package/dist/internal/late/bk-tabs.js +8 -0
  194. package/dist/internal/late/handle-menu.d.ts +4 -0
  195. package/dist/internal/late/handle-menu.js +9 -0
  196. package/dist/internal/late/static.d.ts +7 -0
  197. package/dist/internal/late/static.js +5 -0
  198. package/dist/internal/late.d.ts +8 -3
  199. package/dist/internal/late.js +19 -4
  200. package/dist/internal/link.d.ts +2 -0
  201. package/dist/internal/link.js +11 -1
  202. package/dist/internal/own-text.d.ts +8 -0
  203. package/dist/internal/own-text.js +7 -0
  204. package/dist/internal/scope.js +1 -1
  205. package/dist/internal/scroll-lock.d.ts +4 -1
  206. package/dist/internal/scroll-lock.js +17 -4
  207. package/dist/internal/slider.js +2 -1
  208. package/dist/internal/styles.js +3 -0
  209. package/dist/internal/submit.d.ts +23 -0
  210. package/dist/internal/submit.js +57 -0
  211. package/dist/internal/tags.d.ts +15 -0
  212. package/dist/internal/tags.js +44 -0
  213. package/dist/internal/text-field.d.ts +2 -0
  214. package/dist/internal/text-field.js +8 -0
  215. package/dist/internal/toggle-control.js +3 -1
  216. package/dist/jsx.d.ts +222 -54
  217. package/dist/kit.d.ts +1 -0
  218. package/dist/kit.js +3 -0
  219. package/dist/reset.css +10 -0
  220. package/dist/standalone/all.js +226 -221
  221. package/dist/standalone/appearance.js +1 -1
  222. package/dist/standalone/bk-accordion-item.js +4 -4
  223. package/dist/standalone/bk-accordion.js +2 -2
  224. package/dist/standalone/bk-action-bar.js +3 -3
  225. package/dist/standalone/bk-alert-offline.js +1 -2
  226. package/dist/standalone/bk-alert.js +17 -13
  227. package/dist/standalone/bk-app-state.js +1 -1
  228. package/dist/standalone/bk-attachment.js +4 -4
  229. package/dist/standalone/bk-avatar-group.js +12 -10
  230. package/dist/standalone/bk-avatar.js +15 -5
  231. package/dist/standalone/bk-badge.js +2 -2
  232. package/dist/standalone/bk-bar.js +3 -1
  233. package/dist/standalone/bk-brand.js +3 -3
  234. package/dist/standalone/bk-breadcrumbs.js +5 -5
  235. package/dist/standalone/bk-button-copy.js +7 -7
  236. package/dist/standalone/bk-button-group.js +5 -5
  237. package/dist/standalone/bk-button-share.js +7 -7
  238. package/dist/standalone/bk-button-top.js +9 -8
  239. package/dist/standalone/bk-button.js +74 -34
  240. package/dist/standalone/bk-calendar-event.js +1 -1
  241. package/dist/standalone/bk-calendar-week.js +3 -3
  242. package/dist/standalone/bk-calendar.js +4 -4
  243. package/dist/standalone/bk-card.js +26 -7
  244. package/dist/standalone/bk-carousel-controls.js +7 -6
  245. package/dist/standalone/bk-carousel-item.js +2 -2
  246. package/dist/standalone/bk-carousel.js +1 -1
  247. package/dist/standalone/bk-chart-area.js +1 -1
  248. package/dist/standalone/bk-chart-bar-list.js +8 -8
  249. package/dist/standalone/bk-chart-bar.js +145 -117
  250. package/dist/standalone/bk-chart-bridge.js +7 -7
  251. package/dist/standalone/bk-chart-bullet.js +6 -6
  252. package/dist/standalone/bk-chart-calendar.js +7 -7
  253. package/dist/standalone/bk-chart-heatmap.js +7 -7
  254. package/dist/standalone/bk-chart-histogram.js +5 -5
  255. package/dist/standalone/bk-chart-legend.js +6 -6
  256. package/dist/standalone/bk-chart-line.js +128 -107
  257. package/dist/standalone/bk-chart-mark.js +1 -1
  258. package/dist/standalone/bk-chart-scatter.js +6 -6
  259. package/dist/standalone/bk-chart-sparkline.js +6 -6
  260. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  261. package/dist/standalone/bk-chart-tracker.js +6 -6
  262. package/dist/standalone/bk-chart-waterfall.js +6 -6
  263. package/dist/standalone/bk-checkbox-group.js +7 -7
  264. package/dist/standalone/bk-checkbox.js +4 -4
  265. package/dist/standalone/bk-chip-group.js +11 -7
  266. package/dist/standalone/bk-chip.js +59 -18
  267. package/dist/standalone/bk-cluster.js +1 -1
  268. package/dist/standalone/bk-code-diff.js +4 -4
  269. package/dist/standalone/bk-code-stack.js +4 -4
  270. package/dist/standalone/bk-code.js +10 -6
  271. package/dist/standalone/bk-color-panel.js +5 -5
  272. package/dist/standalone/bk-columns.js +13 -5
  273. package/dist/standalone/bk-combobox.js +23 -31
  274. package/dist/standalone/bk-command-menu.js +6 -6
  275. package/dist/standalone/bk-command-palette.js +8 -7
  276. package/dist/standalone/bk-composer.js +6 -6
  277. package/dist/standalone/bk-delta.js +11 -10
  278. package/dist/standalone/bk-diagram.js +1 -1
  279. package/dist/standalone/bk-dialog.js +1 -1
  280. package/dist/standalone/bk-disclosure.js +7 -5
  281. package/dist/standalone/bk-divider.js +5 -5
  282. package/dist/standalone/bk-drawer.js +3 -3
  283. package/dist/standalone/bk-drop-target.js +12 -6
  284. package/dist/standalone/bk-empty-state.js +3 -3
  285. package/dist/standalone/bk-error-summary.js +9 -6
  286. package/dist/standalone/bk-facts-item.js +2 -2
  287. package/dist/standalone/bk-facts.js +9 -8
  288. package/dist/standalone/bk-feature.js +3 -3
  289. package/dist/standalone/bk-fieldset.js +3 -3
  290. package/dist/standalone/bk-filter-bar.js +4 -4
  291. package/dist/standalone/bk-folder-browser.js +4 -4
  292. package/dist/standalone/bk-footnote.js +82 -0
  293. package/dist/standalone/bk-footnotes-item.js +122 -0
  294. package/dist/standalone/bk-footnotes.js +37 -0
  295. package/dist/standalone/bk-form-guard.js +2 -2
  296. package/dist/standalone/bk-form-steps.js +3 -3
  297. package/dist/standalone/bk-grid.js +1 -1
  298. package/dist/standalone/bk-icon-tile.js +3 -3
  299. package/dist/standalone/bk-icon.js +1 -1
  300. package/dist/standalone/bk-image-compare.js +127 -58
  301. package/dist/standalone/bk-image-crop.js +6 -6
  302. package/dist/standalone/bk-image-editor.js +1 -1
  303. package/dist/standalone/bk-image-viewer.js +283 -92
  304. package/dist/standalone/bk-input-code.js +4 -4
  305. package/dist/standalone/bk-input-color.js +4 -14
  306. package/dist/standalone/bk-input-date-range.js +2 -2
  307. package/dist/standalone/bk-input-date.js +2 -2
  308. package/dist/standalone/bk-input-file.js +22 -15
  309. package/dist/standalone/bk-input-group.js +4 -4
  310. package/dist/standalone/bk-input-inline.js +17 -10
  311. package/dist/standalone/bk-input-number.js +9 -8
  312. package/dist/standalone/bk-input-rating.js +6 -6
  313. package/dist/standalone/bk-input-rich.js +1 -1
  314. package/dist/standalone/bk-input-search.js +23 -22
  315. package/dist/standalone/bk-input-slider-range.js +5 -5
  316. package/dist/standalone/bk-input-slider.js +5 -5
  317. package/dist/standalone/bk-input-tags.js +224 -0
  318. package/dist/standalone/bk-input-text.js +1 -1
  319. package/dist/standalone/bk-input-time-zone.js +1 -1
  320. package/dist/standalone/bk-input-time.js +29 -28
  321. package/dist/standalone/bk-item-group.js +3 -3
  322. package/dist/standalone/bk-item.js +12 -11
  323. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  324. package/dist/standalone/bk-kbd.js +68 -1
  325. package/dist/standalone/bk-lightbox.js +24 -7
  326. package/dist/standalone/bk-lines.js +1 -1
  327. package/dist/standalone/bk-link.js +33 -19
  328. package/dist/standalone/bk-listbox-columns.js +8 -8
  329. package/dist/standalone/bk-listbox-item.js +1 -1
  330. package/dist/standalone/bk-listbox-search.js +7 -7
  331. package/dist/standalone/bk-listbox-transfer.js +6 -6
  332. package/dist/standalone/bk-listbox.js +7 -7
  333. package/dist/standalone/bk-logo-wall.js +2 -2
  334. package/dist/standalone/bk-logo.js +4 -4
  335. package/dist/standalone/bk-menu-bar.js +3 -3
  336. package/dist/standalone/bk-menu-context.js +1 -1
  337. package/dist/standalone/bk-menu-divider.js +2 -2
  338. package/dist/standalone/bk-menu-item.js +73 -29
  339. package/dist/standalone/bk-menu-label.js +7 -6
  340. package/dist/standalone/bk-menu-list.js +10 -4
  341. package/dist/standalone/bk-menu.js +19 -10
  342. package/dist/standalone/bk-message-approval.js +4 -4
  343. package/dist/standalone/bk-message-branches.js +3 -3
  344. package/dist/standalone/bk-message-citation.js +10 -10
  345. package/dist/standalone/bk-message-feedback.js +10 -6
  346. package/dist/standalone/bk-message-list.js +6 -5
  347. package/dist/standalone/bk-message-reasoning.js +5 -5
  348. package/dist/standalone/bk-message-source.js +13 -21
  349. package/dist/standalone/bk-message-tool-group.js +5 -5
  350. package/dist/standalone/bk-message-tool.js +5 -5
  351. package/dist/standalone/bk-message.js +6 -4
  352. package/dist/standalone/bk-meter.js +3 -3
  353. package/dist/standalone/bk-model-viewer.js +1 -1
  354. package/dist/standalone/bk-nav-divider.js +2 -2
  355. package/dist/standalone/bk-nav-group.js +9 -9
  356. package/dist/standalone/bk-nav-item.js +31 -23
  357. package/dist/standalone/bk-nav-toc.js +3 -3
  358. package/dist/standalone/bk-nav.js +3 -3
  359. package/dist/standalone/bk-overflow.js +3 -3
  360. package/dist/standalone/bk-page-cta.js +13 -4
  361. package/dist/standalone/bk-page-footer-column.js +2 -2
  362. package/dist/standalone/bk-page-footer.js +3 -3
  363. package/dist/standalone/bk-page-header.js +3 -3
  364. package/dist/standalone/bk-page-hero.js +3 -3
  365. package/dist/standalone/bk-page-pager.js +5 -5
  366. package/dist/standalone/bk-page-section.js +6 -6
  367. package/dist/standalone/bk-pagination.js +6 -6
  368. package/dist/standalone/bk-pane.js +10 -9
  369. package/dist/standalone/bk-panel.js +9 -10
  370. package/dist/standalone/bk-period-nav.js +4 -4
  371. package/dist/standalone/bk-picture.js +1 -166
  372. package/dist/standalone/bk-popover-help.js +3 -3
  373. package/dist/standalone/bk-popover.js +2 -2
  374. package/dist/standalone/bk-presence-cursor.js +3 -3
  375. package/dist/standalone/bk-preview.js +4 -4
  376. package/dist/standalone/bk-progress.js +3 -3
  377. package/dist/standalone/bk-prose.js +3 -3
  378. package/dist/standalone/bk-qr-code.js +1 -1
  379. package/dist/standalone/bk-radio-group.js +7 -7
  380. package/dist/standalone/bk-radio.js +3 -3
  381. package/dist/standalone/bk-rating.js +5 -5
  382. package/dist/standalone/bk-scroll.js +3 -3
  383. package/dist/standalone/bk-segmented-item.js +40 -16
  384. package/dist/standalone/bk-segmented.js +17 -15
  385. package/dist/standalone/bk-select-cascade.js +3 -3
  386. package/dist/standalone/bk-select-tree.js +4 -4
  387. package/dist/standalone/bk-select.js +5 -5
  388. package/dist/standalone/bk-shell-app.js +1 -1221
  389. package/dist/standalone/bk-shell-centered.js +2 -2
  390. package/dist/standalone/bk-shell-sites.js +5 -7
  391. package/dist/standalone/bk-skeleton.js +2 -2
  392. package/dist/standalone/bk-sortable.js +55 -60
  393. package/dist/standalone/bk-spinner.js +2 -2
  394. package/dist/standalone/bk-split-grid.js +324 -44
  395. package/dist/standalone/bk-split.js +8 -8
  396. package/dist/standalone/bk-stack.js +1 -1
  397. package/dist/standalone/bk-stat-group.js +8 -7
  398. package/dist/standalone/bk-stat.js +12 -9
  399. package/dist/standalone/bk-status-dot.js +3 -3
  400. package/dist/standalone/bk-steps-item.js +5 -5
  401. package/dist/standalone/bk-steps.js +8 -7
  402. package/dist/standalone/bk-surface.js +1 -1
  403. package/dist/standalone/bk-swatch-group.js +8 -8
  404. package/dist/standalone/bk-swatch-palette.js +1 -1
  405. package/dist/standalone/bk-swatch.js +2 -2
  406. package/dist/standalone/bk-switch.js +4 -4
  407. package/dist/standalone/bk-table.js +1 -1937
  408. package/dist/standalone/bk-tabs-item.js +58 -35
  409. package/dist/standalone/bk-tabs-panel.js +7 -3
  410. package/dist/standalone/bk-tabs.js +3 -352
  411. package/dist/standalone/bk-tasks-item.js +4 -4
  412. package/dist/standalone/bk-tasks.js +2 -2
  413. package/dist/standalone/bk-testimonial.js +3 -3
  414. package/dist/standalone/bk-text.js +21 -20
  415. package/dist/standalone/bk-time-countdown.js +4 -4
  416. package/dist/standalone/bk-time-relative.js +3 -3
  417. package/dist/standalone/bk-timeline-item.js +4 -4
  418. package/dist/standalone/bk-timeline.js +2 -2
  419. package/dist/standalone/bk-toast-group.js +1 -1
  420. package/dist/standalone/bk-toast.js +4 -4
  421. package/dist/standalone/bk-toolbar.js +2 -2
  422. package/dist/standalone/bk-tooltip.js +8 -7
  423. package/dist/standalone/bk-tree-item.js +6 -6
  424. package/dist/standalone/bk-tree.js +5 -5
  425. package/dist/standalone/bk-video.js +6 -6
  426. package/dist/standalone/bk-visually-hidden.js +2 -2
  427. package/dist/standalone/bk-zoom.js +5 -5
  428. package/dist/standalone/chunks/announcer-6tMlCOq1.js +41 -0
  429. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  430. package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-hCLuG-RM.js} +3 -3
  431. package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-_dudBMVq.js} +4 -4
  432. package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-BB2odomE.js} +5 -5
  433. package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DcvwnOtN.js} +59 -25
  434. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-D4kI4F18.js} +4 -3
  435. package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-SRVkHI-4.js} +5 -5
  436. package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
  437. package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-AmDv87E5.js} +6 -6
  438. package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-2n89GDIT.js} +73 -54
  439. package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-BoNYBd6W.js} +4 -4
  440. package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
  441. package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CSFfc8As.js} +3 -3
  442. package/dist/standalone/chunks/bk-shell-app-BlCOG25y.js +1236 -0
  443. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-BULRdKam.js} +9 -7
  444. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-Cqj85tSW.js} +6 -6
  445. package/dist/standalone/chunks/bk-table-DWlD7yoM.js +1945 -0
  446. package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
  447. package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-5nZg7BaJ.js} +27 -24
  448. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  449. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-eG3uHonz.js} +5 -4
  450. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  451. package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-B0oe_9fI.js} +6 -6
  452. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  453. package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
  454. package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
  455. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  456. package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-Dy1_qxNv.js} +48 -47
  457. package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
  458. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  459. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  460. package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-Bmk0SRDX.js} +2 -2
  461. package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
  462. package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BAe9fPYJ.js} +14 -33
  463. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-B2kF-b8p.js} +1 -1
  464. package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
  465. package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
  466. package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
  467. package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
  468. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  469. package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
  470. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-ySaDL-dW.js} +2 -2
  471. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  472. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  473. package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
  474. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  475. package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
  476. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  477. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  478. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  479. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BAUc_LqI.js} +1 -1
  480. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  481. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  482. package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
  483. package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
  484. package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CufOGdfr.js} +17 -11
  485. package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-Cgqp1jhf.js} +5 -3
  486. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  487. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-D-qgACnE.js} +1 -1
  488. package/dist/standalone/confirm.js +27 -14
  489. package/dist/standalone/i18n-de.js +13 -2
  490. package/dist/standalone/icons.js +100 -98
  491. package/dist/standalone/links.js +1 -1
  492. package/dist/standalone/reset.css +10 -0
  493. package/dist/standalone/toast.js +1 -1
  494. package/dist/standalone/tokens.css +6 -5
  495. package/dist/tokens.css +6 -5
  496. package/dist/tokens.js +4 -3
  497. package/package.json +25 -2
  498. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  499. package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
  500. package/dist/standalone/chunks/define-CzVPD4Zi.js +0 -30
  501. package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
  502. package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
  503. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -8,12 +8,14 @@ import { ifDefined } from "lit/directives/if-defined.js";
8
8
  import { base, focusRing, srOnly, hueStyles, hueSelector } from "../internal/styles.js";
9
9
  import "./bk-icon.js";
10
10
  import { lightDom } from "../internal/server.js";
11
+ import { SlotController } from "../internal/slots.js";
11
12
  import "../icons/set/check.js";
12
13
  import "../icons/set/close.js";
13
14
  import "../icons/set/error.js";
14
15
  import "../icons/set/info.js";
15
16
  import "../icons/set/label.js";
16
17
  import "../icons/set/remove.js";
18
+ import "../icons/set/undo.js";
17
19
  import "../icons/set/warning.js";
18
20
  class BkChip extends LitElement {
19
21
  static properties = {
@@ -32,11 +34,14 @@ class BkChip extends LitElement {
32
34
  count: {},
33
35
  grouped: { state: true },
34
36
  removeLabel: { attribute: "remove-label" },
37
+ removed: { type: Boolean, reflect: true },
38
+ restoreLabel: { attribute: "restore-label" },
35
39
  href: {},
36
40
  target: {},
37
41
  rel: {},
38
42
  download: {}
39
43
  };
44
+ slots = new SlotController(this);
40
45
  links = new LinkController(this);
41
46
  clip = new CopyController(this, void 0, (error) => emitDetail(this, "copyfailed", { error }));
42
47
  constructor() {
@@ -50,6 +55,8 @@ class BkChip extends LitElement {
50
55
  this.copy = false;
51
56
  this.grouped = false;
52
57
  this.removeLabel = "";
58
+ this.removed = false;
59
+ this.restoreLabel = "";
53
60
  }
54
61
  connectedCallback() {
55
62
  super.connectedCallback();
@@ -92,17 +99,33 @@ class BkChip extends LitElement {
92
99
  border-radius: var(--bk-chip-radius, var(--bk-radius-chip, var(--bk-radius-sm))); border: var(--bk-border-width) solid var(--bk-chip-border, transparent);
93
100
  background: var(--_bk-chip-bg); color: var(--_bk-chip-fg);
94
101
  font-size: var(--bk-chip-font-size, var(--_bk-chip-fs)); font-weight: var(--bk-chip-font-weight, var(--bk-control-weight, var(--bk-weight-medium)));
102
+ text-transform: var(--bk-chip-transform, none); letter-spacing: var(--bk-chip-tracking, 0em);
95
103
  line-height: 1; white-space: nowrap;
96
104
  }
97
105
  :host([variant="solid"]) .chip { background: var(--_bk-chip-fill, var(--_bk-chip-solid)); color: var(--_bk-chip-on); }
98
106
  :host([variant="outline"]) .chip { background: transparent; border-color: var(--bk-chip-border, color-mix(in oklab, var(--_bk-chip-fg) 40%, transparent)); }
99
107
  :host([variant="dashed"]) .chip { background: transparent; border-style: dashed; border-color: var(--bk-chip-border, color-mix(in oklab, var(--_bk-chip-fg) 60%, transparent)); }
108
+ :host([variant="text"]) .chip { background: transparent; border-color: transparent; padding-inline: var(--bk-chip-text-padding-inline, 0); }
109
+ :host([variant="text"][selected]) .chip { background: transparent; border-color: transparent; }
110
+ :host([variant="text"]) .remove { margin-inline-end: 0; }
111
+ /* Without padding the visible chip can be narrower than --bk-target-min: the hit area of a link or copy chip grows. */
112
+ :host([variant="text"]) .link::after {
113
+ inset-block: min(calc(-1 * var(--bk-border-width)), calc((100% - var(--bk-target-min)) / 2));
114
+ inset-inline: min(calc(-1 * var(--bk-border-width)), calc((100% - var(--bk-target-min)) / 2));
115
+ }
116
+ .end { display: inline-flex; align-items: center; gap: inherit; min-width: 0; }
117
+ .end[hidden] { display: none; }
100
118
  .count { color: var(--bk-chip-count-fg, inherit); font-variant-numeric: tabular-nums; }
101
119
  button.link { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
102
120
  :host([selected]) .chip {
103
121
  background: var(--bk-chip-selected-bg, var(--bk-accent-soft)); color: var(--bk-chip-selected-fg, var(--bk-accent-text));
104
122
  border-color: var(--bk-chip-selected-border, var(--bk-accent-solid));
105
123
  }
124
+ /* removed: a muted chip without fill, text struck through. It comes after the variants, so it wins for all of them. */
125
+ :host([removed]) .chip { background: var(--bk-chip-removed-bg, transparent); color: var(--bk-chip-removed-fg, var(--bk-text-muted)); }
126
+ :host([removed][variant="dashed"]) .chip, :host([removed][variant="outline"]) .chip { border-color: var(--bk-chip-border, color-mix(in oklab, var(--bk-chip-removed-fg, var(--bk-text-muted)) 40%, transparent)); }
127
+ :host([removed][selected]) .chip { border-color: var(--bk-chip-border, transparent); }
128
+ :host([removed]) .label, :host([removed]) .count { text-decoration: var(--bk-chip-removed-decoration, line-through); }
106
129
  :host([overflow="ellipsis"]) { min-width: 0; }
107
130
  /* href: the link covers the chip; the remove button sits above it. */
108
131
  .chip { position: relative; }
@@ -114,7 +137,8 @@ class BkChip extends LitElement {
114
137
  .remove { z-index: 1; }
115
138
  @media (forced-colors: active) { .chip:has(.link:focus-visible) { outline-color: Highlight; } }
116
139
  /* The clip of the ellipsis reaches past the line box (line-height 1), so ascenders and descenders (g, y, É) stay whole. */
117
- .label { overflow: hidden; text-overflow: ellipsis; padding-block: 0.25em; margin-block: -0.25em; }
140
+ /* Letter spacing also follows the last letter: the label gives it back, so the text stays centred. */
141
+ .label { overflow: hidden; text-overflow: ellipsis; padding-block: 0.25em; margin-block: -0.25em; margin-inline-end: calc(-1 * var(--bk-chip-tracking, 0em)); }
118
142
  .dot { width: var(--bk-chip-dot-size, var(--bk-space-1-5)); height: var(--bk-chip-dot-size, var(--bk-space-1-5)); border-radius: 50%; background: currentColor; flex: none; }
119
143
  bk-icon, ::slotted(bk-icon) { --bk-icon-size: 1.15em; }
120
144
  .remove {
@@ -130,26 +154,38 @@ class BkChip extends LitElement {
130
154
  .remove:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset); }
131
155
  `];
132
156
  i18n = new LocalizeController(this);
157
+ get restoreName() {
158
+ const item = this.itemText;
159
+ return this.restoreLabel || (item ? this.i18n.t("restoreItem", { item }) : this.i18n.t("restore"));
160
+ }
133
161
  get removeName() {
134
- const item = lightDom(this)?.textContent?.trim();
162
+ const item = this.itemText;
135
163
  return this.removeLabel || (item ? this.i18n.t("removeItem", { item }) : this.i18n.t("remove"));
136
164
  }
165
+ /** The text of the chip: the default slot, without the `start` and `end` slots. */
166
+ slotText(inEnd) {
167
+ const nodes = [...lightDom(this)?.childNodes ?? []].filter((n) => (n instanceof Element && n.getAttribute("slot") === "end") === inEnd && !(!inEnd && n instanceof Element && n.hasAttribute("slot")));
168
+ return nodes.map((n) => n.textContent ?? "").join(" ").replace(/\s+/g, " ").trim();
169
+ }
137
170
  get itemText() {
138
- return (lightDom(this)?.textContent ?? "").replace(/\s+/g, " ").trim();
171
+ return this.slotText(false);
139
172
  }
140
173
  /** Copies `copy-text`, or the text of the chip. Resolves `true` when the copy succeeds. */
141
174
  async copyToClipboard(text = this.copyText ?? this.itemText) {
142
175
  return this.clip.copy(text);
143
176
  }
144
177
  renderCopy() {
145
- const item = [this.itemText, this.count].filter(Boolean).join(" ");
178
+ const item = [this.itemText, this.count, this.slotText(true)].filter(Boolean).join(" ");
146
179
  const state = this.clip.failed ? this.i18n.t("copyFailed") : this.clip.copied ? this.i18n.t("copied") : "";
147
180
  return html`<button class="link" part="copy" type="button" aria-label=${this.copyLabel || this.i18n.t("copyItem", { item })}
148
- @click=${() => this.copyToClipboard()}><span class="label"><slot></slot></span></button>${this.count ? html`<span class="count" part="count" aria-hidden="true" @click=${() => this.copyToClipboard()}>${this.count}</span>` : nothing}<span class="sr-only" aria-live="polite">${state}</span>`;
181
+ @click=${() => this.copyToClipboard()}><span class="label"><slot></slot></span></button>${this.count ? html`<span class="count" part="count" aria-hidden="true" @click=${() => this.copyToClipboard()}>${this.count}</span>` : nothing}${this.renderEnd(true)}<span class="sr-only" aria-live="polite">${state}</span>`;
149
182
  }
150
183
  renderCount() {
151
184
  return this.count ? html`<span class="count" part="count">${this.count}</span>` : nothing;
152
185
  }
186
+ renderEnd(copy = false) {
187
+ return html`<span class="end" part="end" ?hidden=${!this.slots.has("end")} aria-hidden=${ifDefined(copy ? "true" : void 0)} @click=${copy ? () => this.copyToClipboard() : nothing}><slot name="end"></slot></span>`;
188
+ }
153
189
  renderLink() {
154
190
  return html`<a class="link" part="link" href=${this.links.href(this.href)} @click=${this.links.click} target=${ifDefined(this.target)}
155
191
  rel=${ifDefined(this.rel ?? (this.target === "_blank" ? "noopener noreferrer" : void 0))} download=${ifDefined(this.download)}><span class="label"><slot></slot></span>${this.target === "_blank" ? html`<span class="sr-only">${this.i18n.t("opensInNewTab")}</span>` : nothing}</a>`;
@@ -159,9 +195,11 @@ class BkChip extends LitElement {
159
195
  ${this.dot ? html`<span class="dot"></span>` : nothing}
160
196
  ${this.selected ? html`<bk-icon class="check" name="check"></bk-icon>` : nothing}
161
197
  <slot name="start">${this.copy && this.clip.failed ? html`<bk-icon name="error"></bk-icon>` : this.copy && this.clip.copied ? html`<bk-icon name="check"></bk-icon>` : this.icon ? html`<bk-icon name=${this.icon}></bk-icon>` : nothing}</slot>
162
- ${this.copy ? this.renderCopy() : this.href ? html`${this.renderLink()}${this.renderCount()}` : html`<span class="label"><slot></slot></span>${this.renderCount()}`}
163
- ${this.removable ? html`<button class="remove focusable" part="remove" type="button" tabindex=${this.grouped ? "-1" : nothing} aria-label=${this.removeName} title=${this.removeName}
164
- @click=${() => emit(this, "remove")}><bk-icon name="close"></bk-icon></button>` : nothing}
198
+ ${this.copy ? this.renderCopy() : this.href ? html`${this.renderLink()}${this.renderCount()}${this.renderEnd()}` : html`<span class="label"><slot></slot></span>${this.renderCount()}${this.renderEnd()}`}
199
+ ${this.removed ? html`<span class="sr-only">${this.i18n.t("removed")}</span>` : nothing}
200
+ ${this.removable ? this.removed ? html`<button class="remove focusable" part="remove" type="button" tabindex=${this.grouped ? "-1" : nothing} aria-label=${this.restoreName} title=${this.restoreName}
201
+ @click=${() => emit(this, "restore")}><bk-icon name="undo"></bk-icon></button>` : html`<button class="remove focusable" part="remove" type="button" tabindex=${this.grouped ? "-1" : nothing} aria-label=${this.removeName} title=${this.removeName}
202
+ @click=${() => emit(this, "remove")}><bk-icon name="close"></bk-icon></button>` : nothing}
165
203
  </span>`;
166
204
  }
167
205
  }
@@ -337,7 +337,11 @@ class BkCode extends LitElement {
337
337
  pre:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
338
338
  /* Without a header the copy button floats in the top end corner; the text keeps clear of it. */
339
339
  .float { position: absolute; inset-block-start: max(var(--bk-space-1), calc(var(--_bk-code-pad-b) + round(calc((var(--bk-code-line-height, var(--bk-line-height-body)) - var(--bk-control-sm)) / 2), 1px))); inset-inline-end: var(--bk-space-1); }
340
- .float ~ pre { padding-inline-end: calc(var(--bk-control-sm) + var(--bk-space-2)); min-block-size: calc(var(--bk-control-sm) + 2 * var(--bk-space-1)); }
340
+ .float ~ pre { --_bk-code-float: calc(var(--bk-control-sm) + var(--bk-space-2)); min-block-size: calc(var(--bk-control-sm) + 2 * var(--bk-space-1)); }
341
+ /* A block that scrolls ends before the button, so a long line scrolls beside it and not under it. A block that wraps keeps the
342
+ space as padding: the text breaks before the button. */
343
+ :host(:not([wrap])) .float ~ pre { margin-inline-end: var(--_bk-code-float); }
344
+ :host([wrap]) .float ~ pre { padding-inline-end: var(--_bk-code-float); }
341
345
  code { font: inherit; }
342
346
  /* Lines: each line is a block as wide as the longest line, so a mark reaches the end of a line that scrolls. The
343
347
  pre gives its inline padding to the lines, so a mark fills the block from edge to edge. */
@@ -345,7 +349,7 @@ class BkCode extends LitElement {
345
349
  code.lines { display: grid; min-inline-size: 100%; inline-size: max-content; counter-reset: bk-code-line var(--_bk-code-first); }
346
350
  :host([wrap]) code.lines { inline-size: auto; }
347
351
  .line { display: block; min-block-size: 1lh; padding-inline: var(--_bk-code-pad-i); }
348
- .float ~ pre .line { padding-inline-end: calc(var(--bk-control-sm) + var(--bk-space-2)); }
352
+ :host([wrap]) .float ~ pre .line { padding-inline-end: var(--_bk-code-float); }
349
353
  .line.mark { background: var(--_bk-code-mark); }
350
354
  /* The numbers are generated content: no part of a selection, of the copied text or of what screen readers read. */
351
355
  code.numbered .line { counter-increment: bk-code-line; padding-inline-start: calc(var(--_bk-code-pad-i) + var(--_bk-code-digits) * 1ch + var(--bk-code-line-number-gap, var(--bk-space-3))); text-indent: 0; position: relative; }
@@ -20,6 +20,11 @@ export type ColumnsMode = "split" | "stack" | "flow";
20
20
  * height of the element (`mode="stack"`);
21
21
  * - below that they stack in the normal document flow, and the page scrolls (`mode="flow"`).
22
22
  *
23
+ * Directly in a `<bk-shell-app>`, the columns also flow while the shell is narrow (`:state(narrow)`, the shell shows
24
+ * its navigation in a drawer). So the columns and the drawer change at the same width. While the columns flow, the
25
+ * shell is a page, not a workspace: the document scrolls, the header stays in view, and `scroll-key` restores the
26
+ * position of the document.
27
+ *
23
28
  * With `scroll-key` the element saves the scroll position of every column per key in the app state (entry
24
29
  * `columns:<key>`, session scope, see `<bk-app-state>`; for example the history key of the router).
25
30
  * A key that the element saw before restores its positions. A new key starts at the top.
@@ -84,6 +89,10 @@ export declare class BkColumns extends LitElement {
84
89
  reflect: boolean;
85
90
  useDefault: boolean;
86
91
  };
92
+ narrow: {
93
+ type: BooleanConstructor;
94
+ attribute: boolean;
95
+ };
87
96
  scrolling: {
88
97
  state: boolean;
89
98
  };
@@ -112,6 +121,8 @@ export declare class BkColumns extends LitElement {
112
121
  endLabel: string | undefined;
113
122
  /** The current layout, set from the element's width (read-only; reflected for styling). */
114
123
  mode: ColumnsMode;
124
+ /** Set by `<bk-shell-app>` while the shell around the element is narrow: the columns flow in the document. */
125
+ narrow: boolean;
115
126
  private collapsedSides;
116
127
  private panelSides;
117
128
  /** Scroll containers whose content overflows right now (they become focusable regions). */
@@ -21,6 +21,7 @@ class BkColumns extends LitElement {
21
21
  mainLabel: { attribute: "main-label" },
22
22
  endLabel: { attribute: "end-label" },
23
23
  mode: { reflect: true, useDefault: true },
24
+ narrow: { type: Boolean, attribute: false },
24
25
  scrolling: { state: true },
25
26
  collapsedSides: { state: true },
26
27
  panelSides: { state: true }
@@ -39,6 +40,7 @@ class BkColumns extends LitElement {
39
40
  this.splitAbove = 1024;
40
41
  this.stackAbove = 768;
41
42
  this.mode = "flow";
43
+ this.narrow = false;
42
44
  this.collapsedSides = /* @__PURE__ */ new Set();
43
45
  this.panelSides = /* @__PURE__ */ new Set();
44
46
  this.scrolling = /* @__PURE__ */ new Set();
@@ -150,6 +152,11 @@ class BkColumns extends LitElement {
150
152
  }
151
153
  updateMode() {
152
154
  const w = this.width;
155
+ if (this.narrow) {
156
+ if (this.mode !== "flow")
157
+ this.mode = "flow";
158
+ return;
159
+ }
153
160
  if (w <= 0)
154
161
  return;
155
162
  const mode = w >= this.splitAbove ? "split" : w >= this.stackAbove ? "stack" : "flow";
@@ -188,7 +195,7 @@ class BkColumns extends LitElement {
188
195
  return null;
189
196
  }
190
197
  willUpdate(changed) {
191
- if (changed.has("splitAbove") || changed.has("stackAbove"))
198
+ if (changed.has("splitAbove") || changed.has("stackAbove") || changed.has("narrow"))
192
199
  this.updateMode();
193
200
  }
194
201
  updated(changed) {
@@ -115,15 +115,15 @@ type Row = ComboboxOption & {
115
115
  * @csspart error - Error text.
116
116
  * @cssprop --bk-combobox-font-size - Text size in the box (default from `size`: --bk-type-small, --bk-type-body, --bk-type-lead).
117
117
  * @cssprop --bk-combobox-tag-gap - Space between the tags and the text (default --bk-space-1).
118
- * @cssprop --bk-combobox-tags-padding - Block padding of the box with tags (default --bk-space-1; size sm: --bk-space-0).
119
- * @cssprop --bk-combobox-input-min-width - Narrowest text field next to the tags before it wraps (default 6ch).
118
+ * @cssprop --bk-combobox-tags-padding - Padding of the box with tags above, below and before the first chip (default the inset of a button in a field: --bk-field-button-inset, else --bk-space-0 / --bk-space-1 / --bk-space-1-5 by size).
119
+ * @cssprop --bk-combobox-input-min-width - Narrowest text field next to the tags before it wraps (default --bk-target-min).
120
120
  * @cssprop --bk-combobox-chevron-color - Chevron colour (default --bk-text-muted).
121
121
  * @cssprop --bk-combobox-match-color - Colour of the matched text in the options (default --bk-accent-text).
122
122
  * @cssprop --bk-combobox-match-weight - Weight of the matched text (default --bk-weight-semibold).
123
123
  * @cssprop --bk-combobox-status-color - Text colour of the loading and empty rows (default --bk-text-muted).
124
124
  * @cssprop --bk-combobox-popup-bg - Popup background (default --bk-layer-overlay-bg).
125
125
  * @cssprop --bk-combobox-popup-border - Popup border colour (default --bk-layer-overlay-border).
126
- * @cssprop --bk-combobox-popup-radius - Popup corner radius (default --bk-radius-md).
126
+ * @cssprop --bk-combobox-popup-radius - Popup corner radius (default --bk-row-radius + the padding + the border: concentric with the rows).
127
127
  * @cssprop --bk-combobox-popup-shadow - Popup shadow (default --bk-layer-overlay-shadow).
128
128
  * @cssprop --bk-combobox-popup-padding - Space between popup edge and options (default --bk-space-1).
129
129
  * @cssprop --bk-combobox-popup-offset - Gap between box and popup, read on open (default --bk-space-1).
@@ -9,6 +9,8 @@ import { edgeOption, matchRanges, sameText } from "../internal/options.js";
9
9
  import "./bk-chip.js";
10
10
  import "./bk-icon.js";
11
11
  import "./bk-spinner.js";
12
+ import { submitImplicitly } from "../internal/submit.js";
13
+ import { pastedTags, tagFieldStyles } from "../internal/tags.js";
12
14
  import "../icons/set/add.js";
13
15
  import "../icons/set/chevron-down.js";
14
16
  import "../icons/set/search.js";
@@ -91,20 +93,8 @@ class BkCombobox extends ChoiceField {
91
93
  get busy() {
92
94
  return this.loading || this.searching;
93
95
  }
94
- static styles = [...choiceFieldStyles("combobox"), css`
96
+ static styles = [...choiceFieldStyles("combobox"), tagFieldStyles("combobox"), css`
95
97
  :host { --_bk-text-field-font-size: var(--bk-combobox-font-size); }
96
- .box { cursor: text; }
97
- .values { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--bk-combobox-tag-gap, var(--bk-space-1)); }
98
- .box.has-tags { padding-block: var(--bk-combobox-tags-padding, var(--bk-space-1)); }
99
- :host([size="sm"]) .box.has-tags { padding-block: var(--bk-combobox-tags-padding, var(--bk-space-0)); }
100
- .tags { display: contents; }
101
- bk-chip { max-width: 100%; }
102
- input { text-overflow: ellipsis; }
103
- .has-tags input { min-width: var(--bk-combobox-input-min-width, 6ch); width: auto; }
104
- input:disabled { cursor: not-allowed; }
105
- /* Disabled with chips: the chips keep their text contrast (a dimmed box fails 4.5:1); the sunken fill and the cursor show the state. */
106
- :host([disabled]) .box.has-tags { opacity: 1; }
107
- :host([disabled]) .box.has-tags input { opacity: var(--bk-disabled-opacity); }
108
98
  mark {
109
99
  background: none; color: var(--bk-combobox-match-color, var(--bk-accent-text));
110
100
  font-weight: var(--bk-combobox-match-weight, var(--bk-weight-semibold));
@@ -328,14 +318,12 @@ class BkCombobox extends ChoiceField {
328
318
  onPaste(e) {
329
319
  if (!this.multiple || this.isDisabled || this.readonly)
330
320
  return;
331
- const pasted = e.clipboardData?.getData("text") ?? "";
332
- if (!/[,;\n\t]/.test(pasted))
321
+ const parts = pastedTags(e, this.text);
322
+ if (!parts)
333
323
  return;
334
- e.preventDefault();
335
324
  const next = [...this.selection];
336
- for (const part of (this.text + pasted).split(/[,;\n\t]+/)) {
337
- const t = part.trim();
338
- if (!t || this.max !== void 0 && this.max > 0 && next.length >= this.max)
325
+ for (const t of parts) {
326
+ if (this.max !== void 0 && this.max > 0 && next.length >= this.max)
339
327
  continue;
340
328
  const v = this.tagFor(t);
341
329
  if (v !== void 0 && !next.includes(v))
@@ -433,7 +421,7 @@ class BkCombobox extends ChoiceField {
433
421
  }
434
422
  const form = this.internals.form;
435
423
  if (form)
436
- setTimeout(() => form.requestSubmit());
424
+ setTimeout(() => submitImplicitly(form));
437
425
  return;
438
426
  }
439
427
  case ",":
@@ -560,7 +548,7 @@ class BkCombobox extends ChoiceField {
560
548
  const empty = this.noResults;
561
549
  const more = busy && opts.length > 0;
562
550
  return html`<div @focusout=${this.onFocusOut}>
563
- ${this.renderField(html`<div class="${this.boxClass}${tags ? " has-tags" : ""}${expanded ? " open" : ""}" part="box" @click=${this.onBoxClick}>
551
+ ${this.renderField(html`<div class="${this.boxClass}${tags ? " has-tags" : ""}${tags && !this.hasLead ? " tags-first" : ""}${expanded ? " open" : ""}" part="box" @click=${this.onBoxClick}>
564
552
  ${this.renderStart()}
565
553
  ${this.renderPrefix()}
566
554
  <div class="values">
@@ -24,6 +24,11 @@ import { LitElement, nothing, type PropertyValues, type TemplateResult } from "l
24
24
  * `tiers` sets the colour of the new rank to the colour of its tier. `tiers="3 10 50"` makes the top 3, the top 10
25
25
  * and the top 50 three tiers.
26
26
  *
27
+ * `value-text` shows ready text instead of the formatted change, for a change that the app has already formatted
28
+ * ("1.234"). The text is shown as it is, and screen readers read it ("Up 1.234"). `value` still gives the direction, the
29
+ * tone and the mark. It applies to `change` and `count`. It does not apply to `variant="rank"`, where the element
30
+ * builds the text from the two ranks, nor to `new`.
31
+ *
27
32
  * `notation="compact"` shortens a change from 10,000 (12.3K). The exact value is the name for
28
33
  * screen readers and the text of the tooltip.
29
34
  *
@@ -56,6 +61,9 @@ export declare class BkDelta extends LitElement {
56
61
  value: {
57
62
  type: NumberConstructor;
58
63
  };
64
+ valueText: {
65
+ attribute: string;
66
+ };
59
67
  previous: {
60
68
  type: NumberConstructor;
61
69
  };
@@ -83,6 +91,8 @@ export declare class BkDelta extends LitElement {
83
91
  };
84
92
  /** The change (`change`, `count`) or the new rank (`rank`). */
85
93
  value: number | undefined;
94
+ /** Ready text for the change, shown as it is instead of the formatted `value` (like `aria-valuetext`). `value` still sets the direction and the tone. Not used in `variant="rank"`. */
95
+ valueText: string | undefined;
86
96
  /** The previous rank (`variant="rank"`). Without it, the rank is new. */
87
97
  previous: number | undefined;
88
98
  /** `change` (default): a change with a mark. `count`: a figure that only grows ("+12"). `rank`: a move between ranks. */
@@ -6,6 +6,7 @@ import { deltaDirection, deltaTone, formatDelta, formatFigure, shortens } from "
6
6
  class BkDelta extends LitElement {
7
7
  static properties = {
8
8
  value: { type: Number },
9
+ valueText: { attribute: "value-text" },
9
10
  previous: { type: Number },
10
11
  variant: { reflect: true, useDefault: true },
11
12
  notation: { reflect: true, useDefault: true },
@@ -76,17 +77,18 @@ class BkDelta extends LitElement {
76
77
  if (v === void 0 || v === null || !Number.isFinite(v))
77
78
  return nothing;
78
79
  const dir = deltaDirection(v);
80
+ const given = this.valueText || void 0;
79
81
  if (dir === "flat")
80
- return this.pair(html`<span class="change flat" part="change">–</span>`, this.i18n.t("statFlat"));
82
+ return this.pair(html`<span class="change flat" part="change">${given ?? "\u2013"}</span>`, this.i18n.t("statFlat"));
81
83
  const short = shortens(v, this.notation === "compact");
82
84
  const opts = short ? { notation: "compact", maximumFractionDigits: 1, ...this.format } : this.format;
83
- const exact = formatDelta(locale, v, this.format);
85
+ const exact = given ?? formatDelta(locale, v, this.format);
84
86
  if (this.variant === "count") {
85
- return this.pair(html`<span class="change count" part="change">${formatDelta(locale, v, opts)}</span>`, exact, short ? exact : void 0);
87
+ return this.pair(html`<span class="change count" part="change">${given ?? formatDelta(locale, v, opts)}</span>`, exact, short && !given ? exact : void 0);
86
88
  }
87
- const shown = formatDelta(locale, Math.abs(v), opts, "never");
88
- const spoken = this.i18n.t(dir === "up" ? "deltaUp" : "deltaDown", { value: formatDelta(locale, Math.abs(v), this.format, "never") });
89
- return this.pair(html`<span class="change ${deltaTone(dir, this.inverted)}" part="change">${this.mark(dir)}${shown}</span>`, spoken, short ? exact : void 0);
89
+ const shown = given ?? formatDelta(locale, Math.abs(v), opts, "never");
90
+ const spoken = this.i18n.t(dir === "up" ? "deltaUp" : "deltaDown", { value: given ?? formatDelta(locale, Math.abs(v), this.format, "never") });
91
+ return this.pair(html`<span class="change ${deltaTone(dir, this.inverted)}" part="change">${this.mark(dir)}${shown}</span>`, spoken, short && !given ? exact : void 0);
90
92
  }
91
93
  renderRank() {
92
94
  const locale = this.i18n.locale;
@@ -29,12 +29,13 @@ export interface DialogCloseDetail {
29
29
  * </bk-dialog>
30
30
  * ```
31
31
  *
32
- * A dialog that needs an answer (a destructive confirmation, an error that blocks) uses `role="alert"`
33
- * (or `alert`). The native dialog gets `role="alertdialog"` and the body is its description. The first
32
+ * A dialog that needs an answer (a destructive confirmation, an error that blocks) uses `alert`. The
33
+ * native dialog gets `role="alertdialog"` and the body is its description. The first
34
34
  * focus is on the least destructive action: the `[autofocus]` element, else the button with
35
35
  * `value="cancel"`, else the first `data-close` button. A click on the backdrop does not close it.
36
36
  * Esc and the close button still close it. Add `dismissible="false"` to disable them too.
37
- * The dialog reads `role` once and removes it from the host, so the host itself does not announce as an alert.
37
+ * The dialog also accepts `role="alert"`. It reads `role` once, removes it from the host and sets `alert`, so the host
38
+ * itself does not announce as an alert. Use `alert` in server HTML: the dialog then changes no attribute.
38
39
  *
39
40
  * A `<form method="dialog">` in the content closes the dialog on submit, like in a native `<dialog>`. The `value`
40
41
  * of the submit button is the return value.
@@ -42,6 +43,9 @@ export interface DialogCloseDetail {
42
43
  * Esc closes the dialog. The dialog calls `preventDefault()` on that `keydown`, so the Esc handler of an app can
43
44
  * check `defaultPrevented`.
44
45
  *
46
+ * An open tooltip takes the first Esc (WCAG 1.4.13). The built-in tooltip of `bk-button` does not show in a dialog, so one
47
+ * Esc closes the dialog. A `bk-tooltip` of the app in the dialog takes the first Esc, and the second Esc closes the dialog.
48
+ *
45
49
  * For a one-line yes/no question, use `confirmDialog()` from the same module.
46
50
  *
47
51
  * The dialog is behaviour plus a little chrome. Content components (a `<bk-command-menu>`, a
@@ -110,7 +114,7 @@ export interface DialogCloseDetail {
110
114
  * @keyboard Escape - Close the dialog (fires a cancelable `cancel`; not with `dismissible="false"`).
111
115
  * @keyboard Tab, Shift + Tab - Move the focus inside the dialog. It does not leave the dialog (not with `floating`).
112
116
  * @keyboard Arrow keys - On the move button or the resize handle of a floating dialog: move or resize it (Shift: larger steps).
113
- * @a11y A native modal `<dialog>` in the top layer: the page behind is inert. It gets its name from `heading`. The first focus is on the `[autofocus]` element, else the first field. An alert dialog (`role="alert"`) is an `alertdialog` and focuses the least destructive action. When the dialog closes, the focus returns to the element that opened it.
117
+ * @a11y A native modal `<dialog>` in the top layer: the page behind is inert. It gets its name from `heading`. The first focus is on the `[autofocus]` element, else the first field. An alert dialog (`alert`) is an `alertdialog` and focuses the least destructive action. When the dialog closes, the focus returns to the element that opened it.
114
118
  * @tag bk-dialog
115
119
  */
116
120
  export declare class BkDialog extends LitElement {
@@ -177,7 +181,7 @@ export declare class BkDialog extends LitElement {
177
181
  size: "sm" | "md" | "lg" | "full";
178
182
  /** Esc, a click on the backdrop and the close button dismiss the dialog (default true). Set `dismissible="false"` or the property to false for choices that the user must make. */
179
183
  dismissible: boolean;
180
- /** Alert dialog: `role="alertdialog"`, the first focus is on the least destructive action, no light dismiss. `role="alert"` on the element sets it. */
184
+ /** Alert dialog: `role="alertdialog"`, the first focus is on the least destructive action, no light dismiss. `role="alert"` on the element sets it too. */
181
185
  alert: boolean;
182
186
  /** Accessible name of the close button (default: i18n `close`). */
183
187
  closeLabel: string;
@@ -239,6 +243,9 @@ export declare class BkDialog extends LitElement {
239
243
  private onCancel;
240
244
  /** The native dialog closed on its own (for example `requestClose()` without a cancelable cancel): sync the state. */
241
245
  private onNativeClose;
246
+ private backdropPress;
247
+ private onBackdropPress;
248
+ /** Light dismiss: the press and the click are both on the backdrop (see `BackdropPress`). */
242
249
  private onBackdrop;
243
250
  private floatState;
244
251
  /** A pointer gesture ended in a move, so the click that follows must not start the click-to-place mode. */
@@ -3,8 +3,10 @@ import { define } from "../internal/define.js";
3
3
  import { LocalizeController } from "../i18n.js";
4
4
  import { deepActiveElement, setTriggerAria } from "../internal/anchor.js";
5
5
  import { commandOf, installCommandFallback } from "../internal/command.js";
6
+ import { BackdropPress } from "../internal/backdrop.js";
6
7
  import { emitLifecycle } from "../internal/events.js";
7
8
  import { lockScroll, unlockScroll } from "../internal/scroll-lock.js";
9
+ import { trackModal } from "../internal/announcer.js";
8
10
  import { SlotController } from "../internal/slots.js";
9
11
  import { StateController } from "../internal/state.js";
10
12
  import { base, footerRegion, headingType } from "../internal/styles.js";
@@ -202,6 +204,8 @@ class BkDialog extends LitElement {
202
204
  super.disconnectedCallback();
203
205
  this.startSize.disconnect();
204
206
  unlockScroll(this);
207
+ if (this.dialog)
208
+ trackModal(this.dialog, false);
205
209
  this.stopPlacing();
206
210
  window.removeEventListener("resize", this.onViewport);
207
211
  }
@@ -266,6 +270,7 @@ class BkDialog extends LitElement {
266
270
  } else {
267
271
  d.showModal();
268
272
  lockScroll(this);
273
+ trackModal(d, true);
269
274
  }
270
275
  this.focusFirst();
271
276
  this.syncCommandSource();
@@ -275,6 +280,7 @@ class BkDialog extends LitElement {
275
280
  if (d.open)
276
281
  d.close();
277
282
  unlockScroll(this);
283
+ trackModal(d, false);
278
284
  this.stopPlacing();
279
285
  window.removeEventListener("resize", this.onViewport);
280
286
  if (hadFocus && this.opener instanceof HTMLElement && this.opener.isConnected)
@@ -349,14 +355,16 @@ class BkDialog extends LitElement {
349
355
  if (this.open)
350
356
  this.close("");
351
357
  }
358
+ backdropPress = new BackdropPress(() => this.dialog);
359
+ onBackdropPress(e) {
360
+ this.backdropPress.press(e);
361
+ }
362
+ /** Light dismiss: the press and the click are both on the backdrop (see `BackdropPress`). */
352
363
  onBackdrop(e) {
364
+ const hit = this.backdropPress.isBackdropClick(e);
353
365
  if (this.alert)
354
366
  return;
355
- if (e.target !== this.dialog)
356
- return;
357
- const r = this.dialog.getBoundingClientRect();
358
- const inside = e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom;
359
- if (!inside)
367
+ if (hit)
360
368
  this.dismiss();
361
369
  }
362
370
  // ---- floating: move and resize --------------------------------------------------------------
@@ -552,7 +560,7 @@ class BkDialog extends LitElement {
552
560
  const bareName = this.bare ? this.heading || void 0 : void 0;
553
561
  return html`<dialog part="dialog" tabindex="-1" role=${this.alert ? "alertdialog" : nothing} aria-labelledby=${this.heading && !this.bare ? "heading" : nothing}
554
562
  aria-label=${bareName ?? nothing}
555
- aria-describedby=${this.description && !this.bare ? "desc" : this.alert && !this.bare ? "body" : nothing} @cancel=${this.onCancel} @close=${this.onNativeClose} @click=${this.onBackdrop} @keydown=${this.onKeydown}>
563
+ aria-describedby=${this.description && !this.bare ? "desc" : this.alert && !this.bare ? "body" : nothing} @cancel=${this.onCancel} @close=${this.onNativeClose} @pointerdown=${this.onBackdropPress} @click=${this.onBackdrop} @keydown=${this.onKeydown}>
556
564
  <div class="header ${hasHeader ? "" : "header-empty"} ${this.description || this.slots.has("header") ? "" : "single"}" part="header" @pointerdown=${this.onHeaderDown}>
557
565
  ${this.nonModal && !this.bare ? html`<bk-button variant="ghost" class="move" part="move" icon="drag-indicator" size="sm" label=${this.moveLabel || this.i18n.t("moveWindow")}
558
566
  aria-pressed=${this.placing === "move" ? "true" : "false"} @click=${this.onMoveClick} @keydown=${this.onMoveKey}></bk-button>` : nothing}
@@ -74,8 +74,10 @@ class BkDisclosure extends LitElement {
74
74
  :host(:dir(rtl)[open]) .caret { rotate: -90deg; }
75
75
  /* The end content can give way, but never runs past the line. */
76
76
  .end { display: inline-flex; align-items: center; gap: var(--bk-disclosure-gap, var(--bk-space-1)); flex: 0 1 auto; min-width: 0; overflow: hidden; }
77
- /* A text in it that can be cut (overflow=ellipsis) gives way before the rest of the end content. */
78
- .end.cut { flex-shrink: 1000000; }
77
+ /* A text in it that can be cut (overflow=ellipsis) gives way before the label and the rest of the end content.
78
+ The end takes only the free room (basis 0): a shrink factor alone also takes a fraction of a pixel from the label. */
79
+ .end.cut { flex: 1 1 0; }
80
+ :host(:is([variant="row"], [variant="thread"])) .end.cut { justify-content: flex-end; }
79
81
  .end.cut ::slotted(*) { flex: none; }
80
82
  .end.cut ::slotted([overflow="ellipsis"]) { flex: 0 1 auto; min-width: 0; }
81
83
  .content { padding-block-start: var(--bk-disclosure-content-gap, var(--bk-space-1)); }
@@ -16,6 +16,8 @@ export type DropEffect = "move" | "copy" | "link";
16
16
  * through: the content under it (a list that sorts its own items) still receives it. For an accepted
17
17
  * drag, it allows the drop with `effect` and stops the own handling of the browser (opening a dropped
18
18
  * file). The `drop` event is the native event. Read the data from `event.dataTransfer`.
19
+ * A `disabled` target refuses an accepted drag: the pointer shows no drop, and the browser does not open a
20
+ * dropped file in the tab.
19
21
  *
20
22
  * Dragging needs a pointer. Also give the same action a keyboard path (a menu item, a button).
21
23
  *
@@ -50,8 +52,12 @@ export declare class BkDropTarget extends LitElement {
50
52
  private depth;
51
53
  constructor();
52
54
  static styles: import("lit").CSSResult[];
53
- /** True if this drag has a type that the element accepts. */
55
+ /** True if this drag has a type that the element accepts, also while it is disabled. */
56
+ private acceptsType;
57
+ /** True if this drag has a type that the element accepts and the element is enabled. */
54
58
  private takes;
59
+ /** A disabled target refuses an accepted drag, so the browser does not open a dropped file in the tab. */
60
+ private refuse;
55
61
  private set receiving(value);
56
62
  private onEnter;
57
63
  private onOver;
@@ -29,13 +29,25 @@ class BkDropTarget extends LitElement {
29
29
  }
30
30
  @media (forced-colors: active) { :host(:state(receiving)) { outline-color: Highlight; } }
31
31
  `];
32
- /** True if this drag has a type that the element accepts. */
33
- takes(e) {
34
- if (this.disabled || !e.dataTransfer)
32
+ /** True if this drag has a type that the element accepts, also while it is disabled. */
33
+ acceptsType(e) {
34
+ if (!e.dataTransfer)
35
35
  return false;
36
36
  const types = this.accept.split(/[\s,]+/).filter(Boolean);
37
37
  return !types.length || types.some((t) => e.dataTransfer.types.includes(t));
38
38
  }
39
+ /** True if this drag has a type that the element accepts and the element is enabled. */
40
+ takes(e) {
41
+ return !this.disabled && this.acceptsType(e);
42
+ }
43
+ /** A disabled target refuses an accepted drag, so the browser does not open a dropped file in the tab. */
44
+ refuse(e) {
45
+ if (!this.disabled || !this.acceptsType(e))
46
+ return false;
47
+ e.preventDefault();
48
+ e.dataTransfer.dropEffect = "none";
49
+ return true;
50
+ }
39
51
  set receiving(on) {
40
52
  if (on)
41
53
  this.internals.states.add("receiving");
@@ -50,7 +62,7 @@ class BkDropTarget extends LitElement {
50
62
  this.receiving = true;
51
63
  };
52
64
  onOver = (e) => {
53
- if (!this.takes(e))
65
+ if (this.refuse(e) || !this.takes(e))
54
66
  return;
55
67
  e.preventDefault();
56
68
  e.dataTransfer.dropEffect = this.effect;
@@ -64,6 +76,10 @@ class BkDropTarget extends LitElement {
64
76
  this.receiving = false;
65
77
  };
66
78
  onDrop = (e) => {
79
+ if (this.refuse(e)) {
80
+ e.stopImmediatePropagation();
81
+ return;
82
+ }
67
83
  if (!this.takes(e))
68
84
  return;
69
85
  e.preventDefault();
@@ -95,6 +95,11 @@ export declare class BkErrorSummary extends LitElement {
95
95
  /** Empties and hides the summary. */
96
96
  clear(): void;
97
97
  protected willUpdate(changed: PropertyValues): void;
98
+ /**
99
+ * Focuses the summary. The summary gets `tabindex="-1"` only for this focus and removes it when the focus leaves:
100
+ * the element has no attribute that the app did not write until the summary opens.
101
+ */
102
+ focus(options?: FocusOptions): void;
98
103
  protected updated(): void;
99
104
  private watch;
100
105
  private unwatch;