@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
@@ -2,7 +2,6 @@ import { LitElement, type PropertyValues } from "lit";
2
2
  import "./bk-button.js";
3
3
  import "./bk-icon.js";
4
4
  import "./bk-menu.js";
5
- import "./bk-menu-item.js";
6
5
  import "../icons/set/add.js";
7
6
  import "../icons/set/more-horiz.js";
8
7
  export type { TabRemoveDetail } from "./bk-tabs-item.js";
@@ -15,6 +14,7 @@ export interface TabSelectDetail {
15
14
  }
16
15
  export type TabsVariant = "underline" | "pills";
17
16
  export type TabsOrientation = "horizontal" | "vertical";
17
+ export type TabsOverflow = "menu" | "scroll";
18
18
  /**
19
19
  * Tabs with panels, following the WAI-ARIA APG Tabs pattern.
20
20
  *
@@ -30,8 +30,9 @@ export type TabsOrientation = "horizontal" | "vertical";
30
30
  * ```
31
31
  *
32
32
  * The `<bk-tabs-item>` children are in the tab list, and the `<bk-tabs-panel>` children are below it. A tab and a
33
- * panel match by `value` (or by position when values are missing). The component sets the ids,
34
- * `aria-controls`/`aria-labelledby`, `aria-selected` and the roving `tabindex`.
33
+ * panel match by `value` (or by position when values are missing). The component gives each tab its state:
34
+ * selected, the roving `tabindex`, the panel that it controls. The tab renders them inside its shadow root.
35
+ * The component writes no attributes on the tabs. On a panel it writes `hidden` and, when the panel has none, `tabindex`.
35
36
  * Keyboard: ←/→ (↑/↓ when vertical) move between tabs and wrap. Home/End move to the first and last tab.
36
37
  * The keys skip disabled tabs. With `activation="automatic"` (default), moving selects the tab. With
37
38
  * `"manual"`, Enter or Space selects it.
@@ -51,8 +52,12 @@ export type TabsOrientation = "horizontal" | "vertical";
51
52
  * `aria-current="page"`). Set `value` from the route of the app.
52
53
  *
53
54
  * **Overflow**: tabs that do not fit the row (horizontal tabs) move into a "More" menu at the end of the row,
54
- * in order. Choosing one selects it, and it moves into the row. The selected tab always stays in the row.
55
+ * in order (`overflow="menu"`, the default). Choosing one selects it, and it moves into the row. The selected tab always stays in the row.
55
56
  * Arrow keys move along the tabs in the row. The More button is the next Tab stop. i18n key: `more`.
57
+ * The entries of link tabs are links: a middle click and "Open in new tab" work, and a plain click fires `select`
58
+ * and `navigate` on the tab, as a click in the row does.
59
+ * With `overflow="scroll"` the row scrolls sideways instead (a swipe on a touch screen, no visible scroll bar).
60
+ * The row scrolls the selected tab into view on the first render and on each selection. Use it on a narrow screen.
56
61
  *
57
62
  * **Closable tabs**: a `<bk-tabs-item removable>` shows a close button and fires `remove` (also on Delete). Unless a
58
63
  * listener cancels it, the tabs remove the tab and its panel and select the next tab.
@@ -143,9 +148,16 @@ export declare class BkTabs extends LitElement {
143
148
  addLabel: {
144
149
  attribute: string;
145
150
  };
151
+ overflow: {
152
+ reflect: boolean;
153
+ useDefault: boolean;
154
+ };
146
155
  overflowed: {
147
156
  state: boolean;
148
157
  };
158
+ menuOpen: {
159
+ state: boolean;
160
+ };
149
161
  };
150
162
  /** Value of the selected tab. Defaults to the first enabled tab. */
151
163
  value: string;
@@ -165,14 +177,26 @@ export declare class BkTabs extends LitElement {
165
177
  addable: boolean;
166
178
  /** Name of the add button (default: i18n `tabAdd`). */
167
179
  addLabel: string | undefined;
180
+ /** What happens with tabs that do not fit the row: `menu` (default) moves them into a "More" menu, `scroll` scrolls the row. */
181
+ overflow: TabsOverflow;
168
182
  private overflowed;
183
+ /** The "More" menu is open: its entries stay as they are until it closes. */
184
+ private menuOpen;
185
+ /** The entries of the open "More" menu. */
186
+ private menuTabs;
187
+ /** The tab with the roving tabindex while the focus moves without a selection (manual activation). */
188
+ private stopKey;
189
+ /** overflow="scroll" showed the selected tab once (the first render). */
190
+ private revealed;
191
+ private readonly internals;
169
192
  private i18n;
170
193
  private resizer;
194
+ /** The sizes of the row, read when one of them changes. `willUpdate` computes `overflowed` from them. */
195
+ private sizes?;
171
196
  private tabs;
172
197
  private panels;
173
198
  private others;
174
199
  private ends;
175
- private readonly key;
176
200
  /** persist-key whose stored value was already applied. */
177
201
  private restored;
178
202
  /** The `value` that the markup sets ("" = the first tab): the tabs return to it when the stored entry is removed. */
@@ -187,6 +211,10 @@ export declare class BkTabs extends LitElement {
187
211
  static styles: import("lit").CSSResult[];
188
212
  protected willUpdate(changed: PropertyValues): void;
189
213
  protected updated(changed: PropertyValues): void;
214
+ /** Gives each tab its state: selected, Tab stop, its panel, in the "More" menu. */
215
+ private syncTabs;
216
+ /** overflow="scroll": scrolls the row so that the selected tab is in view. Runs on the first render and on a selection only. */
217
+ private revealSelected;
190
218
  /** The direct-child tab an event target is in, if any. */
191
219
  private tabFrom;
192
220
  /** Selects a tab after the cancelable `select`. Returns false when a listener cancelled it. */
@@ -196,9 +224,24 @@ export declare class BkTabs extends LitElement {
196
224
  private onClick;
197
225
  private onKeydown;
198
226
  private onFocusout;
199
- /** Moves the tabs that do not fit the row into the "More" menu. The selected tab stays in the row. */
200
- private measureOverflow;
227
+ /** Reads the sizes of the row (in the callback of the resize observer, not during an update). */
228
+ private measure;
229
+ /** The tabs that do not fit the row and go into the "More" menu. The selected tab stays in the row. */
230
+ private overflowFor;
231
+ /** The tab of an entry of the "More" menu. */
232
+ private tabOfEntry;
233
+ /**
234
+ * A click on the link of an entry (capture phase, before the link fires `navigate`): a plain click selects the tab
235
+ * first, as in the row. A cancelled `select` stops the link. A modified click opens the link elsewhere and selects nothing.
236
+ */
237
+ private onMoreClick;
238
+ /** The link of an entry fires `navigate`: the tabs fire it on the tab, as a click in the row does. */
239
+ private onMoreNavigate;
201
240
  private onMoreSelect;
241
+ /** The open menu keeps its entries: a click on an entry ends on the element (and the link) that the user chose. */
242
+ private onMoreOpen;
243
+ /** After the click that closed the menu (and the link that it follows), the entries follow the row again. */
244
+ private onMoreClose;
202
245
  private onRemove;
203
246
  /** Removes a tab and its panel. When the removed tab was selected, its neighbour becomes selected. */
204
247
  private removeTab;
@@ -1,5 +1,6 @@
1
1
  import { LitElement, css, html, nothing } from "lit";
2
2
  import { ifDefined } from "lit/directives/if-defined.js";
3
+ import { repeat } from "lit/directives/repeat.js";
3
4
  import { define } from "../internal/define.js";
4
5
  import { containsDeep, deepActiveElement } from "../internal/anchor.js";
5
6
  import { emit, emitDetail } from "../internal/events.js";
@@ -9,14 +10,13 @@ import { StateController } from "../internal/state.js";
9
10
  import { base, interactive } from "../internal/styles.js";
10
11
  import { BkTabsItem } from "./bk-tabs-item.js";
11
12
  import { BkTabsPanel } from "./bk-tabs-panel.js";
13
+ import { BkMenuItem } from "./bk-menu-item.js";
12
14
  import "./bk-button.js";
13
15
  import "./bk-icon.js";
14
16
  import "./bk-menu.js";
15
- import "./bk-menu-item.js";
16
17
  import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
17
18
  import "../icons/set/add.js";
18
19
  import "../icons/set/more-horiz.js";
19
- let uid = 0;
20
20
  const keyOf = (el, i) => el.value || String(i);
21
21
  class BkTabs extends LitElement {
22
22
  static shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: "manual" };
@@ -30,15 +30,25 @@ class BkTabs extends LitElement {
30
30
  persistKey: { attribute: "persist-key" },
31
31
  addable: { type: Boolean, reflect: true },
32
32
  addLabel: { attribute: "add-label" },
33
- overflowed: { state: true }
33
+ overflow: { reflect: true, useDefault: true },
34
+ overflowed: { state: true },
35
+ menuOpen: { state: true }
34
36
  };
37
+ /** The entries of the open "More" menu. */
38
+ menuTabs = [];
39
+ /** The tab with the roving tabindex while the focus moves without a selection (manual activation). */
40
+ stopKey;
41
+ /** overflow="scroll" showed the selected tab once (the first render). */
42
+ revealed = false;
43
+ internals = this.attachInternals();
35
44
  i18n = new LocalizeController(this);
36
- resizer = resizeObserver(() => this.measureOverflow());
45
+ resizer = resizeObserver(() => this.measure());
46
+ /** The sizes of the row, read when one of them changes. `willUpdate` computes `overflowed` from them. */
47
+ sizes;
37
48
  tabs = [];
38
49
  panels = [];
39
50
  others = [];
40
51
  ends = [];
41
- key = `bk-tabs-${++uid}`;
42
52
  /** persist-key whose stored value was already applied. */
43
53
  restored;
44
54
  /** The `value` that the markup sets ("" = the first tab): the tabs return to it when the stored entry is removed. */
@@ -64,6 +74,8 @@ class BkTabs extends LitElement {
64
74
  this.orientation = "horizontal";
65
75
  this.activation = "automatic";
66
76
  this.overflowed = [];
77
+ this.menuOpen = false;
78
+ this.overflow = "menu";
67
79
  this.addable = false;
68
80
  this.addEventListener("remove", this.onRemove);
69
81
  this.addEventListener("click", this.onClick);
@@ -119,7 +131,12 @@ class BkTabs extends LitElement {
119
131
  position: relative; overflow-x: hidden;
120
132
  }
121
133
  /* A tab that does not fit leaves the row but keeps its size, so the row can measure it. */
122
- ::slotted([data-bk-overflow]) { position: absolute; inset-block-start: 0; inset-inline-start: 0; visibility: hidden; pointer-events: none; }
134
+ /* overflow="scroll": the row scrolls sideways, without a visible scroll bar. */
135
+ :host([overflow="scroll"]:not([orientation="vertical"])) .list {
136
+ overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity;
137
+ }
138
+ :host([overflow="scroll"]) ::slotted(bk-tabs-item) { scroll-snap-align: start; }
139
+ :host([overflow="scroll"]) .more { display: none; }
123
140
  .more { flex: none; display: flex; align-items: center; margin-inline-start: calc(var(--bk-tabs-more-gap, var(--bk-space-cluster)) - var(--bk-space-cluster)); }
124
141
  .more.off { position: absolute; inset-block-start: 0; inset-inline-end: 0; visibility: hidden; pointer-events: none; }
125
142
  :host([orientation="vertical"]) .more { display: none; }
@@ -153,7 +170,7 @@ class BkTabs extends LitElement {
153
170
  --_bk-tab-mark-gap: var(--bk-tabs-tab-gap, var(--bk-space-2));
154
171
  --_bk-tab-column-gap: 0;
155
172
  }
156
- :host([orientation="vertical"][data-dots]) {
173
+ :host([orientation="vertical"]:state(dots)) {
157
174
  --_bk-tab-columns: calc(var(--bk-tabs-dot-size, var(--bk-space-2)) + var(--bk-tabs-tab-gap, var(--bk-space-2))) auto minmax(0, 1fr) auto;
158
175
  --_bk-tab-dot-gap: 0;
159
176
  }
@@ -197,7 +214,7 @@ class BkTabs extends LitElement {
197
214
  else
198
215
  this.others.push(el);
199
216
  }
200
- this.toggleAttribute("data-dots", this.tabs.some((t) => t.dot || t.hasAttribute("dot")));
217
+ this.internals.states[this.tabs.some((t) => t.dot || t.hasAttribute("dot")) ? "add" : "delete"]("dots");
201
218
  const enabled = this.tabs.filter((t) => !t.disabled);
202
219
  if (this.persistKey && this.persistKey !== this.restored && this.tabs.length && !this.linkMode) {
203
220
  this.restored = this.persistKey;
@@ -208,6 +225,9 @@ class BkTabs extends LitElement {
208
225
  if (!this.tabs.some((t, i) => keyOf(t, i) === this.value) && enabled.length && !this.linkMode) {
209
226
  this.value = keyOf(enabled[0], this.tabs.indexOf(enabled[0]));
210
227
  }
228
+ const hidden = this.overflowFor();
229
+ if (hidden.length !== this.overflowed.length || hidden.some((t, i) => t !== this.overflowed[i]))
230
+ this.overflowed = hidden;
211
231
  }
212
232
  updated(changed) {
213
233
  super.updated(changed);
@@ -215,60 +235,65 @@ class BkTabs extends LitElement {
215
235
  root.querySelector("slot[name=tab]")?.assign(...this.tabs);
216
236
  root.querySelector("slot[name=panel]")?.assign(...this.panels, ...this.others);
217
237
  root.querySelector("slot[name=end]")?.assign(...this.ends);
218
- const hiddenTabs = new Set(this.overflowed);
219
238
  const bar = root.querySelector(".bar");
220
- if (bar)
221
- this.resizer.observe(bar);
222
- for (const tab of this.tabs) {
223
- tab.toggleAttribute("data-bk-overflow", hiddenTabs.has(tab));
224
- this.resizer.observe(tab);
239
+ for (const el of [bar, root.querySelector(".more"), root.querySelector(".end"), ...this.tabs]) {
240
+ if (el)
241
+ this.resizer.observe(el);
225
242
  }
226
- this.measureOverflow();
243
+ this.syncTabs();
227
244
  const link = this.linkMode;
228
- const panelFor = new Map(this.panels.map((p, i) => [keyOf(p, i), p]));
229
- const tabFor = /* @__PURE__ */ new Map();
230
- this.tabs.forEach((tab, i) => {
231
- const k = keyOf(tab, i);
232
- const selected = k === this.value;
233
- tabFor.set(k, tab);
234
- tab.selected = selected;
235
- if (link) {
236
- for (const a of ["role", "tabindex", "aria-selected", "aria-controls", "aria-disabled"])
237
- tab.removeAttribute(a);
238
- return;
239
- }
240
- if (!tab.id)
241
- tab.id = `${this.key}-tab-${i}`;
242
- const panel = panelFor.get(k);
243
- if (panel && !panel.id)
244
- panel.id = `${this.key}-panel-${i}`;
245
- tab.setAttribute("role", "tab");
246
- tab.setAttribute("aria-selected", String(selected));
247
- tab.tabIndex = selected ? 0 : -1;
248
- if (panel)
249
- tab.setAttribute("aria-controls", panel.id);
250
- else
251
- tab.removeAttribute("aria-controls");
252
- if (tab.disabled)
253
- tab.setAttribute("aria-disabled", "true");
254
- else
255
- tab.removeAttribute("aria-disabled");
256
- });
245
+ const tabFor = new Map(this.tabs.map((t, i) => [keyOf(t, i), t]));
257
246
  this.panels.forEach((panel, i) => {
258
247
  const k = keyOf(panel, i);
259
- const tab = tabFor.get(k);
260
- panel.setAttribute("role", "tabpanel");
248
+ panel.setTab(link ? null : tabFor.get(k) ?? null);
261
249
  if (!panel.hasAttribute("tabindex"))
262
250
  panel.tabIndex = 0;
263
- if (tab && !link)
264
- panel.setAttribute("aria-labelledby", tab.id);
265
- else
266
- panel.removeAttribute("aria-labelledby");
267
251
  if (k === this.value)
268
252
  panel.removeAttribute("hidden");
269
- else
253
+ else if (panel.getAttribute("hidden") !== "until-found")
270
254
  panel.setAttribute("hidden", "until-found");
271
255
  });
256
+ const first = !this.revealed;
257
+ if (first || changed.has("value") || changed.has("overflow"))
258
+ this.revealSelected(first);
259
+ }
260
+ /** Gives each tab its state: selected, Tab stop, its panel, in the "More" menu. */
261
+ syncTabs() {
262
+ const link = this.linkMode;
263
+ const hidden = new Set(this.overflowed);
264
+ const panelFor = new Map(this.panels.map((p, i) => [keyOf(p, i), p]));
265
+ const stop = this.stopKey ?? this.value;
266
+ this.tabs.forEach((tab, i) => {
267
+ const k = keyOf(tab, i);
268
+ tab.setTabState({
269
+ tab: !link,
270
+ selected: k === this.value,
271
+ tabStop: !link && k === stop,
272
+ controls: link ? null : panelFor.get(k) ?? null,
273
+ overflow: hidden.has(tab)
274
+ });
275
+ });
276
+ }
277
+ /** overflow="scroll": scrolls the row so that the selected tab is in view. Runs on the first render and on a selection only. */
278
+ revealSelected(first) {
279
+ if (this.overflow !== "scroll" || this.orientation === "vertical")
280
+ return;
281
+ const tab = this.tabs.find((t, i) => keyOf(t, i) === this.value);
282
+ if (!tab)
283
+ return;
284
+ this.revealed = true;
285
+ Promise.all(this.tabs.map((t) => t.updateComplete)).then(() => {
286
+ const list = this.renderRoot?.querySelector(".list");
287
+ if (!list || !tab.isConnected || list.scrollWidth <= list.clientWidth)
288
+ return;
289
+ const box = list.getBoundingClientRect();
290
+ const r = tab.getBoundingClientRect();
291
+ const dx = r.left < box.left ? r.left - box.left : r.right > box.right ? Math.min(r.right - box.right, r.left - box.left) : 0;
292
+ if (!dx)
293
+ return;
294
+ const still = first || matchMedia("(prefers-reduced-motion: reduce)").matches;
295
+ list.scrollBy({ left: dx, behavior: still ? "instant" : "smooth" });
296
+ });
272
297
  }
273
298
  /** The direct-child tab an event target is in, if any. */
274
299
  tabFrom(target) {
@@ -285,6 +310,7 @@ class BkTabs extends LitElement {
285
310
  if (!emitDetail(this, "select", { value: k, previous: this.value }, true))
286
311
  return false;
287
312
  this.value = k;
313
+ this.stopKey = void 0;
288
314
  if (!tab.href)
289
315
  this.stored.set(k);
290
316
  emit(this, "change");
@@ -333,7 +359,8 @@ class BkTabs extends LitElement {
333
359
  tab.requestRemove();
334
360
  return;
335
361
  }
336
- const enabled = this.tabs.filter((t) => !t.disabled && !t.hasAttribute("data-bk-overflow"));
362
+ const hidden = new Set(this.overflowed);
363
+ const enabled = this.tabs.filter((t) => !t.disabled && !hidden.has(t));
337
364
  if (!enabled.length)
338
365
  return;
339
366
  let target;
@@ -360,68 +387,112 @@ class BkTabs extends LitElement {
360
387
  return;
361
388
  }
362
389
  e.preventDefault();
363
- for (const t of this.tabs)
364
- t.tabIndex = t === target ? 0 : -1;
390
+ this.stopKey = keyOf(target, this.tabs.indexOf(target));
391
+ this.syncTabs();
365
392
  target.focus();
366
393
  if (this.activation !== "manual")
367
394
  this.select(target);
368
395
  };
369
396
  onFocusout = (e) => {
370
- if (this.linkMode || this.tabFrom(e.relatedTarget))
397
+ if (this.linkMode || this.tabFrom(e.relatedTarget) || this.stopKey === void 0)
371
398
  return;
372
- this.tabs.forEach((t, i) => {
373
- if (!t.href)
374
- t.tabIndex = keyOf(t, i) === this.value ? 0 : -1;
375
- });
399
+ this.stopKey = void 0;
400
+ this.syncTabs();
376
401
  };
377
- /** Moves the tabs that do not fit the row into the "More" menu. The selected tab stays in the row. */
378
- measureOverflow() {
402
+ /** Reads the sizes of the row (in the callback of the resize observer, not during an update). */
403
+ measure() {
379
404
  const root = this.renderRoot;
380
405
  const bar = root?.querySelector(".bar");
381
406
  const list = root?.querySelector(".list");
382
407
  const more = root?.querySelector(".more");
383
408
  if (!bar || !list || !more)
384
409
  return;
385
- let hidden = [];
386
- if (this.orientation !== "vertical" && bar.clientWidth > 0 && this.tabs.length > 1) {
387
- const gap = parseFloat(getComputedStyle(list).columnGap) || 0;
388
- const barGap = parseFloat(getComputedStyle(bar).columnGap) || 0;
389
- const end = root.querySelector(".end");
390
- const room = bar.clientWidth - (end ? end.offsetWidth + barGap : 0);
391
- const widths = this.tabs.map((t) => t.offsetWidth);
392
- const total = widths.reduce((a, b) => a + b, 0) + gap * (widths.length - 1);
393
- if (total > room) {
394
- const avail = room - more.offsetWidth - barGap;
395
- const selected = this.tabs.findIndex((t, i) => keyOf(t, i) === this.value);
396
- const shown = /* @__PURE__ */ new Set();
397
- let used = 0;
398
- if (selected >= 0) {
399
- shown.add(selected);
400
- used = widths[selected];
401
- }
402
- for (let i = 0; i < this.tabs.length; i++) {
403
- if (shown.has(i))
404
- continue;
405
- const next = used + (shown.size ? gap : 0) + widths[i];
406
- if (next > avail)
407
- break;
408
- shown.add(i);
409
- used = next;
410
- }
411
- hidden = this.tabs.filter((_, i) => !shown.has(i));
412
- }
410
+ const gap = parseFloat(getComputedStyle(list).columnGap) || 0;
411
+ const barGap = parseFloat(getComputedStyle(bar).columnGap) || 0;
412
+ const end = root.querySelector(".end");
413
+ const room = bar.clientWidth > 0 ? bar.clientWidth - (end ? end.offsetWidth + barGap : 0) : 0;
414
+ const widths = new Map(this.tabs.map((t) => [t, t.offsetWidth]));
415
+ const old = this.sizes;
416
+ const same = old && old.room === room && old.more === more.offsetWidth + barGap && old.gap === gap && old.widths.size === widths.size && [...widths].every(([t, w]) => old.widths.get(t) === w);
417
+ this.sizes = { room, more: more.offsetWidth + barGap, gap, widths };
418
+ if (!same)
419
+ this.requestUpdate();
420
+ }
421
+ /** The tabs that do not fit the row and go into the "More" menu. The selected tab stays in the row. */
422
+ overflowFor() {
423
+ const sizes = this.sizes;
424
+ if (!sizes || sizes.room <= 0 || this.orientation === "vertical" || this.overflow === "scroll" || this.tabs.length < 2)
425
+ return [];
426
+ const widths = this.tabs.map((t) => sizes.widths.get(t) ?? 0);
427
+ const total = widths.reduce((a, b) => a + b, 0) + sizes.gap * (widths.length - 1);
428
+ if (total <= sizes.room)
429
+ return [];
430
+ const avail = sizes.room - sizes.more;
431
+ const selected = this.tabs.findIndex((t, i) => keyOf(t, i) === this.value);
432
+ const shown = /* @__PURE__ */ new Set();
433
+ let used = 0;
434
+ if (selected >= 0) {
435
+ shown.add(selected);
436
+ used = widths[selected];
413
437
  }
414
- if (hidden.length !== this.overflowed.length || hidden.some((t, i) => t !== this.overflowed[i]))
415
- this.overflowed = hidden;
438
+ for (let i = 0; i < this.tabs.length; i++) {
439
+ if (shown.has(i))
440
+ continue;
441
+ const next = used + (shown.size ? sizes.gap : 0) + widths[i];
442
+ if (next > avail)
443
+ break;
444
+ shown.add(i);
445
+ used = next;
446
+ }
447
+ return this.tabs.filter((_, i) => !shown.has(i));
448
+ }
449
+ /** The tab of an entry of the "More" menu. */
450
+ tabOfEntry(e) {
451
+ const entry = e.composedPath().find((n) => n instanceof BkMenuItem);
452
+ return entry ? this.tabs.find((t, i) => keyOf(t, i) === entry.value) : void 0;
416
453
  }
454
+ /**
455
+ * A click on the link of an entry (capture phase, before the link fires `navigate`): a plain click selects the tab
456
+ * first, as in the row. A cancelled `select` stops the link. A modified click opens the link elsewhere and selects nothing.
457
+ */
458
+ onMoreClick = (e) => {
459
+ const tab = this.tabOfEntry(e);
460
+ if (!tab?.href || tab.disabled)
461
+ return;
462
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0)
463
+ return;
464
+ if (!this.select(tab))
465
+ e.preventDefault();
466
+ };
467
+ /** The link of an entry fires `navigate`: the tabs fire it on the tab, as a click in the row does. */
468
+ onMoreNavigate = (e) => {
469
+ const tab = this.tabOfEntry(e);
470
+ if (!tab)
471
+ return;
472
+ e.stopPropagation();
473
+ if (!emitDetail(tab, "navigate", e.detail, true))
474
+ e.preventDefault();
475
+ };
417
476
  onMoreSelect = (e) => {
418
477
  e.stopPropagation();
419
478
  const tab = this.tabs.find((t, i) => keyOf(t, i) === e.detail.value);
420
479
  if (!tab)
421
480
  return;
422
- this.select(tab);
481
+ if (tab.href ? keyOf(tab, this.tabs.indexOf(tab)) !== this.value : !this.select(tab))
482
+ return;
423
483
  this.updateComplete.then(() => requestAnimationFrame(() => tab.focus()));
424
484
  };
485
+ /** The open menu keeps its entries: a click on an entry ends on the element (and the link) that the user chose. */
486
+ onMoreOpen = () => {
487
+ this.menuTabs = this.overflowed;
488
+ this.menuOpen = true;
489
+ };
490
+ /** After the click that closed the menu (and the link that it follows), the entries follow the row again. */
491
+ onMoreClose = () => {
492
+ setTimeout(() => {
493
+ this.menuOpen = false;
494
+ });
495
+ };
425
496
  onRemove = (e) => {
426
497
  const tab = this.tabFrom(e.target);
427
498
  if (!tab)
@@ -457,11 +528,12 @@ class BkTabs extends LitElement {
457
528
  const vertical = this.orientation === "vertical";
458
529
  const list = this.linkMode ? html`<nav class="list" part="tablist" aria-label=${ifDefined(this.label)}><slot name="tab"></slot></nav>` : html`<div class="list" part="tablist" role="tablist" aria-orientation=${vertical ? "vertical" : "horizontal"}
459
530
  aria-label=${ifDefined(this.label)}><slot name="tab"></slot></div>`;
460
- const hidden = this.overflowed;
461
- const more = html`<bk-menu class="more ${hidden.length ? "" : "off"}" part="more" placement="bottom-end" @select=${this.onMoreSelect}>
531
+ const entries = this.menuOpen ? this.menuTabs : this.overflowed;
532
+ const more = html`<bk-menu class="more ${entries.length ? "" : "off"}" part="more" placement="bottom-end" @select=${this.onMoreSelect}
533
+ @click=${{ handleEvent: this.onMoreClick, capture: true }} @navigate=${this.onMoreNavigate} @open=${this.onMoreOpen} @close=${this.onMoreClose}>
462
534
  <bk-button slot="trigger" variant="ghost" size=${this.size} icon="more-horiz" label=${this.i18n.t("more")}></bk-button>
463
- ${hidden.map((t) => html`<bk-menu-item value=${keyOf(t, this.tabs.indexOf(t))} icon=${ifDefined(t.icon)} ?disabled=${t.disabled}
464
- href=${ifDefined(t.href)}>${t.text}</bk-menu-item>`)}
535
+ ${repeat(entries, (t) => t, (t) => html`<bk-menu-item value=${keyOf(t, this.tabs.indexOf(t))} icon=${ifDefined(t.icon)} ?disabled=${t.disabled}
536
+ href=${ifDefined(t.href)} target=${ifDefined(t.target)} rel=${ifDefined(t.rel)} download=${ifDefined(t.download)}>${t.text}</bk-menu-item>`)}
465
537
  </bk-menu>`;
466
538
  const add = this.addable ? html`<button class="add interactive" part="add" type="button" title=${this.addLabel || this.i18n.t("tabAdd")}
467
539
  aria-label=${this.addLabel || this.i18n.t("tabAdd")} @click=${() => emit(this, "add")}><bk-icon name="add"></bk-icon></button>` : nothing;
@@ -1,5 +1,6 @@
1
1
  import { LitElement, css, html, nothing } from "lit";
2
2
  import { define } from "../internal/define.js";
3
+ import { setHostVars } from "../internal/host-vars.js";
3
4
  import { LocalizeController } from "../i18n.js";
4
5
  import { emitToggle } from "../internal/events.js";
5
6
  import { base, headingType, displayType } from "../internal/styles.js";
@@ -237,7 +238,7 @@ class BkText extends LitElement {
237
238
  if (changed.has("level"))
238
239
  this.syncHeading();
239
240
  if (changed.has("lines"))
240
- this.lines ? this.style.setProperty("--_bk-text-lines", String(this.lines)) : this.style.removeProperty("--_bk-text-lines");
241
+ setHostVars(this, { "--_bk-text-lines": this.lines ? String(this.lines) : "" });
241
242
  if (changed.has("overflow") || changed.has("expandable") || changed.has("lines") || changed.has("highlight"))
242
243
  this.observeClamp();
243
244
  }
@@ -50,7 +50,8 @@ export interface ToastPromiseMessages<T> {
50
50
  * above open dialogs), timers that pause while the pointer or the focus is on the toasts, and one
51
51
  * overlay surface per toast. While a modal dialog is open, everything outside it is inert. The
52
52
  * toaster then moves into the dialog and returns to its place when the dialog closes, so toasts stay
53
- * operable and announced. The content of each toast is a `<bk-toast>`, which you can also use inline.
53
+ * operable and announced. This also applies to a `<bk-dialog>` or `<bk-drawer>` in a shadow root (the navigation
54
+ * drawer of `<bk-shell-app>`), and to toasts that show already when the dialog opens. The content of each toast is a `<bk-toast>`, which you can also use inline.
54
55
  *
55
56
  * A toast can change after it shows: `toast()` returns a handle whose `update()` replaces the message, the tone
56
57
  * and the heading in place (a pending save turns into "Saved"). The toaster announces each update once, politely
@@ -120,6 +121,7 @@ export declare class BkToastGroup extends LitElement {
120
121
  /** Why the timers wait: the `pointer` or the `focus` is on the toasts, the user drags a toast (`swipe`), the tab is `hidden` (WCAG 2.2.1). */
121
122
  private holds;
122
123
  private stopKeyboard?;
124
+ private stopModals?;
123
125
  /** Where the toaster sits while it is in a modal dialog: the way back. */
124
126
  private home?;
125
127
  private i18n;
@@ -3,7 +3,7 @@ import { styleMap } from "../internal/style-map.js";
3
3
  import { repeat } from "lit/directives/repeat.js";
4
4
  import { define } from "../internal/define.js";
5
5
  import { LocalizeController } from "../i18n.js";
6
- import { topModal } from "../internal/announcer.js";
6
+ import { topModal, watchModals } from "../internal/announcer.js";
7
7
  import { emitLifecycle } from "../internal/events.js";
8
8
  import { trackKeyboardInset } from "../internal/viewport.js";
9
9
  import { base, srOnly } from "../internal/styles.js";
@@ -19,6 +19,7 @@ class BkToastGroup extends LitElement {
19
19
  /** Why the timers wait: the `pointer` or the `focus` is on the toasts, the user drags a toast (`swipe`), the tab is `hidden` (WCAG 2.2.1). */
20
20
  holds = /* @__PURE__ */ new Set();
21
21
  stopKeyboard;
22
+ stopModals;
22
23
  /** Where the toaster sits while it is in a modal dialog: the way back. */
23
24
  home;
24
25
  i18n = new LocalizeController(this);
@@ -48,12 +49,21 @@ class BkToastGroup extends LitElement {
48
49
  if (document.hidden)
49
50
  this.hold("hidden");
50
51
  this.stopKeyboard = trackKeyboardInset();
52
+ this.stopModals = watchModals(() => {
53
+ if (!this.isConnected || !this.items.length)
54
+ return;
55
+ this.relocate();
56
+ if (!this.matches(":popover-open"))
57
+ this.showPopover();
58
+ });
51
59
  }
52
60
  disconnectedCallback() {
53
61
  super.disconnectedCallback();
54
62
  document.removeEventListener("visibilitychange", this.onVisibility);
55
63
  this.stopKeyboard?.();
56
64
  this.stopKeyboard = void 0;
65
+ this.stopModals?.();
66
+ this.stopModals = void 0;
57
67
  this.holds.clear();
58
68
  }
59
69
  /** Moves the toaster into the open modal dialog (inert outside it); moves it back when none is open. */
@@ -16,7 +16,9 @@ import "./bk-kbd.js";
16
16
  *
17
17
  * The tooltip sets the text as the accessible description of the target (`aria-description` on the element
18
18
  * that receives the focus, for example the inner `<button>` of a `<bk-button>`; ARIA id references cannot reach into
19
- * shadow roots). The tooltip does not set the description when the text only repeats the `aria-label` of the target. A native `title`
19
+ * shadow roots). The tooltip does not set the description when the text only repeats the `aria-label` of the target.
20
+ * Content of the `content` slot with `aria-hidden="true"` shows but is not part of the description (a label that the
21
+ * name already contains). A native `title`
20
22
  * on that element is removed while the tooltip is attached, so the two do not duplicate each other.
21
23
  *
22
24
  * `shortcut` shows the keys of the action after the text, as keycaps for the platform (`Mod+K`
@@ -8,6 +8,7 @@ const HIDE_GRACE = 100;
8
8
  const WARM_WINDOW = 300;
9
9
  let current = null;
10
10
  let lastHidden = 0;
11
+ const spokenText = (node) => node instanceof Element ? node.getAttribute("aria-hidden") === "true" ? "" : [...node.childNodes].map(spokenText).join("") : node.nodeType === Node.TEXT_NODE ? node.textContent ?? "" : "";
11
12
  class BkTooltip extends LitElement {
12
13
  static properties = {
13
14
  content: {},
@@ -177,7 +178,7 @@ class BkTooltip extends LitElement {
177
178
  }
178
179
  /** The tooltip text as plain text. */
179
180
  get text() {
180
- const slotted = [...this.children].filter((c) => c.slot === "content").map((c) => c.textContent ?? "").join(" ");
181
+ const slotted = [...this.children].filter((c) => c.slot === "content").map(spokenText).join(" ");
181
182
  return (this.content || slotted).replace(/\s+/g, " ").trim();
182
183
  }
183
184
  /** Sets the text as the description of the element that receives the focus. */
@@ -445,9 +445,9 @@ class BkVideo extends LitElement {
445
445
  </div>
446
446
  <span class="time" part="time" aria-hidden="true">${this.clock(this.duration)}</span>
447
447
  <bk-button class="mute" variant="ghost" size="sm" icon=${this.muted ? "volume-off" : "volume-up"} label=${this.i18n.t("mute")}
448
- ?pressed=${this.muted} @click=${this.toggleMute}></bk-button>
448
+ .pressed=${this.muted} @click=${this.toggleMute}></bk-button>
449
449
  ${this.hasCaptions ? html`<bk-button class="cc" variant="ghost" size="sm" icon=${this.captions ? "closed-caption-fill" : "closed-caption"}
450
- label=${this.i18n.t("captions")} ?pressed=${this.captions} @click=${this.toggleCaptions}></bk-button>` : nothing}
450
+ label=${this.i18n.t("captions")} .pressed=${this.captions} @click=${this.toggleCaptions}></bk-button>` : nothing}
451
451
  ${this.canFullscreen ? html`<bk-button class="fs" variant="ghost" size="sm" icon=${this.fullscreen ? "fullscreen-exit" : "fullscreen"}
452
452
  label=${this.fullscreen ? this.i18n.t("exitFullscreen") : this.i18n.t("fullscreen")} @click=${this.toggleFullscreen}></bk-button>` : nothing}
453
453
  </div>`;