@bk2k/ui 0.6.7 → 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 (487) hide show
  1. package/BUILDING.md +88 -2
  2. package/CHANGELOG.md +193 -0
  3. package/USAGE.md +102 -33
  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 +4 -2
  10. package/dist/clipboard.js +1 -0
  11. package/dist/components/bk-alert.js +2 -1
  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 +55 -17
  19. package/dist/components/bk-button.js +71 -24
  20. package/dist/components/bk-card.d.ts +4 -0
  21. package/dist/components/bk-card.js +15 -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 +6 -0
  25. package/dist/components/bk-chart-bar.d.ts +63 -9
  26. package/dist/components/bk-chart-bar.js +152 -41
  27. package/dist/components/bk-chart-line.d.ts +13 -0
  28. package/dist/components/bk-chart-line.js +11 -1
  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 +53 -8
  32. package/dist/components/bk-chip.js +43 -7
  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 +30 -6
  37. package/dist/components/bk-combobox.js +63 -20
  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 +16 -6
  41. package/dist/components/bk-dialog.js +20 -8
  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-item.js +8 -6
  48. package/dist/components/bk-facts.d.ts +6 -4
  49. package/dist/components/bk-facts.js +22 -10
  50. package/dist/components/bk-footnote.d.ts +73 -0
  51. package/dist/components/bk-footnote.js +97 -0
  52. package/dist/components/bk-footnotes-item.d.ts +92 -0
  53. package/dist/components/bk-footnotes-item.js +139 -0
  54. package/dist/components/bk-footnotes.d.ts +51 -0
  55. package/dist/components/bk-footnotes.js +43 -0
  56. package/dist/components/bk-icon.js +2 -2
  57. package/dist/components/bk-image-compare.d.ts +33 -5
  58. package/dist/components/bk-image-compare.js +72 -24
  59. package/dist/components/bk-image-crop.d.ts +3 -3
  60. package/dist/components/bk-image-editor.d.ts +1 -1
  61. package/dist/components/bk-image-viewer.d.ts +107 -11
  62. package/dist/components/bk-image-viewer.js +205 -34
  63. package/dist/components/bk-input-inline.d.ts +15 -6
  64. package/dist/components/bk-input-inline.js +22 -6
  65. package/dist/components/bk-input-number.js +2 -1
  66. package/dist/components/bk-input-search.d.ts +1 -1
  67. package/dist/components/bk-input-search.js +2 -1
  68. package/dist/components/bk-input-text.d.ts +11 -0
  69. package/dist/components/bk-input-text.js +17 -3
  70. package/dist/components/bk-input-time-zone.d.ts +3 -0
  71. package/dist/components/bk-input-time.js +2 -1
  72. package/dist/components/bk-item.js +2 -1
  73. package/dist/components/bk-lightbox.d.ts +12 -3
  74. package/dist/components/bk-lightbox.js +6 -3
  75. package/dist/components/bk-link.d.ts +9 -1
  76. package/dist/components/bk-link.js +14 -4
  77. package/dist/components/bk-menu-item.d.ts +40 -0
  78. package/dist/components/bk-menu-item.js +57 -9
  79. package/dist/components/bk-menu-label.js +2 -1
  80. package/dist/components/bk-menu-list.d.ts +1 -0
  81. package/dist/components/bk-menu-list.js +10 -0
  82. package/dist/components/bk-menu.d.ts +8 -1
  83. package/dist/components/bk-menu.js +16 -5
  84. package/dist/components/bk-message-feedback.d.ts +4 -3
  85. package/dist/components/bk-message-feedback.js +7 -5
  86. package/dist/components/bk-message-list.js +2 -1
  87. package/dist/components/bk-message-source.d.ts +1 -2
  88. package/dist/components/bk-message-source.js +3 -11
  89. package/dist/components/bk-message.js +2 -0
  90. package/dist/components/bk-model-viewer.d.ts +12 -1
  91. package/dist/components/bk-model-viewer.js +15 -2
  92. package/dist/components/bk-nav-group.js +1 -1
  93. package/dist/components/bk-nav-item.d.ts +18 -0
  94. package/dist/components/bk-nav-item.js +18 -5
  95. package/dist/components/bk-nav.d.ts +1 -1
  96. package/dist/components/bk-page-cta.js +2 -0
  97. package/dist/components/bk-page-section.d.ts +1 -1
  98. package/dist/components/bk-page-section.js +3 -9
  99. package/dist/components/bk-pane.d.ts +1 -0
  100. package/dist/components/bk-pane.js +7 -5
  101. package/dist/components/bk-panel.d.ts +1 -1
  102. package/dist/components/bk-panel.js +6 -5
  103. package/dist/components/bk-period-nav.d.ts +102 -0
  104. package/dist/components/bk-period-nav.js +69 -0
  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-select.js +2 -1
  114. package/dist/components/bk-shell-app.d.ts +13 -6
  115. package/dist/components/bk-shell-app.js +47 -11
  116. package/dist/components/bk-shell-sites.d.ts +2 -1
  117. package/dist/components/bk-shell-sites.js +3 -5
  118. package/dist/components/bk-sortable.d.ts +3 -0
  119. package/dist/components/bk-sortable.js +10 -17
  120. package/dist/components/bk-split-grid.d.ts +104 -3
  121. package/dist/components/bk-split-grid.js +425 -2
  122. package/dist/components/bk-split.d.ts +3 -0
  123. package/dist/components/bk-split.js +3 -0
  124. package/dist/components/bk-stat-group.js +2 -1
  125. package/dist/components/bk-stat.d.ts +17 -0
  126. package/dist/components/bk-stat.js +7 -3
  127. package/dist/components/bk-steps.js +2 -1
  128. package/dist/components/bk-surface.d.ts +2 -0
  129. package/dist/components/bk-surface.js +6 -3
  130. package/dist/components/bk-table.d.ts +17 -13
  131. package/dist/components/bk-table.js +94 -15
  132. package/dist/components/bk-tabs-item.d.ts +45 -7
  133. package/dist/components/bk-tabs-item.js +51 -20
  134. package/dist/components/bk-tabs-panel.d.ts +6 -3
  135. package/dist/components/bk-tabs-panel.js +6 -0
  136. package/dist/components/bk-tabs.d.ts +50 -7
  137. package/dist/components/bk-tabs.js +168 -96
  138. package/dist/components/bk-text.js +2 -1
  139. package/dist/components/bk-toast-group.d.ts +3 -1
  140. package/dist/components/bk-toast-group.js +11 -1
  141. package/dist/components/bk-tooltip.d.ts +3 -1
  142. package/dist/components/bk-tooltip.js +2 -1
  143. package/dist/components/bk-video.js +2 -2
  144. package/dist/components/bk-zoom.d.ts +3 -1
  145. package/dist/components/confirm.d.ts +15 -0
  146. package/dist/components/confirm.js +27 -4
  147. package/dist/i18n/de.js +19 -1
  148. package/dist/i18n/en.d.ts +2 -0
  149. package/dist/i18n/en.js +3 -0
  150. package/dist/i18n.d.ts +23 -2
  151. package/dist/i18n.js +35 -4
  152. package/dist/icons/brands-static.d.ts +3 -0
  153. package/dist/icons/brands-static.js +5 -0
  154. package/dist/icons/core.d.ts +1 -0
  155. package/dist/icons/core.js +2 -0
  156. package/dist/icons/load-static.d.ts +3 -0
  157. package/dist/icons/load-static.js +5 -0
  158. package/dist/icons/load.js +1 -0
  159. package/dist/icons/registry.js +1 -1
  160. package/dist/icons/set/save-as.d.ts +3 -0
  161. package/dist/icons/set/save-as.js +7 -0
  162. package/dist/index.d.ts +4 -0
  163. package/dist/index.js +4 -0
  164. package/dist/internal/announcer.d.ts +8 -1
  165. package/dist/internal/announcer.js +26 -10
  166. package/dist/internal/backdrop.d.ts +19 -0
  167. package/dist/internal/backdrop.js +29 -0
  168. package/dist/internal/busy.d.ts +3 -2
  169. package/dist/internal/busy.js +4 -5
  170. package/dist/internal/choice-field.js +1 -1
  171. package/dist/internal/choice-item.d.ts +17 -6
  172. package/dist/internal/choice-item.js +20 -9
  173. package/dist/internal/cloak.d.ts +3 -0
  174. package/dist/internal/cloak.js +7 -0
  175. package/dist/internal/crop-frame.d.ts +1 -1
  176. package/dist/internal/crop-frame.js +2 -7
  177. package/dist/internal/date-field.js +2 -1
  178. package/dist/internal/drag.d.ts +11 -0
  179. package/dist/internal/drag.js +23 -0
  180. package/dist/internal/english-static.d.ts +3 -0
  181. package/dist/internal/english-static.js +5 -0
  182. package/dist/internal/english.d.ts +8 -0
  183. package/dist/internal/english.js +6 -0
  184. package/dist/internal/footnotes.d.ts +56 -0
  185. package/dist/internal/footnotes.js +143 -0
  186. package/dist/internal/handle-menu.d.ts +2 -3
  187. package/dist/internal/handle-menu.js +11 -3
  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/handle-menu.d.ts +4 -0
  193. package/dist/internal/late/handle-menu.js +9 -0
  194. package/dist/internal/late/static.d.ts +7 -0
  195. package/dist/internal/late/static.js +5 -0
  196. package/dist/internal/late.d.ts +20 -0
  197. package/dist/internal/late.js +45 -0
  198. package/dist/internal/link.d.ts +2 -0
  199. package/dist/internal/link.js +11 -1
  200. package/dist/internal/own-text.d.ts +8 -0
  201. package/dist/internal/own-text.js +7 -0
  202. package/dist/internal/scope.js +1 -1
  203. package/dist/internal/scroll-lock.d.ts +4 -1
  204. package/dist/internal/scroll-lock.js +17 -4
  205. package/dist/internal/slider.js +2 -1
  206. package/dist/internal/styles.js +3 -0
  207. package/dist/internal/submit.d.ts +23 -0
  208. package/dist/internal/submit.js +57 -0
  209. package/dist/jsx.d.ts +176 -56
  210. package/dist/reset.css +10 -0
  211. package/dist/standalone/all.js +226 -221
  212. package/dist/standalone/appearance.js +1 -1
  213. package/dist/standalone/bk-accordion-item.js +4 -4
  214. package/dist/standalone/bk-accordion.js +2 -2
  215. package/dist/standalone/bk-action-bar.js +3 -3
  216. package/dist/standalone/bk-alert-offline.js +1 -2
  217. package/dist/standalone/bk-alert.js +13 -12
  218. package/dist/standalone/bk-app-state.js +1 -1
  219. package/dist/standalone/bk-attachment.js +4 -4
  220. package/dist/standalone/bk-avatar-group.js +12 -10
  221. package/dist/standalone/bk-avatar.js +14 -4
  222. package/dist/standalone/bk-badge.js +2 -2
  223. package/dist/standalone/bk-bar.js +3 -1
  224. package/dist/standalone/bk-brand.js +3 -3
  225. package/dist/standalone/bk-breadcrumbs.js +5 -5
  226. package/dist/standalone/bk-button-copy.js +5 -5
  227. package/dist/standalone/bk-button-group.js +5 -5
  228. package/dist/standalone/bk-button-share.js +5 -5
  229. package/dist/standalone/bk-button-top.js +9 -8
  230. package/dist/standalone/bk-button.js +74 -34
  231. package/dist/standalone/bk-calendar-event.js +1 -1
  232. package/dist/standalone/bk-calendar-week.js +3 -3
  233. package/dist/standalone/bk-calendar.js +4 -4
  234. package/dist/standalone/bk-card.js +20 -7
  235. package/dist/standalone/bk-carousel-controls.js +7 -6
  236. package/dist/standalone/bk-carousel-item.js +2 -2
  237. package/dist/standalone/bk-carousel.js +1 -1
  238. package/dist/standalone/bk-chart-area.js +1 -1
  239. package/dist/standalone/bk-chart-bar-list.js +8 -8
  240. package/dist/standalone/bk-chart-bar.js +253 -166
  241. package/dist/standalone/bk-chart-bridge.js +7 -7
  242. package/dist/standalone/bk-chart-bullet.js +6 -6
  243. package/dist/standalone/bk-chart-calendar.js +7 -7
  244. package/dist/standalone/bk-chart-heatmap.js +7 -7
  245. package/dist/standalone/bk-chart-histogram.js +5 -5
  246. package/dist/standalone/bk-chart-legend.js +6 -6
  247. package/dist/standalone/bk-chart-line.js +116 -103
  248. package/dist/standalone/bk-chart-mark.js +1 -1
  249. package/dist/standalone/bk-chart-scatter.js +6 -6
  250. package/dist/standalone/bk-chart-sparkline.js +6 -6
  251. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  252. package/dist/standalone/bk-chart-tracker.js +6 -6
  253. package/dist/standalone/bk-chart-waterfall.js +6 -6
  254. package/dist/standalone/bk-checkbox-group.js +4 -4
  255. package/dist/standalone/bk-checkbox.js +4 -4
  256. package/dist/standalone/bk-chip-group.js +9 -5
  257. package/dist/standalone/bk-chip.js +56 -17
  258. package/dist/standalone/bk-cluster.js +1 -1
  259. package/dist/standalone/bk-code-diff.js +4 -4
  260. package/dist/standalone/bk-code-stack.js +4 -4
  261. package/dist/standalone/bk-code.js +10 -6
  262. package/dist/standalone/bk-color-panel.js +5 -5
  263. package/dist/standalone/bk-columns.js +13 -5
  264. package/dist/standalone/bk-combobox.js +53 -33
  265. package/dist/standalone/bk-command-menu.js +6 -6
  266. package/dist/standalone/bk-command-palette.js +6 -5
  267. package/dist/standalone/bk-composer.js +6 -6
  268. package/dist/standalone/bk-delta.js +11 -10
  269. package/dist/standalone/bk-diagram.js +1 -1
  270. package/dist/standalone/bk-dialog.js +1 -1
  271. package/dist/standalone/bk-disclosure.js +7 -5
  272. package/dist/standalone/bk-divider.js +2 -2
  273. package/dist/standalone/bk-drawer.js +3 -3
  274. package/dist/standalone/bk-drop-target.js +12 -6
  275. package/dist/standalone/bk-empty-state.js +3 -3
  276. package/dist/standalone/bk-error-summary.js +9 -6
  277. package/dist/standalone/bk-facts-item.js +10 -8
  278. package/dist/standalone/bk-facts.js +28 -16
  279. package/dist/standalone/bk-feature.js +3 -3
  280. package/dist/standalone/bk-fieldset.js +3 -3
  281. package/dist/standalone/bk-filter-bar.js +4 -4
  282. package/dist/standalone/bk-folder-browser.js +4 -4
  283. package/dist/standalone/bk-footnote.js +82 -0
  284. package/dist/standalone/bk-footnotes-item.js +122 -0
  285. package/dist/standalone/bk-footnotes.js +37 -0
  286. package/dist/standalone/bk-form-guard.js +2 -2
  287. package/dist/standalone/bk-form-steps.js +3 -3
  288. package/dist/standalone/bk-grid.js +1 -1
  289. package/dist/standalone/bk-icon-tile.js +3 -3
  290. package/dist/standalone/bk-icon.js +1 -1
  291. package/dist/standalone/bk-image-compare.js +88 -47
  292. package/dist/standalone/bk-image-crop.js +6 -6
  293. package/dist/standalone/bk-image-editor.js +2 -1
  294. package/dist/standalone/bk-image-viewer.js +180 -59
  295. package/dist/standalone/bk-input-code.js +4 -4
  296. package/dist/standalone/bk-input-color.js +4 -4
  297. package/dist/standalone/bk-input-date-range.js +2 -2
  298. package/dist/standalone/bk-input-date.js +2 -2
  299. package/dist/standalone/bk-input-file.js +5 -5
  300. package/dist/standalone/bk-input-group.js +4 -4
  301. package/dist/standalone/bk-input-inline.js +17 -10
  302. package/dist/standalone/bk-input-number.js +9 -8
  303. package/dist/standalone/bk-input-rating.js +6 -6
  304. package/dist/standalone/bk-input-rich.js +1 -1
  305. package/dist/standalone/bk-input-search.js +23 -22
  306. package/dist/standalone/bk-input-slider-range.js +5 -5
  307. package/dist/standalone/bk-input-slider.js +5 -5
  308. package/dist/standalone/bk-input-text.js +1 -1
  309. package/dist/standalone/bk-input-time-zone.js +1 -1
  310. package/dist/standalone/bk-input-time.js +29 -28
  311. package/dist/standalone/bk-item-group.js +3 -3
  312. package/dist/standalone/bk-item.js +12 -11
  313. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  314. package/dist/standalone/bk-kbd.js +68 -1
  315. package/dist/standalone/bk-lightbox.js +11 -7
  316. package/dist/standalone/bk-lines.js +1 -1
  317. package/dist/standalone/bk-link.js +33 -19
  318. package/dist/standalone/bk-listbox-columns.js +6 -6
  319. package/dist/standalone/bk-listbox-item.js +1 -1
  320. package/dist/standalone/bk-listbox-search.js +7 -7
  321. package/dist/standalone/bk-listbox-transfer.js +6 -6
  322. package/dist/standalone/bk-listbox.js +7 -7
  323. package/dist/standalone/bk-logo-wall.js +2 -2
  324. package/dist/standalone/bk-logo.js +3 -3
  325. package/dist/standalone/bk-menu-bar.js +3 -3
  326. package/dist/standalone/bk-menu-context.js +1 -1
  327. package/dist/standalone/bk-menu-divider.js +2 -2
  328. package/dist/standalone/bk-menu-item.js +73 -29
  329. package/dist/standalone/bk-menu-label.js +7 -6
  330. package/dist/standalone/bk-menu-list.js +10 -4
  331. package/dist/standalone/bk-menu.js +19 -10
  332. package/dist/standalone/bk-message-approval.js +4 -4
  333. package/dist/standalone/bk-message-branches.js +3 -3
  334. package/dist/standalone/bk-message-citation.js +10 -10
  335. package/dist/standalone/bk-message-feedback.js +10 -6
  336. package/dist/standalone/bk-message-list.js +6 -5
  337. package/dist/standalone/bk-message-reasoning.js +5 -5
  338. package/dist/standalone/bk-message-source.js +13 -21
  339. package/dist/standalone/bk-message-tool-group.js +5 -5
  340. package/dist/standalone/bk-message-tool.js +5 -5
  341. package/dist/standalone/bk-message.js +6 -4
  342. package/dist/standalone/bk-meter.js +3 -3
  343. package/dist/standalone/bk-model-viewer.js +1 -1
  344. package/dist/standalone/bk-nav-divider.js +2 -2
  345. package/dist/standalone/bk-nav-group.js +6 -6
  346. package/dist/standalone/bk-nav-item.js +31 -23
  347. package/dist/standalone/bk-nav-toc.js +3 -3
  348. package/dist/standalone/bk-nav.js +3 -3
  349. package/dist/standalone/bk-overflow.js +3 -3
  350. package/dist/standalone/bk-page-cta.js +5 -3
  351. package/dist/standalone/bk-page-footer-column.js +2 -2
  352. package/dist/standalone/bk-page-footer.js +3 -3
  353. package/dist/standalone/bk-page-header.js +3 -3
  354. package/dist/standalone/bk-page-hero.js +3 -3
  355. package/dist/standalone/bk-page-pager.js +5 -5
  356. package/dist/standalone/bk-page-section.js +6 -6
  357. package/dist/standalone/bk-pagination.js +6 -6
  358. package/dist/standalone/bk-pane.js +10 -9
  359. package/dist/standalone/bk-panel.js +9 -10
  360. package/dist/standalone/bk-period-nav.js +69 -0
  361. package/dist/standalone/bk-picture.js +24 -15
  362. package/dist/standalone/bk-popover-help.js +3 -3
  363. package/dist/standalone/bk-popover.js +2 -2
  364. package/dist/standalone/bk-presence-cursor.js +2 -2
  365. package/dist/standalone/bk-preview.js +4 -4
  366. package/dist/standalone/bk-progress.js +3 -3
  367. package/dist/standalone/bk-prose.js +3 -3
  368. package/dist/standalone/bk-qr-code.js +1 -1
  369. package/dist/standalone/bk-radio-group.js +4 -4
  370. package/dist/standalone/bk-radio.js +3 -3
  371. package/dist/standalone/bk-rating.js +5 -5
  372. package/dist/standalone/bk-scroll.js +3 -3
  373. package/dist/standalone/bk-segmented-item.js +40 -16
  374. package/dist/standalone/bk-segmented.js +15 -13
  375. package/dist/standalone/bk-select-cascade.js +3 -3
  376. package/dist/standalone/bk-select-tree.js +4 -4
  377. package/dist/standalone/bk-select.js +7 -6
  378. package/dist/standalone/bk-shell-app.js +1 -1217
  379. package/dist/standalone/bk-shell-centered.js +2 -2
  380. package/dist/standalone/bk-shell-sites.js +5 -7
  381. package/dist/standalone/bk-skeleton.js +2 -2
  382. package/dist/standalone/bk-sortable.js +58 -60
  383. package/dist/standalone/bk-spinner.js +2 -2
  384. package/dist/standalone/bk-split-grid.js +318 -41
  385. package/dist/standalone/bk-split.js +9 -6
  386. package/dist/standalone/bk-stack.js +1 -1
  387. package/dist/standalone/bk-stat-group.js +8 -7
  388. package/dist/standalone/bk-stat.js +11 -8
  389. package/dist/standalone/bk-status-dot.js +3 -3
  390. package/dist/standalone/bk-steps-item.js +5 -5
  391. package/dist/standalone/bk-steps.js +8 -7
  392. package/dist/standalone/bk-surface.js +1 -1
  393. package/dist/standalone/bk-swatch-group.js +4 -4
  394. package/dist/standalone/bk-swatch-palette.js +1 -1
  395. package/dist/standalone/bk-swatch.js +2 -2
  396. package/dist/standalone/bk-switch.js +4 -4
  397. package/dist/standalone/bk-table.js +1 -1887
  398. package/dist/standalone/bk-tabs-item.js +58 -35
  399. package/dist/standalone/bk-tabs-panel.js +7 -3
  400. package/dist/standalone/bk-tabs.js +160 -98
  401. package/dist/standalone/bk-tasks-item.js +4 -4
  402. package/dist/standalone/bk-tasks.js +2 -2
  403. package/dist/standalone/bk-testimonial.js +3 -3
  404. package/dist/standalone/bk-text.js +19 -18
  405. package/dist/standalone/bk-time-countdown.js +4 -4
  406. package/dist/standalone/bk-time-relative.js +3 -3
  407. package/dist/standalone/bk-timeline-item.js +4 -4
  408. package/dist/standalone/bk-timeline.js +2 -2
  409. package/dist/standalone/bk-toast-group.js +1 -1
  410. package/dist/standalone/bk-toast.js +4 -4
  411. package/dist/standalone/bk-toolbar.js +2 -2
  412. package/dist/standalone/bk-tooltip.js +8 -7
  413. package/dist/standalone/bk-tree-item.js +6 -6
  414. package/dist/standalone/bk-tree.js +3 -3
  415. package/dist/standalone/bk-video.js +6 -6
  416. package/dist/standalone/bk-visually-hidden.js +2 -2
  417. package/dist/standalone/bk-zoom.js +5 -5
  418. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  419. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  420. package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  421. package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-Biz7t8sL.js} +4 -4
  422. package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-D_fQf6SF.js} +5 -5
  423. package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DwZyUUHh.js} +65 -27
  424. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  425. package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-BADsoLRL.js} +5 -5
  426. package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  427. package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-CFhW6vRa.js} +6 -6
  428. package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DviyLBqj.js} +63 -54
  429. package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-w_Ah4Tvs.js} +22 -8
  430. package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-CYMovNVl.js} +3 -3
  431. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  432. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  433. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  434. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  435. package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-CoL6W7uk.js} +27 -24
  436. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  437. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  438. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  439. package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-poOTerh1.js} +6 -6
  440. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  441. package/dist/standalone/chunks/clipboard-RqIeP9Uz.js +29 -0
  442. package/dist/standalone/chunks/clipboard-UVLSkL4C.js +34 -0
  443. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  444. package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-B-fCXa2D.js} +48 -47
  445. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  446. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  447. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  448. package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CHpfKAKa.js} +2 -2
  449. package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-xIMVEUCi.js} +7 -4
  450. package/dist/standalone/chunks/handle-menu-BgYUbGO2.js +56 -0
  451. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  452. package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-DFfGgd3d.js} +56 -34
  453. package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-DQAcbHkY.js} +1 -1
  454. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  455. package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-pOUDNUf1.js} +2 -2
  456. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  457. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  458. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  459. package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-hxo-Vh6E.js} +2 -2
  460. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  461. package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-CGDOcqBZ.js} +1 -1
  462. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  463. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  464. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  465. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  466. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  467. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  468. package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-W5s0TFqV.js} +1 -1
  469. package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-CqhJSAwZ.js} +4 -4
  470. package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-lvZbQtGW.js} +2 -2
  471. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  472. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  473. package/dist/standalone/confirm.js +27 -14
  474. package/dist/standalone/i18n-de.js +20 -2
  475. package/dist/standalone/icons.js +100 -98
  476. package/dist/standalone/links.js +1 -1
  477. package/dist/standalone/reset.css +10 -0
  478. package/dist/standalone/toast.js +1 -1
  479. package/dist/standalone/tokens.css +9 -5
  480. package/dist/tokens.css +9 -5
  481. package/dist/tokens.js +4 -3
  482. package/package.json +25 -2
  483. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  484. package/dist/standalone/chunks/bk-kbd-B7bz8hmV.js +0 -275
  485. package/dist/standalone/chunks/clipboard-DBGdJ-1S.js +0 -61
  486. package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
  487. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -4,10 +4,12 @@ import { live } from "lit/directives/live.js";
4
4
  import { ChoiceField, choiceFieldStyles } from "../internal/choice-field.js";
5
5
  import { define } from "../internal/define.js";
6
6
  import { emitToggle } from "../internal/events.js";
7
+ import { LoadingController } from "../internal/loading.js";
7
8
  import { edgeOption, matchRanges, sameText } from "../internal/options.js";
8
9
  import "./bk-chip.js";
9
10
  import "./bk-icon.js";
10
11
  import "./bk-spinner.js";
12
+ import { submitImplicitly } from "../internal/submit.js";
11
13
  import "../icons/set/add.js";
12
14
  import "../icons/set/chevron-down.js";
13
15
  import "../icons/set/search.js";
@@ -29,8 +31,15 @@ class BkCombobox extends ChoiceField {
29
31
  open: { type: Boolean, reflect: true },
30
32
  query: { state: true },
31
33
  results: { state: true },
32
- text: { state: true }
34
+ text: { state: true },
35
+ searching: { state: true }
33
36
  };
37
+ /** The query of the last search that ended (undefined before the first one). */
38
+ searched;
39
+ /** The label that the field put in the text. Other text is typed text, and new options do not replace it. */
40
+ shownLabel = "";
41
+ /** The spinner row: it waits for `--bk-loading-delay` and stays at least `--bk-loading-min`. */
42
+ loader = new LoadingController(this);
34
43
  /** Options that pass the filter, in list order (indexes of `activeIndex`). */
35
44
  visible = [];
36
45
  /** Labels of values that the user chose earlier, also when the option list has changed since then (async results). */
@@ -53,6 +62,7 @@ class BkCombobox extends ChoiceField {
53
62
  this.query = "";
54
63
  this.results = [];
55
64
  this.text = "";
65
+ this.searching = false;
56
66
  }
57
67
  /** A search combobox shows a magnifier unless it has its own `icon`; `icon=""` shows none. */
58
68
  get leadIcon() {
@@ -62,7 +72,7 @@ class BkCombobox extends ChoiceField {
62
72
  get hasClear() {
63
73
  return this.clearable || this.type === "search";
64
74
  }
65
- /** All options: the `search` results if a provider is set, else the children, else `options`. */
75
+ /** All options: the `search` results if a provider is set, else the children, else `options`. In search mode, the children and `options` give only labels (`labelOf`). */
66
76
  get allOptions() {
67
77
  return this.search ? this.results : super.allOptions;
68
78
  }
@@ -73,6 +83,14 @@ class BkCombobox extends ChoiceField {
73
83
  super.disconnectedCallback();
74
84
  clearTimeout(this.timer);
75
85
  this.controller?.abort();
86
+ if (this.searching) {
87
+ this.searching = false;
88
+ this.loading = false;
89
+ }
90
+ }
91
+ /** The list waits for options: a search is scheduled or runs, or the app set `loading`. */
92
+ get busy() {
93
+ return this.loading || this.searching;
76
94
  }
77
95
  static styles = [...choiceFieldStyles("combobox"), css`
78
96
  :host { --_bk-text-field-font-size: var(--bk-combobox-font-size); }
@@ -108,7 +126,14 @@ class BkCombobox extends ChoiceField {
108
126
  resetValue() {
109
127
  super.resetValue();
110
128
  this.query = "";
111
- this.text = this.multiple ? "" : this.labelOf(this.value);
129
+ if (this.multiple)
130
+ this.text = "";
131
+ else
132
+ this.showLabel();
133
+ }
134
+ /** Puts the label of the value in the text field. */
135
+ showLabel() {
136
+ this.text = this.shownLabel = this.labelOf(this.value);
112
137
  }
113
138
  get changeable() {
114
139
  return super.changeable && !this.readonly;
@@ -147,8 +172,10 @@ class BkCombobox extends ChoiceField {
147
172
  this.activeIndex = chosen >= 0 && move >= 0 ? chosen : move === 0 ? -1 : edgeOption(this.visible, move);
148
173
  }
149
174
  /* ---------- data ---------- */
175
+ /** The label of value `v`. In search mode, the children and `options` give the label of a value that no result has. */
150
176
  labelOf(v) {
151
- return this.allOptions.find((o) => o.value === v)?.label ?? this.labelCache.get(v) ?? v;
177
+ const find = (list) => list.find((o) => o.value === v)?.label;
178
+ return find(this.allOptions) ?? this.labelCache.get(v) ?? (this.search ? find(super.allOptions) : void 0) ?? v;
152
179
  }
153
180
  remember(o) {
154
181
  this.labelCache.set(o.value, o.label);
@@ -176,7 +203,7 @@ class BkCombobox extends ChoiceField {
176
203
  }
177
204
  if (this.maxed)
178
205
  list = list.map((o) => this.selection.includes(o.value) || o.disabled ? o : { ...o, disabled: true });
179
- if (this.allowCustom && q && !this.maxed && !this.loading && !this.resolve(q) && !this.selection.includes(q)) {
206
+ if (this.allowCustom && q && !this.maxed && !this.busy && !this.resolve(q) && !this.selection.includes(q)) {
180
207
  const label = this.addLabel ? this.addLabel.replaceAll("{query}", q) : this.i18n.t("comboboxAdd", { query: q });
181
208
  list = [...list, { value: q, label, icon: "add", custom: true }];
182
209
  }
@@ -196,14 +223,15 @@ class BkCombobox extends ChoiceField {
196
223
  this.close();
197
224
  }
198
225
  super.willUpdate(changed);
199
- const optionsChanged = changed.has("options") || changed.has("childOptions") || changed.has("results");
226
+ const optionsChanged = changed.has("options") || changed.has("childOptions") || changed.has("results") || changed.has("search");
200
227
  if (optionsChanged) {
201
228
  for (const o of this.allOptions)
202
229
  if (this.selection.includes(o.value))
203
230
  this.remember(o);
204
231
  }
205
- if (!this.multiple && (changed.has("value") || changed.has("values") || optionsChanged && !this.query))
206
- this.text = this.labelOf(this.value);
232
+ if (!this.multiple && (changed.has("value") || changed.has("values") || optionsChanged && this.text === this.shownLabel))
233
+ this.showLabel();
234
+ this.loader.set(this.busy);
207
235
  this.visible = this.computeVisible();
208
236
  if (this.activeIndex >= this.visible.length)
209
237
  this.activeIndex = -1;
@@ -216,8 +244,12 @@ class BkCombobox extends ChoiceField {
216
244
  scheduleSearch() {
217
245
  clearTimeout(this.timer);
218
246
  this.controller?.abort();
219
- if (!this.search)
247
+ if (!this.search) {
248
+ if (this.searching)
249
+ this.searching = this.loading = false;
220
250
  return;
251
+ }
252
+ this.searching = true;
221
253
  this.loading = true;
222
254
  const q = this.query.trim();
223
255
  this.timer = setTimeout(() => this.runSearch(q), Math.max(0, this.debounce));
@@ -234,6 +266,8 @@ class BkCombobox extends ChoiceField {
234
266
  return;
235
267
  this.results = [];
236
268
  }
269
+ this.searched = q;
270
+ this.searching = false;
237
271
  this.loading = false;
238
272
  if (this.expanded && this.query.trim() && !this.allowCustom)
239
273
  this.activeIndex = edgeOption(this.computeVisible(), 1);
@@ -333,7 +367,7 @@ class BkCombobox extends ChoiceField {
333
367
  this.commit([t]);
334
368
  this.text = t;
335
369
  } else
336
- this.text = this.labelOf(this.value);
370
+ this.showLabel();
337
371
  }
338
372
  removeValue(v) {
339
373
  if (this.isDisabled || this.readonly)
@@ -400,7 +434,7 @@ class BkCombobox extends ChoiceField {
400
434
  }
401
435
  const form = this.internals.form;
402
436
  if (form)
403
- setTimeout(() => form.requestSubmit());
437
+ setTimeout(() => submitImplicitly(form));
404
438
  return;
405
439
  }
406
440
  case ",":
@@ -459,9 +493,17 @@ class BkCombobox extends ChoiceField {
459
493
  this.control?.focus();
460
494
  }
461
495
  /* ---------- popup ---------- */
462
- /** Something to show: options, the loading row, or the empty row. */
496
+ /**
497
+ * The empty row shows: no option matches the query, and the answer is complete. With `search`, a search for this
498
+ * query has ended. Before that, the list is busy and shows no empty row.
499
+ */
500
+ get noResults() {
501
+ const q = this.query.trim();
502
+ return !this.busy && !this.visible.length && !!q && !this.allowCustom && (!this.search || this.searched === q);
503
+ }
504
+ /** Something to show: options, the spinner row, or the empty row. */
463
505
  get hasContent() {
464
- return this.loading || this.visible.length > 0 || !!this.query.trim() && !this.allowCustom;
506
+ return this.loader.visible || this.visible.length > 0 || this.noResults;
465
507
  }
466
508
  get popupShown() {
467
509
  return this.expanded && this.hasContent;
@@ -497,15 +539,15 @@ class BkCombobox extends ChoiceField {
497
539
  get announcement() {
498
540
  if (!this.expanded)
499
541
  return "";
500
- if (this.loading)
501
- return this.i18n.t("comboboxLoading");
542
+ if (this.busy)
543
+ return this.loader.visible ? this.i18n.t("comboboxLoading") : "";
502
544
  if (!this.query.trim())
503
545
  return "";
504
546
  const count = this.visible.filter((o) => !o.custom).length;
505
547
  const add = this.visible.find((o) => o.custom);
506
548
  if (!count && add)
507
549
  return add.label;
508
- return count ? this.i18n.t("comboboxResults", { count }) : this.allowCustom ? "" : this.emptyText || this.i18n.t("comboboxNoResults");
550
+ return count ? this.i18n.t("comboboxResults", { count }) : this.noResults ? this.emptyText || this.i18n.t("comboboxNoResults") : "";
509
551
  }
510
552
  render() {
511
553
  const invalid = this.showInvalid;
@@ -515,8 +557,9 @@ class BkCombobox extends ChoiceField {
515
557
  const name = this.label ? void 0 : this.forwardedName;
516
558
  const expanded = this.popupShown;
517
559
  const opts = this.visible;
518
- const empty = !this.loading && !opts.length && !!this.query.trim() && !this.allowCustom;
519
- const more = this.loading && opts.length > 0;
560
+ const busy = this.busy;
561
+ const empty = this.noResults;
562
+ const more = busy && opts.length > 0;
520
563
  return html`<div @focusout=${this.onFocusOut}>
521
564
  ${this.renderField(html`<div class="${this.boxClass}${tags ? " has-tags" : ""}${expanded ? " open" : ""}" part="box" @click=${this.onBoxClick}>
522
565
  ${this.renderStart()}
@@ -538,9 +581,9 @@ class BkCombobox extends ChoiceField {
538
581
  ${this.type === "search" ? nothing : html`<bk-icon class="chevron" part="chevron" name="chevron-down"></bk-icon>`}
539
582
  </div>`)}
540
583
  <div popover="manual" part="popup" @toggle=${this.onPopupToggle} @mousedown=${(e) => e.preventDefault()}>
541
- ${this.loading && !more ? html`<div class="status" part="status"><bk-spinner></bk-spinner>${this.i18n.t("comboboxLoading")}</div>` : nothing}
584
+ ${this.loader.visible && !opts.length && !empty ? html`<div class="status" part="status"><bk-spinner></bk-spinner>${this.i18n.t("comboboxLoading")}</div>` : nothing}
542
585
  <div role="listbox" part="listbox" id=${listId} aria-label=${this.label || name || this.i18n.t("options")}
543
- aria-multiselectable=${this.multiple ? "true" : nothing} aria-busy=${this.loading ? "true" : nothing}>
586
+ aria-multiselectable=${this.multiple ? "true" : nothing} aria-busy=${busy ? "true" : nothing}>
544
587
  ${this.renderRows(this.rowLabel, more)}
545
588
  </div>
546
589
  ${empty ? html`<div class="status" part="status">${this.emptyText || this.i18n.t("comboboxNoResults")}</div>` : nothing}
@@ -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
@@ -68,6 +72,9 @@ export interface DialogCloseDetail {
68
72
  *
69
73
  * i18n keys: `moveWindow`, `resizeWindow` (names of the two handles); `move-label` and `resize-label` override them.
70
74
  *
75
+ * In a dialog with a height (`size="full"` or `--bk-dialog-height`), the body takes the height that the header and the footer
76
+ * leave. Content with `block-size: 100%` fills it, for example `<bk-model-viewer fill>`. Taller content scrolls in the body.
77
+ *
71
78
  * @slot - Body content.
72
79
  * @slot header - Custom header content. It replaces `heading` and `description`.
73
80
  * @slot start - Leading content of the header, before the heading, for example a `<bk-icon-tile>` that shows what the dialog is about.
@@ -83,7 +90,7 @@ export interface DialogCloseDetail {
83
90
  * @csspart body - The body wrapper element.
84
91
  * @csspart footer - The footer row.
85
92
  * @cssprop --bk-dialog-width - Width (default from `size`: --bk-dialog-width-sm|md|lg).
86
- * @cssprop --bk-dialog-height - Height (default fit-content; a `bare` dialog that contains a viewer sets it).
93
+ * @cssprop --bk-dialog-height - Height (default fit-content; `size="full"` fills the viewport; a `bare` dialog that contains a viewer sets it).
87
94
  * @cssprop --bk-dialog-max-width - Maximum width (default the viewport minus --bk-space-4 on each side).
88
95
  * @cssprop --bk-dialog-max-height - Maximum height (default the viewport minus --bk-space-8 on each side).
89
96
  * @cssprop --bk-dialog-margin - Position in the viewport (default auto = centred).
@@ -107,7 +114,7 @@ export interface DialogCloseDetail {
107
114
  * @keyboard Escape - Close the dialog (fires a cancelable `cancel`; not with `dismissible="false"`).
108
115
  * @keyboard Tab, Shift + Tab - Move the focus inside the dialog. It does not leave the dialog (not with `floating`).
109
116
  * @keyboard Arrow keys - On the move button or the resize handle of a floating dialog: move or resize it (Shift: larger steps).
110
- * @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.
111
118
  * @tag bk-dialog
112
119
  */
113
120
  export declare class BkDialog extends LitElement {
@@ -174,7 +181,7 @@ export declare class BkDialog extends LitElement {
174
181
  size: "sm" | "md" | "lg" | "full";
175
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. */
176
183
  dismissible: boolean;
177
- /** 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. */
178
185
  alert: boolean;
179
186
  /** Accessible name of the close button (default: i18n `close`). */
180
187
  closeLabel: string;
@@ -236,6 +243,9 @@ export declare class BkDialog extends LitElement {
236
243
  private onCancel;
237
244
  /** The native dialog closed on its own (for example `requestClose()` without a cancelable cancel): sync the state. */
238
245
  private onNativeClose;
246
+ private backdropPress;
247
+ private onBackdropPress;
248
+ /** Light dismiss: the press and the click are both on the backdrop (see `BackdropPress`). */
239
249
  private onBackdrop;
240
250
  private floatState;
241
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";
@@ -157,6 +159,8 @@ class BkDialog extends LitElement {
157
159
  --_bk-dialog-row: max(var(--_bk-dialog-start, 0px), var(--_bk-dialog-lh));
158
160
  }
159
161
  .header.single .lead, .header.single .end { display: flex; align-items: center; flex: none; block-size: var(--_bk-dialog-row); }
162
+ /* An empty start slot takes no space and no gap: the heading starts on the edge of the body. */
163
+ .header .lead[hidden] { display: none; }
160
164
  .header.single .titles { padding-block-start: calc((var(--_bk-dialog-row) - var(--_bk-dialog-lh)) / 2); }
161
165
  .header.single .close { margin-block-start: 0; }
162
166
  .heading {
@@ -165,8 +169,10 @@ class BkDialog extends LitElement {
165
169
  }
166
170
  .desc { margin: 0; text-wrap-style: var(--bk-body-wrap); color: var(--bk-text-muted); font-size: var(--bk-type-body); line-height: var(--bk-line-height-body); }
167
171
  .close { margin: calc(-1 * var(--bk-space-1-5)) calc(-1 * var(--bk-space-2)) 0 0; }
172
+ /* The body takes the height that the header and the footer leave. In a dialog with a height (size="full",
173
+ --bk-dialog-height) that height is definite: content with block-size: 100% fills it, taller content scrolls. */
168
174
  .body {
169
- position: relative; flex: 1; overflow: auto; overscroll-behavior: contain; padding: var(--bk-dialog-gap, var(--bk-space-4)) var(--_bk-dialog-pad);
175
+ position: relative; flex: 1; min-block-size: 0; overflow: auto; overscroll-behavior: contain; padding: var(--bk-dialog-gap, var(--bk-space-4)) var(--_bk-dialog-pad);
170
176
  color: var(--bk-text-muted); font-size: var(--bk-type-body); line-height: var(--bk-line-height-body);
171
177
  }
172
178
  .footer {
@@ -198,6 +204,8 @@ class BkDialog extends LitElement {
198
204
  super.disconnectedCallback();
199
205
  this.startSize.disconnect();
200
206
  unlockScroll(this);
207
+ if (this.dialog)
208
+ trackModal(this.dialog, false);
201
209
  this.stopPlacing();
202
210
  window.removeEventListener("resize", this.onViewport);
203
211
  }
@@ -262,6 +270,7 @@ class BkDialog extends LitElement {
262
270
  } else {
263
271
  d.showModal();
264
272
  lockScroll(this);
273
+ trackModal(d, true);
265
274
  }
266
275
  this.focusFirst();
267
276
  this.syncCommandSource();
@@ -271,6 +280,7 @@ class BkDialog extends LitElement {
271
280
  if (d.open)
272
281
  d.close();
273
282
  unlockScroll(this);
283
+ trackModal(d, false);
274
284
  this.stopPlacing();
275
285
  window.removeEventListener("resize", this.onViewport);
276
286
  if (hadFocus && this.opener instanceof HTMLElement && this.opener.isConnected)
@@ -345,14 +355,16 @@ class BkDialog extends LitElement {
345
355
  if (this.open)
346
356
  this.close("");
347
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`). */
348
363
  onBackdrop(e) {
364
+ const hit = this.backdropPress.isBackdropClick(e);
349
365
  if (this.alert)
350
366
  return;
351
- if (e.target !== this.dialog)
352
- return;
353
- const r = this.dialog.getBoundingClientRect();
354
- const inside = e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom;
355
- if (!inside)
367
+ if (hit)
356
368
  this.dismiss();
357
369
  }
358
370
  // ---- floating: move and resize --------------------------------------------------------------
@@ -548,11 +560,11 @@ class BkDialog extends LitElement {
548
560
  const bareName = this.bare ? this.heading || void 0 : void 0;
549
561
  return html`<dialog part="dialog" tabindex="-1" role=${this.alert ? "alertdialog" : nothing} aria-labelledby=${this.heading && !this.bare ? "heading" : nothing}
550
562
  aria-label=${bareName ?? nothing}
551
- 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}>
552
564
  <div class="header ${hasHeader ? "" : "header-empty"} ${this.description || this.slots.has("header") ? "" : "single"}" part="header" @pointerdown=${this.onHeaderDown}>
553
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")}
554
566
  aria-pressed=${this.placing === "move" ? "true" : "false"} @click=${this.onMoveClick} @keydown=${this.onMoveKey}></bk-button>` : nothing}
555
- <span class="lead"><slot name="start" @slotchange=${this.measureStart}></slot></span>
567
+ <span class="lead" ?hidden=${!this.slots.has("start")}><slot name="start" @slotchange=${this.measureStart}></slot></span>
556
568
  <div class="titles">
557
569
  <slot name="header">
558
570
  ${this.heading ? html`<div class="heading" id="heading" part="heading" role="heading" aria-level=${this.level}>${this.heading}</div>` : 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;
@@ -56,7 +56,7 @@ class BkErrorSummary extends LitElement {
56
56
  static styles = [base, css`
57
57
  :host { display: block; outline: none; }
58
58
  :host(:state(empty)) { display: none; }
59
- :host(:focus-visible[data-keyboard]) bk-alert::part(base) { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset); }
59
+ :host(:focus-visible:state(key-focus)) bk-alert::part(base) { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset); }
60
60
  ul { display: grid; gap: var(--bk-error-summary-gap, var(--bk-space-1)); margin: 0; padding-inline-start: var(--bk-space-4); }
61
61
  ul:empty { display: none; }
62
62
  a {
@@ -76,8 +76,6 @@ class BkErrorSummary extends LitElement {
76
76
  }
77
77
  connectedCallback() {
78
78
  super.connectedCallback();
79
- if (!this.hasAttribute("tabindex"))
80
- this.tabIndex = -1;
81
79
  trackInput();
82
80
  this.watch();
83
81
  if (!this.watched && document.readyState === "loading")
@@ -107,11 +105,22 @@ class BkErrorSummary extends LitElement {
107
105
  const empty = !this.entries.length && !this.slots.has("");
108
106
  empty ? this.internals.states.add("empty") : this.internals.states.delete("empty");
109
107
  }
108
+ /**
109
+ * Focuses the summary. The summary gets `tabindex="-1"` only for this focus and removes it when the focus leaves:
110
+ * the element has no attribute that the app did not write until the summary opens.
111
+ */
112
+ focus(options) {
113
+ if (!this.hasAttribute("tabindex")) {
114
+ this.setAttribute("tabindex", "-1");
115
+ this.addEventListener("blur", () => this.removeAttribute("tabindex"), { once: true });
116
+ }
117
+ super.focus(options);
118
+ }
110
119
  updated() {
111
120
  if (this.focusPending) {
112
121
  this.focusPending = false;
113
122
  if (this.entries.length) {
114
- this.toggleAttribute("data-keyboard", keyboardInput);
123
+ keyboardInput ? this.internals.states.add("key-focus") : this.internals.states.delete("key-focus");
115
124
  this.focus({ preventScroll: true, focusVisible: keyboardInput });
116
125
  this.scrollIntoView({ block: "nearest" });
117
126
  }
@@ -15,18 +15,20 @@ class BkFactsItem extends LitElement {
15
15
  }
16
16
  static styles = [base, css`
17
17
  :host {
18
- display: var(--_bk-facts-display, grid); flex-wrap: wrap; align-content: start; min-width: 0;
19
- gap: var(--bk-facts-item-gap, var(--bk-space-1)) var(--_bk-facts-col-gap, 0px);
18
+ display: grid; align-content: start; min-width: 0;
19
+ row-gap: var(--bk-facts-item-gap, var(--bk-space-1)); grid-column: var(--_bk-facts-span, auto);
20
+ grid-template-columns: var(--_bk-facts-subgrid, none);
20
21
  padding-block: var(--_bk-facts-pad, 0px); align-items: baseline;
21
22
  }
22
23
  /* A long word (a German compound) breaks inside the label column: hyphens in the language of the page, else anywhere. */
23
- .label { flex: var(--_bk-facts-label-flex, none); min-inline-size: 0; hyphens: auto; overflow-wrap: anywhere; }
24
- .value { flex: var(--_bk-facts-value-flex, none); }
25
- .actions { flex: none; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--bk-space-cluster); justify-self: start; }
24
+ .label { grid-area: var(--_bk-facts-label-area, auto); min-inline-size: 0; padding-inline-end: var(--_bk-facts-col-gap, 0px); hyphens: auto; overflow-wrap: anywhere; }
25
+ .actions { grid-area: var(--_bk-facts-actions-area, auto); display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--bk-space-cluster); justify-self: start; }
26
+ .actions:not([hidden]) { margin-inline-start: var(--_bk-facts-col-gap, 0px); }
26
27
  .actions[hidden] { display: none; }
28
+ :host([data-type="number"]) .value { text-align: end; font-variant-numeric: tabular-nums; }
27
29
  :host([wide]) { grid-column: 1 / -1; }
28
30
  .label { font-size: var(--bk-facts-item-label-size, var(--bk-label-size, var(--bk-text-xs))); font-weight: var(--bk-label-weight, inherit); text-transform: var(--bk-label-transform, none); letter-spacing: var(--bk-label-tracking, normal); line-height: var(--bk-line-height-heading); font-family: var(--bk-font-label, inherit); color: var(--bk-facts-item-label-fg, var(--bk-label-color, var(--bk-text-muted))); }
29
- .value { min-width: 0; font-size: var(--bk-facts-item-value-size, var(--bk-type-body)); line-height: var(--bk-line-height-body); color: var(--bk-facts-item-value-fg, var(--bk-text)); overflow-wrap: anywhere; }
31
+ .value { grid-area: var(--_bk-facts-value-area, auto); min-width: 0; font-size: var(--bk-facts-item-value-size, var(--bk-type-body)); line-height: var(--bk-line-height-body); color: var(--bk-facts-item-value-fg, var(--bk-text)); overflow-wrap: break-word; }
30
32
  `];
31
33
  slots = new SlotController(this);
32
34
  render() {