@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
@@ -4,6 +4,9 @@ import { repeat } from "lit/directives/repeat.js";
4
4
  import { define } from "../internal/define.js";
5
5
  import { emitDetail } from "../internal/events.js";
6
6
  import { LocalizeController } from "../i18n.js";
7
+ import { announce } from "../internal/announcer.js";
8
+ import { DRAG_THRESHOLD, INTERACTIVE, preventEvent, suppressClick } from "../internal/drag.js";
9
+ import { adoptLightStyles } from "../internal/light-styles.js";
7
10
  import { StateController } from "../internal/state.js";
8
11
  import { base, grip } from "../internal/styles.js";
9
12
  import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
@@ -12,6 +15,13 @@ const MOVE_MS = 260;
12
15
  const ENTER_MS = 220;
13
16
  const LEAVE_MS = 150;
14
17
  const EASE = "cubic-bezier(0.2, 0, 0, 1)";
18
+ const handleStyles = css`
19
+ @layer bk.components {
20
+ bk-split-grid [data-split-grid-handle] { cursor: var(--bk-split-grid-handle-cursor, grab); touch-action: none; }
21
+ bk-split-grid[dragging] [data-split-grid-handle] { cursor: var(--bk-split-grid-dragging-cursor, grabbing); }
22
+ }
23
+ `;
24
+ const NATIVE_CONTROL = "a[href], button, summary, input, select, textarea";
15
25
  const parseSizes = (v) => v ? v.split(/[\s,]+/).map((x) => parseFloat(x)).filter((x) => Number.isFinite(x)) : void 0;
16
26
  const valid = (v, n) => Array.isArray(v) && v.length === n && v.every((x) => typeof x === "number" && x > 0);
17
27
  const normalize = (v) => {
@@ -68,6 +78,11 @@ class BkSplitGrid extends LitElement {
68
78
  this.fr = [];
69
79
  this.rfr = [];
70
80
  this.scrolling = false;
81
+ this.addEventListener("pointerdown", this.onPaneDown);
82
+ this.addEventListener("keydown", this.onPaneKey);
83
+ this.addEventListener("focusin", this.onPaneFocusIn);
84
+ this.addEventListener("focusout", this.onPaneFocusOut);
85
+ this.addEventListener("dragstart", this.onNativeDrag);
71
86
  }
72
87
  /** The panes: element children that are not hidden. */
73
88
  get panes() {
@@ -209,9 +224,11 @@ class BkSplitGrid extends LitElement {
209
224
  this.mutations.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ["hidden"] });
210
225
  this.observePanes();
211
226
  this.sizer.observe(this);
227
+ adoptLightStyles(this, handleStyles);
212
228
  }
213
229
  disconnectedCallback() {
214
230
  super.disconnectedCallback();
231
+ this.endDrag(false);
215
232
  this.mutations.disconnect();
216
233
  this.paneObserver.disconnect();
217
234
  this.sizer.disconnect();
@@ -235,6 +252,8 @@ class BkSplitGrid extends LitElement {
235
252
  const moved = panes.length !== this.shown.length || panes.some((t, i) => t !== this.shown[i]) || zoom !== this.shownZoom;
236
253
  if (moved)
237
254
  this.observePanes();
255
+ if (moved && this.drag)
256
+ this.panesChanged = true;
238
257
  const n = this.columnCount;
239
258
  const r = this.rowCount;
240
259
  if (!this.resizing) {
@@ -251,6 +270,10 @@ class BkSplitGrid extends LitElement {
251
270
  this.shownRows = r;
252
271
  }
253
272
  updated() {
273
+ if (this.panesChanged) {
274
+ this.panesChanged = false;
275
+ this.endDrag(false);
276
+ }
254
277
  const cells = this.cells();
255
278
  cells.forEach(([pane, cell]) => {
256
279
  const slot = cell.querySelector("slot");
@@ -305,6 +328,387 @@ class BkSplitGrid extends LitElement {
305
328
  await Promise.all(anims.map((a) => a.finished.catch(() => void 0)));
306
329
  setTimeout(() => anims.forEach((a) => a.cancel()), 500);
307
330
  }
331
+ /* ---------------------------------------------------------------- moving panes */
332
+ /** The move of a pane, while it lasts (also before the pointer passed the threshold). */
333
+ drag = null;
334
+ panesChanged = false;
335
+ restoreFocus = 0;
336
+ /** The pane that an event happened in: the child of the element on its path. */
337
+ paneOf(e) {
338
+ return e.composedPath().find((n) => n instanceof HTMLElement && n.parentElement === this && this.shown.includes(n)) ?? null;
339
+ }
340
+ /** The handle on the path of the event inside `pane`, unless a control lies between (it keeps its press). */
341
+ handleOf(e, pane) {
342
+ const path = e.composedPath();
343
+ const end = path.indexOf(pane);
344
+ const handle = path.slice(0, end < 0 ? path.length : end + 1).find((n) => n instanceof HTMLElement && n.hasAttribute("data-split-grid-handle"));
345
+ if (!handle)
346
+ return null;
347
+ for (const n of path) {
348
+ if (n === handle)
349
+ break;
350
+ if (n instanceof HTMLElement && n.matches(INTERACTIVE) && !handle.shadowRoot?.contains(n))
351
+ return null;
352
+ }
353
+ return handle;
354
+ }
355
+ nameOf(pane, handle) {
356
+ const text = pane.dataset.splitGridLabel || pane.getAttribute("aria-label") || (handle ?? pane.querySelector("[data-split-grid-handle]"))?.textContent || "";
357
+ return text.replace(/\s+/g, " ").trim().slice(0, 80);
358
+ }
359
+ say(key, d, index) {
360
+ announce(this.i18n.t(key, { item: this.nameOf(d.pane, d.handle), position: index + 1, total: this.shown.length }));
361
+ }
362
+ cellOf(index) {
363
+ return this.renderRoot.querySelectorAll(".cell")[index] ?? null;
364
+ }
365
+ /** Moves the drop mark to the pane at `to` (`from`: no mark). */
366
+ setTarget(d, to) {
367
+ if (to === d.to)
368
+ return;
369
+ if (d.to !== d.from)
370
+ this.cellOf(d.to)?.classList.remove("target");
371
+ d.to = to;
372
+ if (to !== d.from)
373
+ this.cellOf(to)?.classList.add("target");
374
+ }
375
+ onPaneDown = (e) => {
376
+ if (this.drag || e.button !== 0 || !e.isPrimary)
377
+ return;
378
+ const pane = this.paneOf(e);
379
+ const handle = pane && this.handleOf(e, pane);
380
+ if (!pane || !handle)
381
+ return;
382
+ const from = this.shown.indexOf(pane);
383
+ this.drag = {
384
+ keyboard: false,
385
+ pane,
386
+ handle,
387
+ from,
388
+ to: from,
389
+ started: false,
390
+ id: e.pointerId,
391
+ x0: e.clientX,
392
+ y0: e.clientY,
393
+ x: e.clientX,
394
+ y: e.clientY,
395
+ offX: 0,
396
+ offY: 0,
397
+ raf: 0,
398
+ rects: null,
399
+ box: null,
400
+ outside: false
401
+ };
402
+ window.addEventListener("pointermove", this.onDragMove, true);
403
+ window.addEventListener("pointerup", this.onDragUp, true);
404
+ window.addEventListener("pointercancel", this.onDragCancel, true);
405
+ };
406
+ /** Lifts the pane: the look, the ghost, the boxes of the cells. */
407
+ startDrag(d) {
408
+ d.started = true;
409
+ try {
410
+ d.handle.setPointerCapture(d.id);
411
+ } catch {
412
+ }
413
+ this.setAttribute("dragging", "");
414
+ this.cellOf(d.from)?.classList.add("dragging");
415
+ getSelection()?.removeAllRanges();
416
+ document.addEventListener("selectstart", preventEvent, true);
417
+ window.addEventListener("touchmove", preventEvent, { passive: false });
418
+ window.addEventListener("keydown", this.onDragKey, true);
419
+ window.addEventListener("scroll", this.onDragScroll, true);
420
+ d.handle.addEventListener("lostpointercapture", this.onDragCancel);
421
+ this.measureDrag(d);
422
+ const ghost = this.renderRoot.querySelector(".ghost");
423
+ if (!ghost)
424
+ return;
425
+ const h = d.handle.getBoundingClientRect();
426
+ ghost.textContent = this.nameOf(d.pane, d.handle);
427
+ ghost.style.inlineSize = `${Math.round(h.width)}px`;
428
+ ghost.style.minBlockSize = `${Math.round(h.height)}px`;
429
+ ghost.style.transform = `translate(${Math.round(h.left)}px, ${Math.round(h.top)}px)`;
430
+ ghost.showPopover?.();
431
+ const g = ghost.getBoundingClientRect();
432
+ d.offX = Math.min(Math.max(d.x0 - h.left, 0), g.width);
433
+ d.offY = Math.min(Math.max(d.y0 - h.top, 0), g.height);
434
+ d.ghostW = g.width;
435
+ d.ghostH = g.height;
436
+ }
437
+ /** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
438
+ measureDrag(d) {
439
+ d.rects = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.hidden ? null : c.getBoundingClientRect());
440
+ d.box = (this.renderRoot.querySelector(".scroller") ?? this).getBoundingClientRect();
441
+ }
442
+ onDragScroll = () => {
443
+ if (this.drag)
444
+ this.drag.rects = null;
445
+ };
446
+ onDragMove = (e) => {
447
+ const d = this.drag;
448
+ if (!d || d.keyboard || e.pointerId !== d.id)
449
+ return;
450
+ d.x = e.clientX;
451
+ d.y = e.clientY;
452
+ if (!d.started) {
453
+ if (Math.hypot(d.x - d.x0, d.y - d.y0) < DRAG_THRESHOLD)
454
+ return;
455
+ this.startDrag(d);
456
+ }
457
+ e.preventDefault();
458
+ d.raf ||= requestAnimationFrame(() => this.dragFrame(d));
459
+ };
460
+ /** One frame of a pointer drag: move the ghost, find the target, tell the app about the outside (unless `last`). */
461
+ dragFrame(d, last = false) {
462
+ d.raf = 0;
463
+ if (this.drag !== d)
464
+ return;
465
+ if (!d.rects)
466
+ this.measureDrag(d);
467
+ const ghost = this.renderRoot.querySelector(".ghost");
468
+ if (ghost) {
469
+ const x = Math.min(Math.max(d.x - d.offX, 0), Math.max(0, window.innerWidth - (d.ghostW ?? 0)));
470
+ const y = Math.min(Math.max(d.y - d.offY, 0), Math.max(0, window.innerHeight - (d.ghostH ?? 0)));
471
+ ghost.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
472
+ }
473
+ const b = d.box;
474
+ const inside = d.x >= b.left && d.x <= b.right && d.y >= b.top && d.y <= b.bottom;
475
+ if (!inside) {
476
+ this.setTarget(d, d.from);
477
+ d.outside = true;
478
+ if (!last)
479
+ this.emitOutside("dragoutside", d, false);
480
+ return;
481
+ }
482
+ const at2 = d.rects.findIndex((r) => !!r && d.x >= r.left && d.x <= r.right && d.y >= r.top && d.y <= r.bottom);
483
+ this.setTarget(d, at2 < 0 ? d.from : at2);
484
+ if (d.outside) {
485
+ d.outside = false;
486
+ this.emitOutside("dragoutside", d, true);
487
+ }
488
+ }
489
+ emitOutside(type, d, inside) {
490
+ const point = { pane: d.pane, clientX: d.x, clientY: d.y };
491
+ if (type === "dropoutside")
492
+ emitDetail(this, type, point);
493
+ else
494
+ emitDetail(this, type, { ...point, inside });
495
+ }
496
+ onDragUp = (e) => {
497
+ const d = this.drag;
498
+ if (!d || d.keyboard || e.pointerId !== d.id)
499
+ return;
500
+ if (!d.started) {
501
+ this.endDrag(false);
502
+ return;
503
+ }
504
+ d.x = e.clientX;
505
+ d.y = e.clientY;
506
+ cancelAnimationFrame(d.raf);
507
+ this.dragFrame(d, true);
508
+ suppressClick();
509
+ this.endDrag(true);
510
+ };
511
+ onDragCancel = (e) => {
512
+ const d = this.drag;
513
+ if (!d || d.keyboard || e.pointerId !== d.id)
514
+ return;
515
+ this.endDrag(false);
516
+ };
517
+ /** Escape during a pointer drag. */
518
+ onDragKey = (e) => {
519
+ if (e.key !== "Escape" || !this.drag?.started || this.drag.keyboard)
520
+ return;
521
+ e.preventDefault();
522
+ e.stopPropagation();
523
+ this.endDrag(false);
524
+ };
525
+ /** A native drag of a link or an image in a handle conflicts with the pointer drag. */
526
+ onNativeDrag = (e) => {
527
+ if (this.drag && !this.drag.keyboard)
528
+ e.preventDefault();
529
+ };
530
+ /** Ends a move. With `commit`, a drop on another pane fires `reorder` and a drop outside fires `dropoutside`. */
531
+ endDrag(commit) {
532
+ const d = this.drag;
533
+ if (!d)
534
+ return;
535
+ this.drag = null;
536
+ cancelAnimationFrame(d.raf);
537
+ window.removeEventListener("pointermove", this.onDragMove, true);
538
+ window.removeEventListener("pointerup", this.onDragUp, true);
539
+ window.removeEventListener("pointercancel", this.onDragCancel, true);
540
+ window.removeEventListener("keydown", this.onDragKey, true);
541
+ window.removeEventListener("scroll", this.onDragScroll, true);
542
+ window.removeEventListener("touchmove", preventEvent);
543
+ document.removeEventListener("selectstart", preventEvent, true);
544
+ d.handle.removeEventListener("lostpointercapture", this.onDragCancel);
545
+ if (!d.started && !d.keyboard)
546
+ return;
547
+ if (d.handle.hasPointerCapture?.(d.id))
548
+ d.handle.releasePointerCapture(d.id);
549
+ this.removeAttribute("dragging");
550
+ for (const c of this.renderRoot.querySelectorAll(".cell"))
551
+ c.classList.remove("dragging", "target");
552
+ const ghost = this.renderRoot.querySelector(".ghost");
553
+ if (ghost?.matches(":popover-open"))
554
+ ghost.hidePopover();
555
+ if (d.outside) {
556
+ if (commit)
557
+ this.emitOutside("dropoutside", d, false);
558
+ this.emitOutside("dragoutside", d, true);
559
+ return;
560
+ }
561
+ if (!commit || d.to === d.from) {
562
+ if (d.keyboard)
563
+ this.say(commit ? "sortableDropped" : "sortableCancelled", d, d.from);
564
+ return;
565
+ }
566
+ const order = this.shown.filter((p) => p !== d.pane);
567
+ order.splice(d.to, 0, d.pane);
568
+ if (!emitDetail(this, "reorder", { pane: d.pane, from: d.from, to: d.to, order }, true)) {
569
+ this.say("sortableCancelled", d, d.from);
570
+ return;
571
+ }
572
+ this.say("sortableDropped", d, d.to);
573
+ if (d.keyboard) {
574
+ const handle = d.handle;
575
+ cancelAnimationFrame(this.restoreFocus);
576
+ this.updateComplete.then(() => {
577
+ this.restoreFocus = requestAnimationFrame(() => {
578
+ if (handle.isConnected && !handle.matches(":focus-within"))
579
+ handle.focus({ preventScroll: true });
580
+ });
581
+ });
582
+ }
583
+ }
584
+ /* ---------------------------------------------------------------- moving panes with the keyboard */
585
+ /** The handle that a key or focus event comes from: a focused handle that is not a native control (it keeps its keys). */
586
+ keyHandle(e, pane) {
587
+ const handle = this.handleOf(e, pane);
588
+ return handle && e.composedPath()[0] === handle && !handle.matches(NATIVE_CONTROL) ? handle : null;
589
+ }
590
+ onPaneFocusIn = (e) => {
591
+ const pane = this.paneOf(e);
592
+ const handle = pane && this.keyHandle(e, pane);
593
+ if (handle && !handle.hasAttribute("aria-description")) {
594
+ handle.setAttribute("aria-description", this.i18n.t("sortableInstructions"));
595
+ }
596
+ };
597
+ onPaneFocusOut = (e) => {
598
+ const d = this.drag;
599
+ if (!d?.keyboard)
600
+ return;
601
+ const to = e.relatedTarget;
602
+ if (!to || !d.pane.contains(to))
603
+ this.endDrag(false);
604
+ };
605
+ onPaneKey = (e) => {
606
+ const d = this.drag;
607
+ if (!d) {
608
+ if (e.key !== " " && e.key !== "Enter" || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
609
+ return;
610
+ const pane = this.paneOf(e);
611
+ const handle = pane && this.keyHandle(e, pane);
612
+ if (!pane || !handle || this.zoomedPane || this.shown.length < 2)
613
+ return;
614
+ e.preventDefault();
615
+ e.stopPropagation();
616
+ const from = this.shown.indexOf(pane);
617
+ this.drag = {
618
+ keyboard: true,
619
+ pane,
620
+ handle,
621
+ from,
622
+ to: from,
623
+ started: true,
624
+ id: -1,
625
+ x0: 0,
626
+ y0: 0,
627
+ x: 0,
628
+ y: 0,
629
+ offX: 0,
630
+ offY: 0,
631
+ raf: 0,
632
+ rects: null,
633
+ box: null,
634
+ outside: false
635
+ };
636
+ this.cellOf(from)?.classList.add("dragging");
637
+ this.say("sortablePickedUp", this.drag, from);
638
+ return;
639
+ }
640
+ if (!d.keyboard)
641
+ return;
642
+ const last = this.shown.length - 1;
643
+ const rtl = this.matches(":dir(rtl)");
644
+ let to = d.to;
645
+ switch (e.key) {
646
+ case " ":
647
+ case "Enter":
648
+ e.preventDefault();
649
+ e.stopPropagation();
650
+ this.endDrag(true);
651
+ return;
652
+ case "Escape":
653
+ e.preventDefault();
654
+ e.stopPropagation();
655
+ this.endDrag(false);
656
+ return;
657
+ case "Tab":
658
+ this.endDrag(false);
659
+ return;
660
+ case (rtl ? "ArrowRight" : "ArrowLeft"):
661
+ to = Math.max(0, to - 1);
662
+ break;
663
+ case (rtl ? "ArrowLeft" : "ArrowRight"):
664
+ to = Math.min(last, to + 1);
665
+ break;
666
+ case "ArrowUp":
667
+ to = this.vertical(to, -1);
668
+ break;
669
+ case "ArrowDown":
670
+ to = this.vertical(to, 1);
671
+ break;
672
+ case "Home":
673
+ to = 0;
674
+ break;
675
+ case "End":
676
+ to = last;
677
+ break;
678
+ default:
679
+ return;
680
+ }
681
+ e.preventDefault();
682
+ e.stopPropagation();
683
+ if (to === d.to)
684
+ return;
685
+ this.setTarget(d, to);
686
+ this.cellOf(to)?.scrollIntoView({ block: "nearest", inline: "nearest" });
687
+ this.say("sortableMoved", d, to);
688
+ };
689
+ /** The pane above (-1) or below (1) the one at index `at`: the nearest by the middle of its column. */
690
+ vertical(at2, dir) {
691
+ const boxes = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.getBoundingClientRect());
692
+ const from = boxes[at2];
693
+ if (!from)
694
+ return at2;
695
+ const mid = from.left + from.width / 2;
696
+ let best = at2;
697
+ let score = Infinity;
698
+ boxes.forEach((b, i) => {
699
+ if (i === at2 || b.width === 0)
700
+ return;
701
+ const ahead = dir < 0 ? b.bottom <= from.top + 1 : b.top >= from.bottom - 1;
702
+ if (!ahead)
703
+ return;
704
+ const dist = Math.abs(dir < 0 ? from.top - b.bottom : b.top - from.bottom) * 4 + Math.abs(b.left + b.width / 2 - mid);
705
+ if (dist < score) {
706
+ score = dist;
707
+ best = i;
708
+ }
709
+ });
710
+ return best;
711
+ }
308
712
  emitSizes(type) {
309
713
  emitDetail(this, type, { sizes: [...this.fr], rowSizes: [...this.rfr] });
310
714
  }
@@ -500,8 +904,32 @@ class BkSplitGrid extends LitElement {
500
904
  @media (hover: hover) { .divider:hover::after { background: var(--bk-split-grid-divider-color, var(--bk-line-hover)); } }
501
905
  .divider.active::after, .divider:focus-visible::after { background: var(--bk-split-grid-divider-active, var(--bk-accent-solid)); }
502
906
  @media (prefers-reduced-motion: reduce) { .divider::after { transition: none; } }
907
+
908
+ /* Moving a pane: the lifted pane, the drop mark and the ghost that follows the pointer. */
909
+ :host([dragging]) { user-select: none; -webkit-user-select: none; }
910
+ .cell.dragging { opacity: var(--bk-split-grid-drag-opacity, 0.45); }
911
+ .cell.target {
912
+ outline: var(--bk-split-grid-drop-width, var(--bk-focus-width)) solid var(--bk-split-grid-drop-color, var(--bk-accent-solid));
913
+ outline-offset: var(--bk-focus-offset);
914
+ border-radius: var(--bk-split-grid-drop-radius, var(--bk-radius-container, var(--bk-radius-lg)));
915
+ }
916
+ .ghost {
917
+ position: fixed; inset: 0 auto auto 0; margin: 0; pointer-events: none;
918
+ max-inline-size: var(--bk-split-grid-ghost-max-width, var(--bk-measure-display));
919
+ align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
920
+ padding: 0 var(--bk-split-grid-ghost-padding, var(--bk-space-3));
921
+ color: var(--bk-split-grid-ghost-color, var(--bk-text)); font: inherit; font-size: var(--bk-type-small); font-weight: var(--bk-weight-medium);
922
+ line-height: var(--bk-line-height-body);
923
+ background: var(--bk-split-grid-ghost-bg, var(--bk-layer-overlay-bg));
924
+ border: var(--bk-border-width) solid var(--bk-split-grid-ghost-border, var(--bk-layer-overlay-border));
925
+ border-radius: var(--bk-split-grid-ghost-radius, var(--bk-radius-md));
926
+ box-shadow: var(--bk-split-grid-ghost-shadow, var(--bk-layer-overlay-shadow), var(--bk-ring-focus));
927
+ cursor: var(--bk-split-grid-dragging-cursor, grabbing);
928
+ }
929
+ .ghost:popover-open { display: flex; }
503
930
  @media (forced-colors: active) {
504
931
  .divider.active::after, .divider:focus-visible::after { background: Highlight; }
932
+ .cell.target { outline-color: Highlight; }
505
933
  }
506
934
  `];
507
935
  render() {
@@ -527,7 +955,7 @@ class BkSplitGrid extends LitElement {
527
955
  const roomOf = (axis) => Math.max(1, (axis === "col" ? this.width : this.gridHeight) - this.gapPx * ((axis === "col" ? n : r) - 1));
528
956
  const startOf = (across, k, count) => k === 0 ? "0" : trackStart(across, k, count);
529
957
  const endOf = (across, k, count) => k === across.length - 1 && count === across.length ? "0" : `calc(100% - ${trackEnd(across, k, count)})`;
530
- return html`<div class="scroller" part="scroller" role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
958
+ return html`<div class="scroller" part="scroller" @scroll=${this.onDragScroll} role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
531
959
  aria-label=${this.scrolling ? this.label || this.i18n.t("content") : nothing}><div class="grid ${stacked ? "stacked" : ""}" style=${styleMap({ gridTemplateColumns: columns, minWidth, minHeight, ...rows, ...template })}>
532
960
  ${repeat(panes, (t) => t, (t, i) => html`<div class="cell" part="cell" style=${styleMap({ gridArea: areas ? letters[i] : void 0 })} ?hidden=${!!zoom && zoom !== t}><slot></slot></div>`)}
533
961
  ${this.segments().map(({ axis, index: i, from, to }) => {
@@ -540,7 +968,7 @@ class BkSplitGrid extends LitElement {
540
968
  data-axis=${axis} data-index=${i} style=${styleMap(style)}
541
969
  @pointerdown=${this.onDividerDown} @keydown=${this.onDividerKey} @dblclick=${this.onDividerReset}><span class="bk-grip" aria-hidden="true"></span></div>`;
542
970
  })}
543
- </div></div>`;
971
+ </div></div><div class="ghost" part="ghost" popover="manual" aria-hidden="true"></div>`;
544
972
  }
545
973
  }
546
974
  define("bk-split-grid", BkSplitGrid);
@@ -1,5 +1,6 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { define } from "../internal/define.js";
3
+ import { setHostVars } from "../internal/host-vars.js";
3
4
  import { base } from "../internal/styles.js";
4
5
  class BkStatGroup extends LitElement {
5
6
  static properties = {
@@ -41,7 +42,7 @@ class BkStatGroup extends LitElement {
41
42
  `];
42
43
  willUpdate(changed) {
43
44
  if (changed.has("min"))
44
- this.min ? this.style.setProperty("--_bk-stat-group-min", this.min) : this.style.removeProperty("--_bk-stat-group-min");
45
+ setHostVars(this, { "--_bk-stat-group-min": this.min || "" });
45
46
  }
46
47
  render() {
47
48
  return html`<div class="row" part="row"><slot></slot></div>`;
@@ -15,6 +15,11 @@ import "../icons/set/trending-up.js";
15
15
  * delta-label="vs September"><bk-chart-sparkline slot="chart" label="Monthly active users" .values=${trend}></bk-chart-sparkline></bk-stat>
16
16
  * ```
17
17
  *
18
+ * `value-text` shows ready text instead of the formatted `value`, for a figure that the app has already formatted
19
+ * ("345.867"). A plain numeric string in `value` is still a number, and the stat formats it. `delta-text` does the same
20
+ * for the change. The text is shown as it is, and screen readers read it. `value` and `delta` still give the number,
21
+ * the direction and the tone.
22
+ *
18
23
  * The colour of the delta shows whether the change is good. Up is good by default. Set `inverted` for
19
24
  * measures where down is good (costs, latency, error rate). Status colours show that meaning only
20
25
  * here, always with the icon and a word for screen readers, never with colour alone. `variant="chip"`
@@ -37,6 +42,8 @@ import "../icons/set/trending-up.js";
37
42
  * @tag bk-stat
38
43
  * @slot - Note under the value (instead of `note`).
39
44
  * @slot start - A visual before the figures (an icon tile).
45
+ * @slot label - Rich label instead of the `label` attribute, for example with a footnote marker.
46
+ * @slot value - Rich value instead of the formatted `value`, for example "up to 155 €" with a footnote marker. `value` still gives the number.
40
47
  * @slot chart - A sparkline or meter under the figures.
41
48
  * @csspart start - The box around the `start` slot.
42
49
  * @csspart label - The label.
@@ -49,6 +56,8 @@ import "../icons/set/trending-up.js";
49
56
  * @cssprop --bk-stat-gap - Space between the rows (default --bk-space-1; xl --bk-space-4).
50
57
  * @cssprop --bk-stat-start-gap - Space between the `start` slot and the figures (default --bk-space-3).
51
58
  * @cssprop --bk-stat-label-color - Label colour (default --bk-text-muted).
59
+ * @cssprop --bk-stat-label-transform - Label text transform (default none).
60
+ * @cssprop --bk-stat-label-tracking - Label letter spacing (default normal; for uppercase use --bk-tracking-label).
52
61
  * @cssprop --bk-stat-label-size - Label size (default --bk-type-small; xl --bk-type-lead).
53
62
  * @cssprop --bk-stat-value-color - Value colour (default --bk-text; with `tone` --bk-{tone}-text).
54
63
  * @cssprop --bk-stat-value-size - Value size (default sm --bk-type-h3, md --bk-type-h2, lg --bk-chart-hero-size, xl twice --bk-type-display, at most 8/3 of --bk-text-3xl, 80px by default: a fluid display size does not make it larger).
@@ -66,6 +75,9 @@ export declare class BkStat extends LitElement {
66
75
  static properties: {
67
76
  label: {};
68
77
  value: {};
78
+ valueText: {
79
+ attribute: string;
80
+ };
69
81
  unit: {};
70
82
  valueFormat: {
71
83
  attribute: string;
@@ -86,6 +98,9 @@ export declare class BkStat extends LitElement {
86
98
  attribute: string;
87
99
  type: ObjectConstructor;
88
100
  };
101
+ deltaText: {
102
+ attribute: string;
103
+ };
89
104
  deltaLabel: {
90
105
  attribute: string;
91
106
  };
@@ -110,6 +125,8 @@ export declare class BkStat extends LitElement {
110
125
  label: string;
111
126
  /** The value: a number (formatted in full in the locale) or ready text. */
112
127
  value: number | string | undefined;
128
+ /** Ready text for the value, shown as it is instead of the formatted `value` (like `aria-valuetext`). Use it for a figure that the app has formatted. */
129
+ valueText: string | undefined;
113
130
  /** Unit after the value ("ms", "GB"); for currencies and percent use `value-format`. */
114
131
  unit: string | undefined;
115
132
  /** Intl.NumberFormat options for the value (`{"minimumFractionDigits":2}` shows 13.10). */
@@ -122,6 +139,8 @@ export declare class BkStat extends LitElement {
122
139
  delta: number | undefined;
123
140
  /** Intl.NumberFormat options for the delta (`{"style":"percent"}` reads 0.084 as +8.4 %). */
124
141
  deltaFormat: Intl.NumberFormatOptions | undefined;
142
+ /** Ready text for the change, shown as it is instead of the formatted `delta`. The sign of `delta` still sets the direction and the tone. */
143
+ deltaText: string | undefined;
125
144
  /** The comparison period ("vs last month"). */
126
145
  deltaLabel: string | undefined;
127
146
  /** Down is good (costs, latency, error rate). */
@@ -14,12 +14,14 @@ class BkStat extends LitElement {
14
14
  static properties = {
15
15
  label: {},
16
16
  value: {},
17
+ valueText: { attribute: "value-text" },
17
18
  unit: {},
18
19
  valueFormat: { attribute: "value-format", type: Object },
19
20
  notation: { reflect: true, useDefault: true },
20
21
  variant: { reflect: true, useDefault: true },
21
22
  delta: { type: Number },
22
23
  deltaFormat: { attribute: "delta-format", type: Object },
24
+ deltaText: { attribute: "delta-text" },
23
25
  deltaLabel: { attribute: "delta-label" },
24
26
  inverted: { type: Boolean, reflect: true },
25
27
  note: {},
@@ -49,7 +51,7 @@ class BkStat extends LitElement {
49
51
  .start { display: flex; flex: none; }
50
52
  /* A centred band (\`bk-page-section align="center"\`) centres the rows: the value, the label, the change and the note. */
51
53
  .stat { flex: 1; align-self: stretch; display: flex; flex-direction: column; align-items: var(--_bk-page-section-items, stretch); gap: var(--bk-stat-gap, var(--bk-space-1)); min-width: 0; }
52
- .label { font-size: var(--bk-stat-label-size, var(--bk-type-small)); color: var(--bk-stat-label-color, var(--bk-text-muted)); line-height: var(--bk-line-height-tight); }
54
+ .label { text-transform: var(--bk-stat-label-transform, none); letter-spacing: var(--bk-stat-label-tracking, normal); font-size: var(--bk-stat-label-size, var(--bk-type-small)); color: var(--bk-stat-label-color, var(--bk-text-muted)); line-height: var(--bk-line-height-tight); }
53
55
  .figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--bk-space-1); min-width: 0; }
54
56
  .value {
55
57
  font-size: var(--_bk-stat-size); font-weight: var(--bk-stat-value-weight, var(--bk-weight-semibold));
@@ -85,6 +87,8 @@ class BkStat extends LitElement {
85
87
  .chart { align-self: stretch; margin-block-start: auto; padding-block-start: var(--bk-space-1); min-width: 0; }
86
88
  `];
87
89
  formattedValue() {
90
+ if (this.valueText)
91
+ return this.valueText;
88
92
  const v = this.value;
89
93
  if (v === void 0 || v === null || v === "")
90
94
  return "\u2013";
@@ -100,7 +104,7 @@ class BkStat extends LitElement {
100
104
  const locale = this.i18n.locale;
101
105
  const dir = deltaDirection(d);
102
106
  const tone = deltaTone(dir, this.inverted);
103
- const text = formatDelta(locale, d, this.deltaFormat);
107
+ const text = this.deltaText || formatDelta(locale, d, this.deltaFormat);
104
108
  const word = chartT(locale, dir === "up" ? "statUp" : dir === "down" ? "statDown" : "statFlat");
105
109
  const icon = dir === "up" ? "trending-up" : "trending-down";
106
110
  return html`<div class="delta" part="delta">
@@ -110,8 +114,8 @@ class BkStat extends LitElement {
110
114
  }
111
115
  render() {
112
116
  const hasNote = !!this.note || this.slots.has("");
113
- const label = html`<span class="label" part="label">${this.label}</span>`;
114
- const figure = html`<span class="figure"><span class="value" part="value">${this.formattedValue()}</span>${this.unit ? html`<span class="unit" part="unit">${this.unit}</span>` : nothing}</span>`;
117
+ const label = html`<span class="label" part="label"><slot name="label">${this.label}</slot></span>`;
118
+ const figure = html`<span class="figure"><span class="value" part="value"><slot name="value">${this.formattedValue()}</slot></span>${this.unit ? html`<span class="unit" part="unit">${this.unit}</span>` : nothing}</span>`;
115
119
  const delta = this.renderDelta();
116
120
  const rows = this.order === "value-first" ? [figure, label, delta] : this.order === "delta-first" ? [delta, figure, label] : [label, figure, delta];
117
121
  return html`<div class="root">
@@ -1,5 +1,6 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { define } from "../internal/define.js";
3
+ import { setHostVars } from "../internal/host-vars.js";
3
4
  import { base } from "../internal/styles.js";
4
5
  import "./bk-steps-item.js";
5
6
  class BkSteps extends LitElement {
@@ -42,7 +43,7 @@ class BkSteps extends LitElement {
42
43
  count++;
43
44
  el.requestUpdate();
44
45
  }
45
- this.style.setProperty("--_bk-steps-count", String(Math.max(count, 1)));
46
+ setHostVars(this, { "--_bk-steps-count": String(Math.max(count, 1)) });
46
47
  }
47
48
  render() {
48
49
  return html`<div class="list" part="base"><slot @slotchange=${this.refreshSteps}></slot></div>`;
@@ -78,6 +78,8 @@ export declare class BkSurface extends LitElement {
78
78
  selected: boolean;
79
79
  /** Tints the surface: soft background and tone border. Unset (default): no tint. */
80
80
  tone: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | "attention" | undefined;
81
+ /** The state `bk-scope` of a layered surface. */
82
+ private internals;
81
83
  constructor();
82
84
  static styles: import("lit").CSSResult[];
83
85
  protected willUpdate(changed: PropertyValues<this>): void;