@bk2k/ui 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/BUILDING.md +56 -2
  2. package/CHANGELOG.md +136 -0
  3. package/USAGE.md +89 -26
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/chart-tokens.js +1 -1
  6. package/dist/charts/fields.d.ts +20 -0
  7. package/dist/charts/fields.js +27 -0
  8. package/dist/charts/frame.js +2 -1
  9. package/dist/clipboard.js +1 -0
  10. package/dist/components/bk-alert.js +2 -1
  11. package/dist/components/bk-avatar-group.js +4 -6
  12. package/dist/components/bk-avatar.d.ts +10 -0
  13. package/dist/components/bk-avatar.js +17 -0
  14. package/dist/components/bk-bar.js +2 -0
  15. package/dist/components/bk-button-group.js +1 -1
  16. package/dist/components/bk-button-top.js +2 -1
  17. package/dist/components/bk-button.d.ts +37 -14
  18. package/dist/components/bk-button.js +52 -16
  19. package/dist/components/bk-card.d.ts +4 -0
  20. package/dist/components/bk-card.js +15 -2
  21. package/dist/components/bk-carousel-controls.d.ts +2 -0
  22. package/dist/components/bk-carousel-controls.js +4 -2
  23. package/dist/components/bk-chart-area.d.ts +6 -0
  24. package/dist/components/bk-chart-bar.d.ts +17 -0
  25. package/dist/components/bk-chart-bar.js +25 -4
  26. package/dist/components/bk-chart-line.d.ts +13 -0
  27. package/dist/components/bk-chart-line.js +11 -1
  28. package/dist/components/bk-chip-group.d.ts +2 -2
  29. package/dist/components/bk-chip-group.js +4 -0
  30. package/dist/components/bk-chip.d.ts +53 -8
  31. package/dist/components/bk-chip.js +43 -7
  32. package/dist/components/bk-code.js +6 -2
  33. package/dist/components/bk-columns.d.ts +11 -0
  34. package/dist/components/bk-columns.js +8 -1
  35. package/dist/components/bk-combobox.d.ts +1 -1
  36. package/dist/components/bk-combobox.js +2 -1
  37. package/dist/components/bk-delta.d.ts +10 -0
  38. package/dist/components/bk-delta.js +8 -6
  39. package/dist/components/bk-dialog.d.ts +12 -5
  40. package/dist/components/bk-dialog.js +14 -6
  41. package/dist/components/bk-disclosure.js +4 -2
  42. package/dist/components/bk-drop-target.d.ts +7 -1
  43. package/dist/components/bk-drop-target.js +20 -4
  44. package/dist/components/bk-error-summary.d.ts +5 -0
  45. package/dist/components/bk-error-summary.js +13 -4
  46. package/dist/components/bk-facts.js +3 -2
  47. package/dist/components/bk-footnote.d.ts +73 -0
  48. package/dist/components/bk-footnote.js +97 -0
  49. package/dist/components/bk-footnotes-item.d.ts +92 -0
  50. package/dist/components/bk-footnotes-item.js +139 -0
  51. package/dist/components/bk-footnotes.d.ts +51 -0
  52. package/dist/components/bk-footnotes.js +43 -0
  53. package/dist/components/bk-icon.js +2 -2
  54. package/dist/components/bk-image-compare.d.ts +33 -5
  55. package/dist/components/bk-image-compare.js +72 -24
  56. package/dist/components/bk-image-crop.d.ts +3 -3
  57. package/dist/components/bk-image-editor.d.ts +1 -1
  58. package/dist/components/bk-image-viewer.d.ts +107 -11
  59. package/dist/components/bk-image-viewer.js +205 -34
  60. package/dist/components/bk-input-inline.d.ts +15 -6
  61. package/dist/components/bk-input-inline.js +22 -6
  62. package/dist/components/bk-input-number.js +2 -1
  63. package/dist/components/bk-input-search.d.ts +1 -1
  64. package/dist/components/bk-input-search.js +2 -1
  65. package/dist/components/bk-input-text.d.ts +11 -0
  66. package/dist/components/bk-input-text.js +17 -3
  67. package/dist/components/bk-input-time.js +2 -1
  68. package/dist/components/bk-item.js +2 -1
  69. package/dist/components/bk-lightbox.d.ts +12 -3
  70. package/dist/components/bk-lightbox.js +6 -3
  71. package/dist/components/bk-link.d.ts +9 -1
  72. package/dist/components/bk-link.js +14 -4
  73. package/dist/components/bk-menu-item.d.ts +40 -0
  74. package/dist/components/bk-menu-item.js +57 -9
  75. package/dist/components/bk-menu-label.js +2 -1
  76. package/dist/components/bk-menu-list.d.ts +1 -0
  77. package/dist/components/bk-menu-list.js +10 -0
  78. package/dist/components/bk-menu.d.ts +8 -1
  79. package/dist/components/bk-menu.js +16 -5
  80. package/dist/components/bk-message-feedback.d.ts +4 -3
  81. package/dist/components/bk-message-feedback.js +7 -5
  82. package/dist/components/bk-message-list.js +2 -1
  83. package/dist/components/bk-message-source.d.ts +1 -2
  84. package/dist/components/bk-message-source.js +3 -11
  85. package/dist/components/bk-message.js +2 -0
  86. package/dist/components/bk-nav-group.js +1 -1
  87. package/dist/components/bk-nav-item.d.ts +18 -0
  88. package/dist/components/bk-nav-item.js +18 -5
  89. package/dist/components/bk-nav.d.ts +1 -1
  90. package/dist/components/bk-page-cta.js +2 -0
  91. package/dist/components/bk-page-section.d.ts +1 -1
  92. package/dist/components/bk-page-section.js +3 -9
  93. package/dist/components/bk-pane.d.ts +1 -0
  94. package/dist/components/bk-pane.js +7 -5
  95. package/dist/components/bk-panel.d.ts +1 -1
  96. package/dist/components/bk-panel.js +6 -5
  97. package/dist/components/bk-picture.d.ts +17 -4
  98. package/dist/components/bk-picture.js +8 -1
  99. package/dist/components/bk-segmented-item.d.ts +24 -4
  100. package/dist/components/bk-segmented-item.js +37 -5
  101. package/dist/components/bk-segmented.js +2 -13
  102. package/dist/components/bk-select-cascade.d.ts +1 -1
  103. package/dist/components/bk-select-tree.d.ts +1 -1
  104. package/dist/components/bk-select.d.ts +1 -1
  105. package/dist/components/bk-shell-app.d.ts +10 -4
  106. package/dist/components/bk-shell-app.js +32 -9
  107. package/dist/components/bk-shell-sites.d.ts +2 -1
  108. package/dist/components/bk-shell-sites.js +3 -5
  109. package/dist/components/bk-sortable.js +7 -17
  110. package/dist/components/bk-split-grid.d.ts +104 -3
  111. package/dist/components/bk-split-grid.js +425 -2
  112. package/dist/components/bk-stat-group.js +2 -1
  113. package/dist/components/bk-stat.d.ts +17 -0
  114. package/dist/components/bk-stat.js +7 -3
  115. package/dist/components/bk-steps.js +2 -1
  116. package/dist/components/bk-surface.d.ts +2 -0
  117. package/dist/components/bk-surface.js +6 -3
  118. package/dist/components/bk-table.d.ts +1 -1
  119. package/dist/components/bk-table.js +9 -12
  120. package/dist/components/bk-tabs-item.d.ts +45 -7
  121. package/dist/components/bk-tabs-item.js +51 -20
  122. package/dist/components/bk-tabs-panel.d.ts +6 -3
  123. package/dist/components/bk-tabs-panel.js +6 -0
  124. package/dist/components/bk-tabs.d.ts +50 -7
  125. package/dist/components/bk-tabs.js +168 -96
  126. package/dist/components/bk-text.js +2 -1
  127. package/dist/components/bk-toast-group.d.ts +3 -1
  128. package/dist/components/bk-toast-group.js +11 -1
  129. package/dist/components/bk-tooltip.d.ts +3 -1
  130. package/dist/components/bk-tooltip.js +2 -1
  131. package/dist/components/bk-video.js +2 -2
  132. package/dist/components/bk-zoom.d.ts +3 -1
  133. package/dist/components/confirm.d.ts +15 -0
  134. package/dist/components/confirm.js +27 -4
  135. package/dist/i18n/de.js +12 -1
  136. package/dist/i18n/en.d.ts +2 -0
  137. package/dist/i18n/en.js +3 -0
  138. package/dist/i18n.d.ts +16 -2
  139. package/dist/i18n.js +28 -4
  140. package/dist/icons/brands-static.d.ts +3 -0
  141. package/dist/icons/brands-static.js +5 -0
  142. package/dist/icons/core.d.ts +1 -0
  143. package/dist/icons/core.js +2 -0
  144. package/dist/icons/load-static.d.ts +3 -0
  145. package/dist/icons/load-static.js +5 -0
  146. package/dist/icons/load.js +1 -0
  147. package/dist/icons/registry.js +1 -1
  148. package/dist/icons/set/save-as.d.ts +3 -0
  149. package/dist/icons/set/save-as.js +7 -0
  150. package/dist/index.d.ts +3 -0
  151. package/dist/index.js +3 -0
  152. package/dist/internal/announcer.d.ts +8 -1
  153. package/dist/internal/announcer.js +26 -10
  154. package/dist/internal/backdrop.d.ts +19 -0
  155. package/dist/internal/backdrop.js +29 -0
  156. package/dist/internal/busy.d.ts +3 -2
  157. package/dist/internal/busy.js +4 -5
  158. package/dist/internal/choice-field.js +1 -1
  159. package/dist/internal/choice-item.d.ts +17 -6
  160. package/dist/internal/choice-item.js +20 -9
  161. package/dist/internal/cloak.js +3 -0
  162. package/dist/internal/crop-frame.d.ts +1 -1
  163. package/dist/internal/crop-frame.js +2 -7
  164. package/dist/internal/date-field.js +2 -1
  165. package/dist/internal/drag.d.ts +11 -0
  166. package/dist/internal/drag.js +23 -0
  167. package/dist/internal/english-static.d.ts +3 -0
  168. package/dist/internal/english-static.js +5 -0
  169. package/dist/internal/english.d.ts +8 -0
  170. package/dist/internal/english.js +6 -0
  171. package/dist/internal/footnotes.d.ts +56 -0
  172. package/dist/internal/footnotes.js +143 -0
  173. package/dist/internal/handle-menu.js +2 -5
  174. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  175. package/dist/internal/late/bk-shell-app.js +7 -0
  176. package/dist/internal/late/bk-table.d.ts +4 -0
  177. package/dist/internal/late/bk-table.js +17 -0
  178. package/dist/internal/late/handle-menu.d.ts +4 -0
  179. package/dist/internal/late/handle-menu.js +9 -0
  180. package/dist/internal/late/static.d.ts +7 -0
  181. package/dist/internal/late/static.js +5 -0
  182. package/dist/internal/late.d.ts +8 -3
  183. package/dist/internal/late.js +19 -4
  184. package/dist/internal/link.d.ts +2 -0
  185. package/dist/internal/link.js +11 -1
  186. package/dist/internal/own-text.d.ts +8 -0
  187. package/dist/internal/own-text.js +7 -0
  188. package/dist/internal/scope.js +1 -1
  189. package/dist/internal/scroll-lock.d.ts +4 -1
  190. package/dist/internal/scroll-lock.js +17 -4
  191. package/dist/internal/slider.js +2 -1
  192. package/dist/internal/styles.js +3 -0
  193. package/dist/internal/submit.d.ts +23 -0
  194. package/dist/internal/submit.js +57 -0
  195. package/dist/jsx.d.ts +141 -52
  196. package/dist/reset.css +10 -0
  197. package/dist/standalone/all.js +226 -222
  198. package/dist/standalone/appearance.js +1 -1
  199. package/dist/standalone/bk-accordion-item.js +4 -4
  200. package/dist/standalone/bk-accordion.js +2 -2
  201. package/dist/standalone/bk-action-bar.js +3 -3
  202. package/dist/standalone/bk-alert-offline.js +1 -2
  203. package/dist/standalone/bk-alert.js +13 -12
  204. package/dist/standalone/bk-app-state.js +1 -1
  205. package/dist/standalone/bk-attachment.js +4 -4
  206. package/dist/standalone/bk-avatar-group.js +12 -10
  207. package/dist/standalone/bk-avatar.js +14 -4
  208. package/dist/standalone/bk-badge.js +2 -2
  209. package/dist/standalone/bk-bar.js +3 -1
  210. package/dist/standalone/bk-brand.js +3 -3
  211. package/dist/standalone/bk-breadcrumbs.js +5 -5
  212. package/dist/standalone/bk-button-copy.js +5 -5
  213. package/dist/standalone/bk-button-group.js +5 -5
  214. package/dist/standalone/bk-button-share.js +5 -5
  215. package/dist/standalone/bk-button-top.js +9 -8
  216. package/dist/standalone/bk-button.js +62 -30
  217. package/dist/standalone/bk-calendar-event.js +1 -1
  218. package/dist/standalone/bk-calendar-week.js +3 -3
  219. package/dist/standalone/bk-calendar.js +4 -4
  220. package/dist/standalone/bk-card.js +20 -7
  221. package/dist/standalone/bk-carousel-controls.js +7 -6
  222. package/dist/standalone/bk-carousel-item.js +2 -2
  223. package/dist/standalone/bk-carousel.js +1 -1
  224. package/dist/standalone/bk-chart-area.js +1 -1
  225. package/dist/standalone/bk-chart-bar-list.js +8 -8
  226. package/dist/standalone/bk-chart-bar.js +145 -117
  227. package/dist/standalone/bk-chart-bridge.js +7 -7
  228. package/dist/standalone/bk-chart-bullet.js +6 -6
  229. package/dist/standalone/bk-chart-calendar.js +7 -7
  230. package/dist/standalone/bk-chart-heatmap.js +7 -7
  231. package/dist/standalone/bk-chart-histogram.js +5 -5
  232. package/dist/standalone/bk-chart-legend.js +6 -6
  233. package/dist/standalone/bk-chart-line.js +116 -103
  234. package/dist/standalone/bk-chart-mark.js +1 -1
  235. package/dist/standalone/bk-chart-scatter.js +6 -6
  236. package/dist/standalone/bk-chart-sparkline.js +6 -6
  237. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  238. package/dist/standalone/bk-chart-tracker.js +6 -6
  239. package/dist/standalone/bk-chart-waterfall.js +6 -6
  240. package/dist/standalone/bk-checkbox-group.js +4 -4
  241. package/dist/standalone/bk-checkbox.js +4 -4
  242. package/dist/standalone/bk-chip-group.js +9 -5
  243. package/dist/standalone/bk-chip.js +56 -17
  244. package/dist/standalone/bk-cluster.js +1 -1
  245. package/dist/standalone/bk-code-diff.js +4 -4
  246. package/dist/standalone/bk-code-stack.js +4 -4
  247. package/dist/standalone/bk-code.js +10 -6
  248. package/dist/standalone/bk-color-panel.js +5 -5
  249. package/dist/standalone/bk-columns.js +13 -5
  250. package/dist/standalone/bk-combobox.js +9 -8
  251. package/dist/standalone/bk-command-menu.js +6 -6
  252. package/dist/standalone/bk-command-palette.js +6 -5
  253. package/dist/standalone/bk-composer.js +6 -6
  254. package/dist/standalone/bk-delta.js +11 -10
  255. package/dist/standalone/bk-diagram.js +1 -1
  256. package/dist/standalone/bk-dialog.js +1 -1
  257. package/dist/standalone/bk-disclosure.js +7 -5
  258. package/dist/standalone/bk-divider.js +2 -2
  259. package/dist/standalone/bk-drawer.js +3 -3
  260. package/dist/standalone/bk-drop-target.js +12 -6
  261. package/dist/standalone/bk-empty-state.js +3 -3
  262. package/dist/standalone/bk-error-summary.js +9 -6
  263. package/dist/standalone/bk-facts-item.js +2 -2
  264. package/dist/standalone/bk-facts.js +9 -8
  265. package/dist/standalone/bk-feature.js +3 -3
  266. package/dist/standalone/bk-fieldset.js +3 -3
  267. package/dist/standalone/bk-filter-bar.js +4 -4
  268. package/dist/standalone/bk-folder-browser.js +4 -4
  269. package/dist/standalone/bk-footnote.js +82 -0
  270. package/dist/standalone/bk-footnotes-item.js +122 -0
  271. package/dist/standalone/bk-footnotes.js +37 -0
  272. package/dist/standalone/bk-form-guard.js +2 -2
  273. package/dist/standalone/bk-form-steps.js +3 -3
  274. package/dist/standalone/bk-grid.js +1 -1
  275. package/dist/standalone/bk-icon-tile.js +3 -3
  276. package/dist/standalone/bk-icon.js +1 -1
  277. package/dist/standalone/bk-image-compare.js +88 -47
  278. package/dist/standalone/bk-image-crop.js +6 -6
  279. package/dist/standalone/bk-image-editor.js +1 -1
  280. package/dist/standalone/bk-image-viewer.js +180 -59
  281. package/dist/standalone/bk-input-code.js +4 -4
  282. package/dist/standalone/bk-input-color.js +4 -4
  283. package/dist/standalone/bk-input-date-range.js +2 -2
  284. package/dist/standalone/bk-input-date.js +2 -2
  285. package/dist/standalone/bk-input-file.js +5 -5
  286. package/dist/standalone/bk-input-group.js +4 -4
  287. package/dist/standalone/bk-input-inline.js +17 -10
  288. package/dist/standalone/bk-input-number.js +9 -8
  289. package/dist/standalone/bk-input-rating.js +6 -6
  290. package/dist/standalone/bk-input-rich.js +1 -1
  291. package/dist/standalone/bk-input-search.js +23 -22
  292. package/dist/standalone/bk-input-slider-range.js +5 -5
  293. package/dist/standalone/bk-input-slider.js +5 -5
  294. package/dist/standalone/bk-input-text.js +1 -1
  295. package/dist/standalone/bk-input-time-zone.js +1 -1
  296. package/dist/standalone/bk-input-time.js +29 -28
  297. package/dist/standalone/bk-item-group.js +3 -3
  298. package/dist/standalone/bk-item.js +12 -11
  299. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  300. package/dist/standalone/bk-kbd.js +68 -1
  301. package/dist/standalone/bk-lightbox.js +11 -7
  302. package/dist/standalone/bk-lines.js +1 -1
  303. package/dist/standalone/bk-link.js +33 -19
  304. package/dist/standalone/bk-listbox-columns.js +6 -6
  305. package/dist/standalone/bk-listbox-item.js +1 -1
  306. package/dist/standalone/bk-listbox-search.js +7 -7
  307. package/dist/standalone/bk-listbox-transfer.js +6 -6
  308. package/dist/standalone/bk-listbox.js +7 -7
  309. package/dist/standalone/bk-logo-wall.js +2 -2
  310. package/dist/standalone/bk-logo.js +3 -3
  311. package/dist/standalone/bk-menu-bar.js +3 -3
  312. package/dist/standalone/bk-menu-context.js +1 -1
  313. package/dist/standalone/bk-menu-divider.js +2 -2
  314. package/dist/standalone/bk-menu-item.js +73 -29
  315. package/dist/standalone/bk-menu-label.js +7 -6
  316. package/dist/standalone/bk-menu-list.js +10 -4
  317. package/dist/standalone/bk-menu.js +19 -10
  318. package/dist/standalone/bk-message-approval.js +4 -4
  319. package/dist/standalone/bk-message-branches.js +3 -3
  320. package/dist/standalone/bk-message-citation.js +10 -10
  321. package/dist/standalone/bk-message-feedback.js +10 -6
  322. package/dist/standalone/bk-message-list.js +6 -5
  323. package/dist/standalone/bk-message-reasoning.js +5 -5
  324. package/dist/standalone/bk-message-source.js +13 -21
  325. package/dist/standalone/bk-message-tool-group.js +5 -5
  326. package/dist/standalone/bk-message-tool.js +5 -5
  327. package/dist/standalone/bk-message.js +6 -4
  328. package/dist/standalone/bk-meter.js +3 -3
  329. package/dist/standalone/bk-model-viewer.js +1 -1
  330. package/dist/standalone/bk-nav-divider.js +2 -2
  331. package/dist/standalone/bk-nav-group.js +6 -6
  332. package/dist/standalone/bk-nav-item.js +31 -23
  333. package/dist/standalone/bk-nav-toc.js +3 -3
  334. package/dist/standalone/bk-nav.js +3 -3
  335. package/dist/standalone/bk-overflow.js +3 -3
  336. package/dist/standalone/bk-page-cta.js +5 -3
  337. package/dist/standalone/bk-page-footer-column.js +2 -2
  338. package/dist/standalone/bk-page-footer.js +3 -3
  339. package/dist/standalone/bk-page-header.js +3 -3
  340. package/dist/standalone/bk-page-hero.js +3 -3
  341. package/dist/standalone/bk-page-pager.js +5 -5
  342. package/dist/standalone/bk-page-section.js +6 -6
  343. package/dist/standalone/bk-pagination.js +6 -6
  344. package/dist/standalone/bk-pane.js +10 -9
  345. package/dist/standalone/bk-panel.js +9 -10
  346. package/dist/standalone/bk-period-nav.js +4 -4
  347. package/dist/standalone/bk-picture.js +24 -15
  348. package/dist/standalone/bk-popover-help.js +3 -3
  349. package/dist/standalone/bk-popover.js +2 -2
  350. package/dist/standalone/bk-presence-cursor.js +2 -2
  351. package/dist/standalone/bk-preview.js +4 -4
  352. package/dist/standalone/bk-progress.js +3 -3
  353. package/dist/standalone/bk-prose.js +3 -3
  354. package/dist/standalone/bk-qr-code.js +1 -1
  355. package/dist/standalone/bk-radio-group.js +4 -4
  356. package/dist/standalone/bk-radio.js +3 -3
  357. package/dist/standalone/bk-rating.js +5 -5
  358. package/dist/standalone/bk-scroll.js +3 -3
  359. package/dist/standalone/bk-segmented-item.js +40 -16
  360. package/dist/standalone/bk-segmented.js +15 -13
  361. package/dist/standalone/bk-select-cascade.js +3 -3
  362. package/dist/standalone/bk-select-tree.js +4 -4
  363. package/dist/standalone/bk-select.js +5 -5
  364. package/dist/standalone/bk-shell-app.js +1 -1221
  365. package/dist/standalone/bk-shell-centered.js +2 -2
  366. package/dist/standalone/bk-shell-sites.js +5 -7
  367. package/dist/standalone/bk-skeleton.js +2 -2
  368. package/dist/standalone/bk-sortable.js +55 -60
  369. package/dist/standalone/bk-spinner.js +2 -2
  370. package/dist/standalone/bk-split-grid.js +318 -41
  371. package/dist/standalone/bk-split.js +4 -4
  372. package/dist/standalone/bk-stack.js +1 -1
  373. package/dist/standalone/bk-stat-group.js +8 -7
  374. package/dist/standalone/bk-stat.js +11 -8
  375. package/dist/standalone/bk-status-dot.js +3 -3
  376. package/dist/standalone/bk-steps-item.js +5 -5
  377. package/dist/standalone/bk-steps.js +8 -7
  378. package/dist/standalone/bk-surface.js +1 -1
  379. package/dist/standalone/bk-swatch-group.js +4 -4
  380. package/dist/standalone/bk-swatch-palette.js +1 -1
  381. package/dist/standalone/bk-swatch.js +2 -2
  382. package/dist/standalone/bk-switch.js +4 -4
  383. package/dist/standalone/bk-table.js +1 -1937
  384. package/dist/standalone/bk-tabs-item.js +58 -35
  385. package/dist/standalone/bk-tabs-panel.js +7 -3
  386. package/dist/standalone/bk-tabs.js +160 -98
  387. package/dist/standalone/bk-tasks-item.js +4 -4
  388. package/dist/standalone/bk-tasks.js +2 -2
  389. package/dist/standalone/bk-testimonial.js +3 -3
  390. package/dist/standalone/bk-text.js +19 -18
  391. package/dist/standalone/bk-time-countdown.js +4 -4
  392. package/dist/standalone/bk-time-relative.js +3 -3
  393. package/dist/standalone/bk-timeline-item.js +4 -4
  394. package/dist/standalone/bk-timeline.js +2 -2
  395. package/dist/standalone/bk-toast-group.js +1 -1
  396. package/dist/standalone/bk-toast.js +4 -4
  397. package/dist/standalone/bk-toolbar.js +2 -2
  398. package/dist/standalone/bk-tooltip.js +8 -7
  399. package/dist/standalone/bk-tree-item.js +6 -6
  400. package/dist/standalone/bk-tree.js +3 -3
  401. package/dist/standalone/bk-video.js +6 -6
  402. package/dist/standalone/bk-visually-hidden.js +2 -2
  403. package/dist/standalone/bk-zoom.js +5 -5
  404. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  405. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  406. package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  407. package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-Biz7t8sL.js} +4 -4
  408. package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-D_fQf6SF.js} +5 -5
  409. package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DwZyUUHh.js} +59 -25
  410. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  411. package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-BADsoLRL.js} +5 -5
  412. package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  413. package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-CFhW6vRa.js} +6 -6
  414. package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-DviyLBqj.js} +63 -54
  415. package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-w_Ah4Tvs.js} +4 -4
  416. package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CYMovNVl.js} +3 -3
  417. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  418. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  419. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  420. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  421. package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-CoL6W7uk.js} +27 -24
  422. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  423. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  424. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  425. package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-poOTerh1.js} +6 -6
  426. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  427. package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
  428. package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
  429. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  430. package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-B-fCXa2D.js} +48 -47
  431. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  432. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  433. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  434. package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-CHpfKAKa.js} +2 -2
  435. package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
  436. package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BgYUbGO2.js} +26 -19
  437. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  438. package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
  439. package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
  440. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  441. package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
  442. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  443. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  444. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  445. package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
  446. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  447. package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
  448. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  449. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  450. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  451. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  452. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  453. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  454. package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
  455. package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CqhJSAwZ.js} +4 -4
  456. package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-lvZbQtGW.js} +2 -2
  457. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  458. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  459. package/dist/standalone/confirm.js +27 -14
  460. package/dist/standalone/i18n-de.js +13 -2
  461. package/dist/standalone/icons.js +100 -98
  462. package/dist/standalone/links.js +1 -1
  463. package/dist/standalone/reset.css +10 -0
  464. package/dist/standalone/toast.js +1 -1
  465. package/dist/standalone/tokens.css +6 -5
  466. package/dist/tokens.css +6 -5
  467. package/dist/tokens.js +4 -3
  468. package/package.json +25 -2
  469. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  470. package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
  471. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -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.
@@ -66,6 +73,9 @@ export declare class BkStat extends LitElement {
66
73
  static properties: {
67
74
  label: {};
68
75
  value: {};
76
+ valueText: {
77
+ attribute: string;
78
+ };
69
79
  unit: {};
70
80
  valueFormat: {
71
81
  attribute: string;
@@ -86,6 +96,9 @@ export declare class BkStat extends LitElement {
86
96
  attribute: string;
87
97
  type: ObjectConstructor;
88
98
  };
99
+ deltaText: {
100
+ attribute: string;
101
+ };
89
102
  deltaLabel: {
90
103
  attribute: string;
91
104
  };
@@ -110,6 +123,8 @@ export declare class BkStat extends LitElement {
110
123
  label: string;
111
124
  /** The value: a number (formatted in full in the locale) or ready text. */
112
125
  value: number | string | undefined;
126
+ /** 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. */
127
+ valueText: string | undefined;
113
128
  /** Unit after the value ("ms", "GB"); for currencies and percent use `value-format`. */
114
129
  unit: string | undefined;
115
130
  /** Intl.NumberFormat options for the value (`{"minimumFractionDigits":2}` shows 13.10). */
@@ -122,6 +137,8 @@ export declare class BkStat extends LitElement {
122
137
  delta: number | undefined;
123
138
  /** Intl.NumberFormat options for the delta (`{"style":"percent"}` reads 0.084 as +8.4 %). */
124
139
  deltaFormat: Intl.NumberFormatOptions | undefined;
140
+ /** 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. */
141
+ deltaText: string | undefined;
125
142
  /** The comparison period ("vs last month"). */
126
143
  deltaLabel: string | undefined;
127
144
  /** 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: {},
@@ -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;
@@ -2,6 +2,7 @@ import { LitElement, css, html } from "lit";
2
2
  import { define } from "../internal/define.js";
3
3
  import { base } from "../internal/styles.js";
4
4
  import { space } from "../internal/space.js";
5
+ import { setHostVars } from "../internal/host-vars.js";
5
6
  class BkSurface extends LitElement {
6
7
  static properties = {
7
8
  layer: { reflect: true, useDefault: true },
@@ -12,6 +13,8 @@ class BkSurface extends LitElement {
12
13
  layered: { type: Boolean, reflect: true },
13
14
  selected: { type: Boolean, reflect: true }
14
15
  };
16
+ /** The state `bk-scope` of a layered surface. */
17
+ internals = this.attachInternals();
15
18
  constructor() {
16
19
  super();
17
20
  this.layer = "raised";
@@ -69,9 +72,9 @@ class BkSurface extends LitElement {
69
72
  `];
70
73
  willUpdate(changed) {
71
74
  if (changed.has("padding"))
72
- this.style?.setProperty("--_bk-surface-pad", space(this.padding, "var(--bk-space-4)"));
73
- if (changed.has("layered") && (this.layered || changed.get("layered")))
74
- this.toggleAttribute("data-bk-scope", this.layered);
75
+ setHostVars(this, { "--_bk-surface-pad": space(this.padding, "var(--bk-space-4)") });
76
+ if (changed.has("layered"))
77
+ this.layered ? this.internals.states.add("bk-scope") : this.internals.states.delete("bk-scope");
75
78
  }
76
79
  render() {
77
80
  return html`<slot></slot>`;
@@ -567,8 +567,8 @@ export declare class BkTable extends LitElement {
567
567
  private i18n;
568
568
  /** Custom states (cards). */
569
569
  private internals;
570
- private slots;
571
570
  private busyState;
571
+ private slots;
572
572
  private keys;
573
573
  private anchor;
574
574
  private shift;
@@ -15,19 +15,16 @@ import { copyText } from "../internal/clipboard.js";
15
15
  import { LocalizeController } from "../i18n.js";
16
16
  import { base, gripRules, srOnlyRules } from "../internal/styles.js";
17
17
  import { LateLoad, lateLoads } from "../internal/late.js";
18
+ import { lateParts as late } from "#bk/internal/late/bk-table.js";
18
19
  import "./bk-button.js";
19
20
  import "./bk-icon.js";
20
21
  import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
21
- const selectParts = new LateLoad(() => import("./bk-checkbox.js"));
22
- const filterParts = new LateLoad(() => Promise.all([import("./bk-filter-bar.js"), import("./bk-popover.js")]));
23
- const menuParts = new LateLoad(() => Promise.all([
24
- import("./bk-menu-context.js"),
25
- import("./bk-menu-item.js"),
26
- import("./bk-menu-divider.js"),
27
- import("./bk-menu-label.js")
28
- ]));
29
- const editParts = new LateLoad(() => Promise.all([import("./bk-input-number.js"), import("./bk-input-text.js")]));
30
- const skeletonParts = new LateLoad(() => import("./bk-skeleton.js"));
22
+ const selectParts = new LateLoad(late, "bk-checkbox");
23
+ const filterParts = new LateLoad(late, "bk-filter-bar", "bk-popover");
24
+ const menuParts = new LateLoad(late, "bk-menu-context", "bk-menu-item", "bk-menu-divider", "bk-menu-label");
25
+ const editParts = new LateLoad(late, "bk-input-number", "bk-input-text");
26
+ const skeletonParts = new LateLoad(late, "bk-skeleton");
27
+ const cardSortParts = new LateLoad(late, "bk-select");
31
28
  import "../icons/set/add.js";
32
29
  import "../icons/set/arrow-back.js";
33
30
  import "../icons/set/arrow-down.js";
@@ -448,8 +445,8 @@ class BkTable extends LitElement {
448
445
  i18n = new LocalizeController(this);
449
446
  /** Custom states (cards). */
450
447
  internals = this.attachInternals();
448
+ busyState = new BusyController(this, this.i18n, this.internals);
451
449
  slots = new SlotController(this);
452
- busyState = new BusyController(this, this.i18n);
453
450
  keys = /* @__PURE__ */ new Set();
454
451
  anchor;
455
452
  shift = false;
@@ -2662,7 +2659,7 @@ class BkTable extends LitElement {
2662
2659
  this.syncAll();
2663
2660
  this.requestUpdate();
2664
2661
  if (cards && this.sortable)
2665
- void import("./bk-select.js");
2662
+ void cardSortParts.start();
2666
2663
  }
2667
2664
  const head = this.headRow;
2668
2665
  if (head && head.querySelector("[data-pin]"))
@@ -7,9 +7,24 @@ export interface TabRemoveDetail {
7
7
  /** The `value` of the tab that asks to be removed. */
8
8
  value: string;
9
9
  }
10
+ /** The state of a tab in its list. `<bk-tabs>` gives it to each tab with `setTabState()`. */
11
+ export interface TabState {
12
+ /** The tab is an ARIA tab (false for link tabs). */
13
+ tab: boolean;
14
+ /** The tab is the selected one. */
15
+ selected: boolean;
16
+ /** The tab is the Tab stop of the list (roving tabindex). */
17
+ tabStop: boolean;
18
+ /** The panel that the tab controls. */
19
+ controls: Element | null;
20
+ /** The tab does not fit the row and is in the "More" menu. */
21
+ overflow: boolean;
22
+ }
10
23
  /**
11
- * One tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The tabs element sets its
12
- * role, `aria-selected`, `aria-controls`, roving `tabindex` and `selected` state.
24
+ * One tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The tabs element gives the tab its
25
+ * state (`setTabState()`). The tab renders the role `tab`, `aria-selected`, `aria-controls` and the roving
26
+ * `tabindex` on its inner box, so the tabs write no attributes on the element of the app (server HTML stays as it is).
27
+ * The custom states `:state(selected)` and `:state(overflow)` (the tab is in the "More" menu) are for the CSS of an app.
13
28
  *
14
29
  * With `href` the tab renders a real link (router-driven tabs): no tab panel is needed, the
15
30
  * selected link has `aria-current="page"`.
@@ -51,6 +66,7 @@ export interface TabRemoveDetail {
51
66
  * @tag bk-tabs-item
52
67
  */
53
68
  export declare class BkTabsItem extends ChoiceItem {
69
+ static shadowRootOptions: ShadowRootInit;
54
70
  static properties: {
55
71
  value: {
56
72
  reflect: boolean;
@@ -63,13 +79,23 @@ export declare class BkTabsItem extends ChoiceItem {
63
79
  reflect: boolean;
64
80
  };
65
81
  target: {};
82
+ rel: {};
83
+ download: {};
66
84
  disabled: {
67
85
  type: BooleanConstructor;
68
86
  reflect: boolean;
69
87
  };
70
88
  selected: {
71
89
  type: BooleanConstructor;
72
- reflect: boolean;
90
+ };
91
+ tabRole: {
92
+ state: boolean;
93
+ };
94
+ tabStop: {
95
+ state: boolean;
96
+ };
97
+ controls: {
98
+ state: boolean;
73
99
  };
74
100
  removable: {
75
101
  type: BooleanConstructor;
@@ -96,17 +122,29 @@ export declare class BkTabsItem extends ChoiceItem {
96
122
  dot: boolean;
97
123
  /** What a screen reader announces for the dot (default: i18n `tabDot`). */
98
124
  dotLabel: string | undefined;
125
+ /** The tab is an ARIA tab (false while its list contains links). */
126
+ private tabRole;
127
+ /** The tab is the Tab stop of its list. */
128
+ private tabStop;
129
+ /** The panel of the tab. */
130
+ private controls;
99
131
  private i18n;
100
- /** The tab set the Delete hint on its host (and removes only its own). */
101
- private hinted;
132
+ private readonly internals;
102
133
  constructor();
134
+ /** `<bk-tabs>` calls it on each update: the state of the tab in its list. An app does not call it. */
135
+ setTabState(state: TabState): void;
136
+ /** True while the tab does not fit the row and is in the "More" menu. */
137
+ get overflowed(): boolean;
138
+ protected get labelOnHost(): boolean;
139
+ protected willUpdate(changed: PropertyValues): void;
140
+ /** The inner box is the tab: it has the role, the ARIA state, the name and the roving tabindex. */
141
+ protected renderBox(cls: string, inner: unknown): unknown;
103
142
  protected renderMark(): typeof nothing | import("lit-html").TemplateResult<1>;
104
143
  /** The text of the tab: its `label` or its content. */
105
144
  get text(): string;
106
145
  /** Asks to remove the tab: fires `remove`. Returns false when a listener cancelled it. */
107
146
  requestRemove(): boolean;
108
- protected updated(changed: PropertyValues): void;
109
- render(): import("lit-html").TemplateResult<1>;
147
+ render(): unknown;
110
148
  protected get current(): boolean;
111
149
  static styles: import("lit").CSSResult[];
112
150
  }
@@ -1,4 +1,5 @@
1
- import { css, html, nothing } from "lit";
1
+ import { LitElement, css, html, nothing } from "lit";
2
+ import { ifDefined } from "lit/directives/if-defined.js";
2
3
  import { define } from "../internal/define.js";
3
4
  import { emitDetail } from "../internal/events.js";
4
5
  import { LocalizeController } from "../i18n.js";
@@ -8,22 +9,59 @@ import "./bk-icon.js";
8
9
  import { lightDom } from "../internal/server.js";
9
10
  import "../icons/set/close.js";
10
11
  class BkTabsItem extends ChoiceItem {
12
+ static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
11
13
  static properties = {
12
14
  ...ChoiceItem.properties,
13
- selected: { type: Boolean, reflect: true },
15
+ selected: { type: Boolean },
16
+ tabRole: { state: true },
17
+ tabStop: { state: true },
18
+ controls: { state: true },
14
19
  removable: { type: Boolean, reflect: true },
15
20
  closeLabel: { attribute: "close-label" },
16
21
  dot: { type: Boolean, reflect: true },
17
22
  dotLabel: { attribute: "dot-label" }
18
23
  };
19
24
  i18n = new LocalizeController(this);
20
- /** The tab set the Delete hint on its host (and removes only its own). */
21
- hinted = false;
25
+ internals = this.attachInternals();
22
26
  constructor() {
23
27
  super();
24
28
  this.selected = false;
25
29
  this.removable = false;
26
30
  this.dot = false;
31
+ this.tabRole = true;
32
+ this.tabStop = false;
33
+ this.controls = null;
34
+ }
35
+ /** `<bk-tabs>` calls it on each update: the state of the tab in its list. An app does not call it. */
36
+ setTabState(state) {
37
+ this.selected = state.selected;
38
+ this.tabRole = state.tab;
39
+ this.tabStop = state.tabStop;
40
+ this.controls = state.controls;
41
+ this.internals.states[state.overflow ? "add" : "delete"]("overflow");
42
+ }
43
+ /** True while the tab does not fit the row and is in the "More" menu. */
44
+ get overflowed() {
45
+ return this.internals.states.has("overflow");
46
+ }
47
+ get labelOnHost() {
48
+ return false;
49
+ }
50
+ willUpdate(changed) {
51
+ super.willUpdate(changed);
52
+ if (changed.has("selected"))
53
+ this.internals.states[this.selected ? "add" : "delete"]("selected");
54
+ }
55
+ /** The inner box is the tab: it has the role, the ARIA state, the name and the roving tabindex. */
56
+ renderBox(cls, inner) {
57
+ if (!this.tabRole)
58
+ return super.renderBox(cls, inner);
59
+ const hint = this.removable && !this.disabled;
60
+ return html`<span class=${cls} part="base" title=${ifDefined(this.tip)} role="tab" tabindex=${this.tabStop && !this.disabled ? "0" : "-1"}
61
+ aria-selected=${this.selected ? "true" : "false"} aria-disabled=${ifDefined(this.disabled ? "true" : void 0)}
62
+ aria-label=${ifDefined(this.label || void 0)} aria-keyshortcuts=${ifDefined(hint ? "Delete" : void 0)}
63
+ aria-description=${ifDefined(hint ? this.i18n.t("tabCloseHint") : void 0)}
64
+ .ariaControlsElements=${this.controls ? [this.controls] : null}>${inner}</span>`;
27
65
  }
28
66
  renderMark() {
29
67
  return this.dot ? html`<span class="dot" part="dot"></span><span class="sr-only">${this.dotLabel || this.i18n.t("tabDot")}</span>` : nothing;
@@ -38,20 +76,6 @@ class BkTabsItem extends ChoiceItem {
38
76
  return false;
39
77
  return emitDetail(this, "remove", { value: this.value }, true);
40
78
  }
41
- updated(changed) {
42
- super.updated(changed);
43
- const hint = this.removable && !this.href && !this.disabled;
44
- if (hint) {
45
- this.setAttribute("aria-keyshortcuts", "Delete");
46
- const text = this.i18n.t("tabCloseHint");
47
- if (this.getAttribute("aria-description") !== text)
48
- this.setAttribute("aria-description", text);
49
- } else if (this.hinted) {
50
- this.removeAttribute("aria-keyshortcuts");
51
- this.removeAttribute("aria-description");
52
- }
53
- this.hinted = hint;
54
- }
55
79
  render() {
56
80
  if (!this.removable || this.href)
57
81
  return super.render();
@@ -67,6 +91,12 @@ class BkTabsItem extends ChoiceItem {
67
91
  }
68
92
  // Size- and variant-dependent values come as private --_bk-tab-* variables from <bk-tabs>.
69
93
  static styles = [...choiceItemStyles, srOnly, css`
94
+ /* A tab in the "More" menu keeps its box for the measurement but takes no space. The rule is in the item:
95
+ Chromium crashes with :state() inside ::slotted() of the tabs. */
96
+ :host(:state(overflow)) {
97
+ position: absolute !important; inset-block-start: 0 !important; inset-inline-start: 0 !important;
98
+ visibility: hidden !important; pointer-events: none !important;
99
+ }
70
100
  :host {
71
101
  flex: none;
72
102
  --_bk-ci-height: var(--_bk-tab-h, var(--bk-control-md));
@@ -132,10 +162,11 @@ class BkTabsItem extends ChoiceItem {
132
162
  display: var(--_bk-tab-indicator-display, block); opacity: 0; scale: var(--_bk-tab-indicator-scale, 0.5 1);
133
163
  transition: opacity var(--bk-duration) var(--bk-ease), scale var(--bk-duration) var(--bk-ease);
134
164
  }
135
- :host([selected]) .item::after { opacity: 1; scale: 1; }
165
+ .item.current::after { opacity: 1; scale: 1; }
136
166
  @media (forced-colors: active) {
137
167
  .item::after { background: Highlight; }
138
- :host([selected]) .item { outline: var(--bk-border-width) solid Highlight; }
168
+ .item.current { outline: var(--bk-border-width) solid Highlight; }
169
+ span.item:focus-visible { outline: var(--bk-focus-ring); }
139
170
  }
140
171
  `];
141
172
  }
@@ -1,8 +1,8 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * The content for one tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The tabs element
4
- * sets its role, `id`, `aria-labelledby` and `tabindex`, and hides it while its tab is not
5
- * selected.
3
+ * The content for one tab of a `<bk-tabs>`. Use it only as a direct child of `<bk-tabs>`. The panel has the role
4
+ * `tabpanel`. The tabs element gives it its tab (`setTab()`, the name of the panel), sets `tabindex="0"` when the
5
+ * panel has no `tabindex`, and hides the panel while its tab is not selected.
6
6
  *
7
7
  * A closed panel has `hidden="until-found"`: Ctrl+F and `#fragment` links find text in it, and the tabs select its tab.
8
8
  *
@@ -20,7 +20,10 @@ export declare class BkTabsPanel extends LitElement {
20
20
  };
21
21
  /** Value of the `<bk-tabs-item>` that shows this panel. */
22
22
  value: string;
23
+ private readonly internals;
23
24
  constructor();
25
+ /** `<bk-tabs>` calls it on each update: the tab that names the panel (`null`: none). An app does not call it. */
26
+ setTab(tab: Element | null): void;
24
27
  static styles: import("lit").CSSResult[];
25
28
  render(): import("lit-html").TemplateResult<1>;
26
29
  }
@@ -5,9 +5,15 @@ class BkTabsPanel extends LitElement {
5
5
  static properties = {
6
6
  value: { reflect: true, useDefault: true }
7
7
  };
8
+ internals = this.attachInternals();
8
9
  constructor() {
9
10
  super();
10
11
  this.value = "";
12
+ this.internals.role = "tabpanel";
13
+ }
14
+ /** `<bk-tabs>` calls it on each update: the tab that names the panel (`null`: none). An app does not call it. */
15
+ setTab(tab) {
16
+ this.internals.ariaLabelledByElements = tab ? [tab] : null;
11
17
  }
12
18
  static styles = [base, css`
13
19
  :host {
@@ -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;