@bk2k/ui 0.6.8 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (503) hide show
  1. package/BUILDING.md +56 -2
  2. package/CHANGELOG.md +199 -0
  3. package/USAGE.md +102 -28
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/chart-tokens.js +1 -1
  6. package/dist/charts/fields.d.ts +20 -0
  7. package/dist/charts/fields.js +27 -0
  8. package/dist/charts/frame.d.ts +2 -0
  9. package/dist/charts/frame.js +2 -1
  10. package/dist/clipboard.js +1 -0
  11. package/dist/components/bk-alert.js +3 -2
  12. package/dist/components/bk-avatar-group.js +4 -6
  13. package/dist/components/bk-avatar.d.ts +10 -0
  14. package/dist/components/bk-avatar.js +17 -0
  15. package/dist/components/bk-bar.js +2 -0
  16. package/dist/components/bk-button-group.js +1 -1
  17. package/dist/components/bk-button-top.js +2 -1
  18. package/dist/components/bk-button.d.ts +42 -14
  19. package/dist/components/bk-button.js +67 -20
  20. package/dist/components/bk-card.d.ts +7 -0
  21. package/dist/components/bk-card.js +21 -2
  22. package/dist/components/bk-carousel-controls.d.ts +2 -0
  23. package/dist/components/bk-carousel-controls.js +4 -2
  24. package/dist/components/bk-chart-area.d.ts +10 -0
  25. package/dist/components/bk-chart-bar.d.ts +17 -0
  26. package/dist/components/bk-chart-bar.js +25 -4
  27. package/dist/components/bk-chart-line.d.ts +28 -0
  28. package/dist/components/bk-chart-line.js +27 -7
  29. package/dist/components/bk-chip-group.d.ts +2 -2
  30. package/dist/components/bk-chip-group.js +4 -0
  31. package/dist/components/bk-chip.d.ts +55 -8
  32. package/dist/components/bk-chip.js +46 -8
  33. package/dist/components/bk-code.js +6 -2
  34. package/dist/components/bk-columns.d.ts +11 -0
  35. package/dist/components/bk-columns.js +8 -1
  36. package/dist/components/bk-combobox.d.ts +3 -3
  37. package/dist/components/bk-combobox.js +9 -21
  38. package/dist/components/bk-delta.d.ts +10 -0
  39. package/dist/components/bk-delta.js +8 -6
  40. package/dist/components/bk-dialog.d.ts +12 -5
  41. package/dist/components/bk-dialog.js +14 -6
  42. package/dist/components/bk-disclosure.js +4 -2
  43. package/dist/components/bk-drop-target.d.ts +7 -1
  44. package/dist/components/bk-drop-target.js +20 -4
  45. package/dist/components/bk-error-summary.d.ts +5 -0
  46. package/dist/components/bk-error-summary.js +13 -4
  47. package/dist/components/bk-facts.js +3 -2
  48. package/dist/components/bk-footnote.d.ts +73 -0
  49. package/dist/components/bk-footnote.js +97 -0
  50. package/dist/components/bk-footnotes-item.d.ts +92 -0
  51. package/dist/components/bk-footnotes-item.js +139 -0
  52. package/dist/components/bk-footnotes.d.ts +51 -0
  53. package/dist/components/bk-footnotes.js +43 -0
  54. package/dist/components/bk-icon.js +2 -2
  55. package/dist/components/bk-image-compare.d.ts +69 -6
  56. package/dist/components/bk-image-compare.js +116 -32
  57. package/dist/components/bk-image-crop.d.ts +3 -3
  58. package/dist/components/bk-image-editor.d.ts +1 -1
  59. package/dist/components/bk-image-viewer.d.ts +178 -11
  60. package/dist/components/bk-image-viewer.js +310 -52
  61. package/dist/components/bk-input-color.d.ts +2 -5
  62. package/dist/components/bk-input-color.js +0 -14
  63. package/dist/components/bk-input-file.d.ts +17 -0
  64. package/dist/components/bk-input-file.js +18 -8
  65. package/dist/components/bk-input-inline.d.ts +15 -6
  66. package/dist/components/bk-input-inline.js +22 -6
  67. package/dist/components/bk-input-number.js +2 -1
  68. package/dist/components/bk-input-search.d.ts +1 -1
  69. package/dist/components/bk-input-search.js +2 -1
  70. package/dist/components/bk-input-tags.d.ts +219 -0
  71. package/dist/components/bk-input-tags.js +293 -0
  72. package/dist/components/bk-input-text.d.ts +20 -0
  73. package/dist/components/bk-input-text.js +34 -4
  74. package/dist/components/bk-input-time.js +2 -1
  75. package/dist/components/bk-item.js +2 -1
  76. package/dist/components/bk-lightbox.d.ts +37 -4
  77. package/dist/components/bk-lightbox.js +13 -3
  78. package/dist/components/bk-link.d.ts +9 -1
  79. package/dist/components/bk-link.js +14 -4
  80. package/dist/components/bk-menu-item.d.ts +40 -0
  81. package/dist/components/bk-menu-item.js +57 -9
  82. package/dist/components/bk-menu-label.js +2 -1
  83. package/dist/components/bk-menu-list.d.ts +1 -0
  84. package/dist/components/bk-menu-list.js +10 -0
  85. package/dist/components/bk-menu.d.ts +8 -1
  86. package/dist/components/bk-menu.js +16 -5
  87. package/dist/components/bk-message-feedback.d.ts +4 -3
  88. package/dist/components/bk-message-feedback.js +7 -5
  89. package/dist/components/bk-message-list.js +2 -1
  90. package/dist/components/bk-message-source.d.ts +1 -2
  91. package/dist/components/bk-message-source.js +3 -11
  92. package/dist/components/bk-message.js +2 -0
  93. package/dist/components/bk-nav-group.js +1 -1
  94. package/dist/components/bk-nav-item.d.ts +18 -0
  95. package/dist/components/bk-nav-item.js +18 -5
  96. package/dist/components/bk-nav.d.ts +1 -1
  97. package/dist/components/bk-page-cta.d.ts +2 -0
  98. package/dist/components/bk-page-cta.js +10 -1
  99. package/dist/components/bk-page-section.d.ts +1 -1
  100. package/dist/components/bk-page-section.js +3 -9
  101. package/dist/components/bk-pane.d.ts +1 -0
  102. package/dist/components/bk-pane.js +7 -5
  103. package/dist/components/bk-panel.d.ts +1 -1
  104. package/dist/components/bk-panel.js +6 -5
  105. package/dist/components/bk-picture.d.ts +17 -4
  106. package/dist/components/bk-picture.js +8 -1
  107. package/dist/components/bk-segmented-item.d.ts +24 -4
  108. package/dist/components/bk-segmented-item.js +37 -5
  109. package/dist/components/bk-segmented.js +2 -13
  110. package/dist/components/bk-select-cascade.d.ts +1 -1
  111. package/dist/components/bk-select-tree.d.ts +1 -1
  112. package/dist/components/bk-select.d.ts +1 -1
  113. package/dist/components/bk-shell-app.d.ts +10 -4
  114. package/dist/components/bk-shell-app.js +32 -9
  115. package/dist/components/bk-shell-sites.d.ts +2 -1
  116. package/dist/components/bk-shell-sites.js +3 -5
  117. package/dist/components/bk-sortable.js +7 -17
  118. package/dist/components/bk-split-grid.d.ts +104 -3
  119. package/dist/components/bk-split-grid.js +430 -2
  120. package/dist/components/bk-stat-group.js +2 -1
  121. package/dist/components/bk-stat.d.ts +19 -0
  122. package/dist/components/bk-stat.js +8 -4
  123. package/dist/components/bk-steps.js +2 -1
  124. package/dist/components/bk-surface.d.ts +2 -0
  125. package/dist/components/bk-surface.js +6 -3
  126. package/dist/components/bk-table.d.ts +3 -1
  127. package/dist/components/bk-table.js +10 -13
  128. package/dist/components/bk-tabs-item.d.ts +45 -7
  129. package/dist/components/bk-tabs-item.js +51 -20
  130. package/dist/components/bk-tabs-panel.d.ts +6 -3
  131. package/dist/components/bk-tabs-panel.js +6 -0
  132. package/dist/components/bk-tabs.d.ts +52 -8
  133. package/dist/components/bk-tabs.js +181 -97
  134. package/dist/components/bk-text.js +2 -1
  135. package/dist/components/bk-toast-group.d.ts +3 -1
  136. package/dist/components/bk-toast-group.js +11 -1
  137. package/dist/components/bk-tooltip.d.ts +3 -1
  138. package/dist/components/bk-tooltip.js +2 -1
  139. package/dist/components/bk-video.js +2 -2
  140. package/dist/components/bk-zoom.d.ts +3 -1
  141. package/dist/components/confirm.d.ts +15 -0
  142. package/dist/components/confirm.js +27 -4
  143. package/dist/i18n/de.js +12 -1
  144. package/dist/i18n/en.d.ts +2 -0
  145. package/dist/i18n/en.js +3 -0
  146. package/dist/i18n.d.ts +16 -2
  147. package/dist/i18n.js +28 -4
  148. package/dist/icons/brands-static.d.ts +3 -0
  149. package/dist/icons/brands-static.js +5 -0
  150. package/dist/icons/core.d.ts +1 -0
  151. package/dist/icons/core.js +2 -0
  152. package/dist/icons/load-static.d.ts +3 -0
  153. package/dist/icons/load-static.js +5 -0
  154. package/dist/icons/load.js +1 -0
  155. package/dist/icons/registry.js +1 -1
  156. package/dist/icons/set/save-as.d.ts +3 -0
  157. package/dist/icons/set/save-as.js +7 -0
  158. package/dist/index.d.ts +4 -0
  159. package/dist/index.js +4 -0
  160. package/dist/internal/announcer.d.ts +14 -1
  161. package/dist/internal/announcer.js +33 -12
  162. package/dist/internal/backdrop.d.ts +19 -0
  163. package/dist/internal/backdrop.js +29 -0
  164. package/dist/internal/busy.d.ts +3 -2
  165. package/dist/internal/busy.js +4 -5
  166. package/dist/internal/choice-field.js +1 -1
  167. package/dist/internal/choice-item.d.ts +17 -6
  168. package/dist/internal/choice-item.js +20 -9
  169. package/dist/internal/cloak.js +4 -0
  170. package/dist/internal/crop-frame.d.ts +1 -1
  171. package/dist/internal/crop-frame.js +2 -7
  172. package/dist/internal/date-field.js +2 -1
  173. package/dist/internal/define.d.ts +9 -0
  174. package/dist/internal/define.js +47 -1
  175. package/dist/internal/drag.d.ts +11 -0
  176. package/dist/internal/drag.js +23 -0
  177. package/dist/internal/elements.d.ts +6 -0
  178. package/dist/internal/elements.js +5 -0
  179. package/dist/internal/english-static.d.ts +3 -0
  180. package/dist/internal/english-static.js +5 -0
  181. package/dist/internal/english.d.ts +8 -0
  182. package/dist/internal/english.js +6 -0
  183. package/dist/internal/footnotes.d.ts +56 -0
  184. package/dist/internal/footnotes.js +143 -0
  185. package/dist/internal/handle-menu.js +2 -5
  186. package/dist/internal/hue.d.ts +8 -0
  187. package/dist/internal/hue.js +15 -4
  188. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  189. package/dist/internal/late/bk-shell-app.js +7 -0
  190. package/dist/internal/late/bk-table.d.ts +4 -0
  191. package/dist/internal/late/bk-table.js +17 -0
  192. package/dist/internal/late/bk-tabs.d.ts +4 -0
  193. package/dist/internal/late/bk-tabs.js +8 -0
  194. package/dist/internal/late/handle-menu.d.ts +4 -0
  195. package/dist/internal/late/handle-menu.js +9 -0
  196. package/dist/internal/late/static.d.ts +7 -0
  197. package/dist/internal/late/static.js +5 -0
  198. package/dist/internal/late.d.ts +8 -3
  199. package/dist/internal/late.js +19 -4
  200. package/dist/internal/link.d.ts +2 -0
  201. package/dist/internal/link.js +11 -1
  202. package/dist/internal/own-text.d.ts +8 -0
  203. package/dist/internal/own-text.js +7 -0
  204. package/dist/internal/scope.js +1 -1
  205. package/dist/internal/scroll-lock.d.ts +4 -1
  206. package/dist/internal/scroll-lock.js +17 -4
  207. package/dist/internal/slider.js +2 -1
  208. package/dist/internal/styles.js +3 -0
  209. package/dist/internal/submit.d.ts +23 -0
  210. package/dist/internal/submit.js +57 -0
  211. package/dist/internal/tags.d.ts +15 -0
  212. package/dist/internal/tags.js +44 -0
  213. package/dist/internal/text-field.d.ts +2 -0
  214. package/dist/internal/text-field.js +8 -0
  215. package/dist/internal/toggle-control.js +3 -1
  216. package/dist/jsx.d.ts +222 -54
  217. package/dist/kit.d.ts +1 -0
  218. package/dist/kit.js +3 -0
  219. package/dist/reset.css +10 -0
  220. package/dist/standalone/all.js +226 -221
  221. package/dist/standalone/appearance.js +1 -1
  222. package/dist/standalone/bk-accordion-item.js +4 -4
  223. package/dist/standalone/bk-accordion.js +2 -2
  224. package/dist/standalone/bk-action-bar.js +3 -3
  225. package/dist/standalone/bk-alert-offline.js +1 -2
  226. package/dist/standalone/bk-alert.js +17 -13
  227. package/dist/standalone/bk-app-state.js +1 -1
  228. package/dist/standalone/bk-attachment.js +4 -4
  229. package/dist/standalone/bk-avatar-group.js +12 -10
  230. package/dist/standalone/bk-avatar.js +15 -5
  231. package/dist/standalone/bk-badge.js +2 -2
  232. package/dist/standalone/bk-bar.js +3 -1
  233. package/dist/standalone/bk-brand.js +3 -3
  234. package/dist/standalone/bk-breadcrumbs.js +5 -5
  235. package/dist/standalone/bk-button-copy.js +7 -7
  236. package/dist/standalone/bk-button-group.js +5 -5
  237. package/dist/standalone/bk-button-share.js +7 -7
  238. package/dist/standalone/bk-button-top.js +9 -8
  239. package/dist/standalone/bk-button.js +74 -34
  240. package/dist/standalone/bk-calendar-event.js +1 -1
  241. package/dist/standalone/bk-calendar-week.js +3 -3
  242. package/dist/standalone/bk-calendar.js +4 -4
  243. package/dist/standalone/bk-card.js +26 -7
  244. package/dist/standalone/bk-carousel-controls.js +7 -6
  245. package/dist/standalone/bk-carousel-item.js +2 -2
  246. package/dist/standalone/bk-carousel.js +1 -1
  247. package/dist/standalone/bk-chart-area.js +1 -1
  248. package/dist/standalone/bk-chart-bar-list.js +8 -8
  249. package/dist/standalone/bk-chart-bar.js +145 -117
  250. package/dist/standalone/bk-chart-bridge.js +7 -7
  251. package/dist/standalone/bk-chart-bullet.js +6 -6
  252. package/dist/standalone/bk-chart-calendar.js +7 -7
  253. package/dist/standalone/bk-chart-heatmap.js +7 -7
  254. package/dist/standalone/bk-chart-histogram.js +5 -5
  255. package/dist/standalone/bk-chart-legend.js +6 -6
  256. package/dist/standalone/bk-chart-line.js +128 -107
  257. package/dist/standalone/bk-chart-mark.js +1 -1
  258. package/dist/standalone/bk-chart-scatter.js +6 -6
  259. package/dist/standalone/bk-chart-sparkline.js +6 -6
  260. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  261. package/dist/standalone/bk-chart-tracker.js +6 -6
  262. package/dist/standalone/bk-chart-waterfall.js +6 -6
  263. package/dist/standalone/bk-checkbox-group.js +7 -7
  264. package/dist/standalone/bk-checkbox.js +4 -4
  265. package/dist/standalone/bk-chip-group.js +11 -7
  266. package/dist/standalone/bk-chip.js +59 -18
  267. package/dist/standalone/bk-cluster.js +1 -1
  268. package/dist/standalone/bk-code-diff.js +4 -4
  269. package/dist/standalone/bk-code-stack.js +4 -4
  270. package/dist/standalone/bk-code.js +10 -6
  271. package/dist/standalone/bk-color-panel.js +5 -5
  272. package/dist/standalone/bk-columns.js +13 -5
  273. package/dist/standalone/bk-combobox.js +23 -31
  274. package/dist/standalone/bk-command-menu.js +6 -6
  275. package/dist/standalone/bk-command-palette.js +8 -7
  276. package/dist/standalone/bk-composer.js +6 -6
  277. package/dist/standalone/bk-delta.js +11 -10
  278. package/dist/standalone/bk-diagram.js +1 -1
  279. package/dist/standalone/bk-dialog.js +1 -1
  280. package/dist/standalone/bk-disclosure.js +7 -5
  281. package/dist/standalone/bk-divider.js +5 -5
  282. package/dist/standalone/bk-drawer.js +3 -3
  283. package/dist/standalone/bk-drop-target.js +12 -6
  284. package/dist/standalone/bk-empty-state.js +3 -3
  285. package/dist/standalone/bk-error-summary.js +9 -6
  286. package/dist/standalone/bk-facts-item.js +2 -2
  287. package/dist/standalone/bk-facts.js +9 -8
  288. package/dist/standalone/bk-feature.js +3 -3
  289. package/dist/standalone/bk-fieldset.js +3 -3
  290. package/dist/standalone/bk-filter-bar.js +4 -4
  291. package/dist/standalone/bk-folder-browser.js +4 -4
  292. package/dist/standalone/bk-footnote.js +82 -0
  293. package/dist/standalone/bk-footnotes-item.js +122 -0
  294. package/dist/standalone/bk-footnotes.js +37 -0
  295. package/dist/standalone/bk-form-guard.js +2 -2
  296. package/dist/standalone/bk-form-steps.js +3 -3
  297. package/dist/standalone/bk-grid.js +1 -1
  298. package/dist/standalone/bk-icon-tile.js +3 -3
  299. package/dist/standalone/bk-icon.js +1 -1
  300. package/dist/standalone/bk-image-compare.js +127 -58
  301. package/dist/standalone/bk-image-crop.js +6 -6
  302. package/dist/standalone/bk-image-editor.js +1 -1
  303. package/dist/standalone/bk-image-viewer.js +283 -92
  304. package/dist/standalone/bk-input-code.js +4 -4
  305. package/dist/standalone/bk-input-color.js +4 -14
  306. package/dist/standalone/bk-input-date-range.js +2 -2
  307. package/dist/standalone/bk-input-date.js +2 -2
  308. package/dist/standalone/bk-input-file.js +22 -15
  309. package/dist/standalone/bk-input-group.js +4 -4
  310. package/dist/standalone/bk-input-inline.js +17 -10
  311. package/dist/standalone/bk-input-number.js +9 -8
  312. package/dist/standalone/bk-input-rating.js +6 -6
  313. package/dist/standalone/bk-input-rich.js +1 -1
  314. package/dist/standalone/bk-input-search.js +23 -22
  315. package/dist/standalone/bk-input-slider-range.js +5 -5
  316. package/dist/standalone/bk-input-slider.js +5 -5
  317. package/dist/standalone/bk-input-tags.js +224 -0
  318. package/dist/standalone/bk-input-text.js +1 -1
  319. package/dist/standalone/bk-input-time-zone.js +1 -1
  320. package/dist/standalone/bk-input-time.js +29 -28
  321. package/dist/standalone/bk-item-group.js +3 -3
  322. package/dist/standalone/bk-item.js +12 -11
  323. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  324. package/dist/standalone/bk-kbd.js +68 -1
  325. package/dist/standalone/bk-lightbox.js +24 -7
  326. package/dist/standalone/bk-lines.js +1 -1
  327. package/dist/standalone/bk-link.js +33 -19
  328. package/dist/standalone/bk-listbox-columns.js +8 -8
  329. package/dist/standalone/bk-listbox-item.js +1 -1
  330. package/dist/standalone/bk-listbox-search.js +7 -7
  331. package/dist/standalone/bk-listbox-transfer.js +6 -6
  332. package/dist/standalone/bk-listbox.js +7 -7
  333. package/dist/standalone/bk-logo-wall.js +2 -2
  334. package/dist/standalone/bk-logo.js +4 -4
  335. package/dist/standalone/bk-menu-bar.js +3 -3
  336. package/dist/standalone/bk-menu-context.js +1 -1
  337. package/dist/standalone/bk-menu-divider.js +2 -2
  338. package/dist/standalone/bk-menu-item.js +73 -29
  339. package/dist/standalone/bk-menu-label.js +7 -6
  340. package/dist/standalone/bk-menu-list.js +10 -4
  341. package/dist/standalone/bk-menu.js +19 -10
  342. package/dist/standalone/bk-message-approval.js +4 -4
  343. package/dist/standalone/bk-message-branches.js +3 -3
  344. package/dist/standalone/bk-message-citation.js +10 -10
  345. package/dist/standalone/bk-message-feedback.js +10 -6
  346. package/dist/standalone/bk-message-list.js +6 -5
  347. package/dist/standalone/bk-message-reasoning.js +5 -5
  348. package/dist/standalone/bk-message-source.js +13 -21
  349. package/dist/standalone/bk-message-tool-group.js +5 -5
  350. package/dist/standalone/bk-message-tool.js +5 -5
  351. package/dist/standalone/bk-message.js +6 -4
  352. package/dist/standalone/bk-meter.js +3 -3
  353. package/dist/standalone/bk-model-viewer.js +1 -1
  354. package/dist/standalone/bk-nav-divider.js +2 -2
  355. package/dist/standalone/bk-nav-group.js +9 -9
  356. package/dist/standalone/bk-nav-item.js +31 -23
  357. package/dist/standalone/bk-nav-toc.js +3 -3
  358. package/dist/standalone/bk-nav.js +3 -3
  359. package/dist/standalone/bk-overflow.js +3 -3
  360. package/dist/standalone/bk-page-cta.js +13 -4
  361. package/dist/standalone/bk-page-footer-column.js +2 -2
  362. package/dist/standalone/bk-page-footer.js +3 -3
  363. package/dist/standalone/bk-page-header.js +3 -3
  364. package/dist/standalone/bk-page-hero.js +3 -3
  365. package/dist/standalone/bk-page-pager.js +5 -5
  366. package/dist/standalone/bk-page-section.js +6 -6
  367. package/dist/standalone/bk-pagination.js +6 -6
  368. package/dist/standalone/bk-pane.js +10 -9
  369. package/dist/standalone/bk-panel.js +9 -10
  370. package/dist/standalone/bk-period-nav.js +4 -4
  371. package/dist/standalone/bk-picture.js +1 -166
  372. package/dist/standalone/bk-popover-help.js +3 -3
  373. package/dist/standalone/bk-popover.js +2 -2
  374. package/dist/standalone/bk-presence-cursor.js +3 -3
  375. package/dist/standalone/bk-preview.js +4 -4
  376. package/dist/standalone/bk-progress.js +3 -3
  377. package/dist/standalone/bk-prose.js +3 -3
  378. package/dist/standalone/bk-qr-code.js +1 -1
  379. package/dist/standalone/bk-radio-group.js +7 -7
  380. package/dist/standalone/bk-radio.js +3 -3
  381. package/dist/standalone/bk-rating.js +5 -5
  382. package/dist/standalone/bk-scroll.js +3 -3
  383. package/dist/standalone/bk-segmented-item.js +40 -16
  384. package/dist/standalone/bk-segmented.js +17 -15
  385. package/dist/standalone/bk-select-cascade.js +3 -3
  386. package/dist/standalone/bk-select-tree.js +4 -4
  387. package/dist/standalone/bk-select.js +5 -5
  388. package/dist/standalone/bk-shell-app.js +1 -1221
  389. package/dist/standalone/bk-shell-centered.js +2 -2
  390. package/dist/standalone/bk-shell-sites.js +5 -7
  391. package/dist/standalone/bk-skeleton.js +2 -2
  392. package/dist/standalone/bk-sortable.js +55 -60
  393. package/dist/standalone/bk-spinner.js +2 -2
  394. package/dist/standalone/bk-split-grid.js +324 -44
  395. package/dist/standalone/bk-split.js +8 -8
  396. package/dist/standalone/bk-stack.js +1 -1
  397. package/dist/standalone/bk-stat-group.js +8 -7
  398. package/dist/standalone/bk-stat.js +12 -9
  399. package/dist/standalone/bk-status-dot.js +3 -3
  400. package/dist/standalone/bk-steps-item.js +5 -5
  401. package/dist/standalone/bk-steps.js +8 -7
  402. package/dist/standalone/bk-surface.js +1 -1
  403. package/dist/standalone/bk-swatch-group.js +8 -8
  404. package/dist/standalone/bk-swatch-palette.js +1 -1
  405. package/dist/standalone/bk-swatch.js +2 -2
  406. package/dist/standalone/bk-switch.js +4 -4
  407. package/dist/standalone/bk-table.js +1 -1937
  408. package/dist/standalone/bk-tabs-item.js +58 -35
  409. package/dist/standalone/bk-tabs-panel.js +7 -3
  410. package/dist/standalone/bk-tabs.js +3 -352
  411. package/dist/standalone/bk-tasks-item.js +4 -4
  412. package/dist/standalone/bk-tasks.js +2 -2
  413. package/dist/standalone/bk-testimonial.js +3 -3
  414. package/dist/standalone/bk-text.js +21 -20
  415. package/dist/standalone/bk-time-countdown.js +4 -4
  416. package/dist/standalone/bk-time-relative.js +3 -3
  417. package/dist/standalone/bk-timeline-item.js +4 -4
  418. package/dist/standalone/bk-timeline.js +2 -2
  419. package/dist/standalone/bk-toast-group.js +1 -1
  420. package/dist/standalone/bk-toast.js +4 -4
  421. package/dist/standalone/bk-toolbar.js +2 -2
  422. package/dist/standalone/bk-tooltip.js +8 -7
  423. package/dist/standalone/bk-tree-item.js +6 -6
  424. package/dist/standalone/bk-tree.js +5 -5
  425. package/dist/standalone/bk-video.js +6 -6
  426. package/dist/standalone/bk-visually-hidden.js +2 -2
  427. package/dist/standalone/bk-zoom.js +5 -5
  428. package/dist/standalone/chunks/announcer-6tMlCOq1.js +41 -0
  429. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  430. package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-hCLuG-RM.js} +3 -3
  431. package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-_dudBMVq.js} +4 -4
  432. package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-BB2odomE.js} +5 -5
  433. package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DcvwnOtN.js} +59 -25
  434. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-D4kI4F18.js} +4 -3
  435. package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-SRVkHI-4.js} +5 -5
  436. package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
  437. package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-AmDv87E5.js} +6 -6
  438. package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-2n89GDIT.js} +73 -54
  439. package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-BoNYBd6W.js} +4 -4
  440. package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
  441. package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CSFfc8As.js} +3 -3
  442. package/dist/standalone/chunks/bk-shell-app-BlCOG25y.js +1236 -0
  443. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-BULRdKam.js} +9 -7
  444. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-Cqj85tSW.js} +6 -6
  445. package/dist/standalone/chunks/bk-table-DWlD7yoM.js +1945 -0
  446. package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
  447. package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-5nZg7BaJ.js} +27 -24
  448. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  449. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-eG3uHonz.js} +5 -4
  450. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  451. package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-B0oe_9fI.js} +6 -6
  452. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  453. package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
  454. package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
  455. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  456. package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-Dy1_qxNv.js} +48 -47
  457. package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
  458. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  459. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  460. package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-Bmk0SRDX.js} +2 -2
  461. package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
  462. package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BAe9fPYJ.js} +14 -33
  463. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-B2kF-b8p.js} +1 -1
  464. package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
  465. package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
  466. package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
  467. package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
  468. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  469. package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
  470. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-ySaDL-dW.js} +2 -2
  471. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  472. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  473. package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
  474. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  475. package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
  476. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  477. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  478. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  479. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BAUc_LqI.js} +1 -1
  480. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  481. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  482. package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
  483. package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
  484. package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CufOGdfr.js} +17 -11
  485. package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-Cgqp1jhf.js} +5 -3
  486. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  487. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-D-qgACnE.js} +1 -1
  488. package/dist/standalone/confirm.js +27 -14
  489. package/dist/standalone/i18n-de.js +13 -2
  490. package/dist/standalone/icons.js +100 -98
  491. package/dist/standalone/links.js +1 -1
  492. package/dist/standalone/reset.css +10 -0
  493. package/dist/standalone/toast.js +1 -1
  494. package/dist/standalone/tokens.css +6 -5
  495. package/dist/tokens.css +6 -5
  496. package/dist/tokens.js +4 -3
  497. package/package.json +25 -2
  498. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  499. package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
  500. package/dist/standalone/chunks/define-CzVPD4Zi.js +0 -30
  501. package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
  502. package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
  503. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -34,7 +34,7 @@ import "../icons/set/chevron-down.js";
34
34
  * a colour stays in the field, and the field shows "Enter a valid colour." and is invalid (`badInput`,
35
35
  * the `invalid` attribute) until the user corrects it. Leaving the field keeps the text and the error,
36
36
  * as a native field keeps a bad entry. Escape restores the last valid colour and removes the error.
37
- * The swatch is then the button that opens the panel; the chevron opens it too.
37
+ * The swatch is then the only button that opens the panel. The box shows no chevron: it is a text field, not a choice.
38
38
  *
39
39
  * Extras in the box (the shared text field extras of `bk-input-text`): `clearable` shows a clear
40
40
  * button while there is a colour; it sets the value to "" (no colour) and fires `input` and
@@ -53,7 +53,7 @@ import "../icons/set/chevron-down.js";
53
53
  * @csspart prefix - The `prefix` text.
54
54
  * @csspart suffix - The `suffix` text.
55
55
  * @csspart clear-button - The clear button of `clearable`.
56
- * @csspart chevron - The dropdown icon.
56
+ * @csspart chevron - The dropdown icon (not with `editable`).
57
57
  * @csspart popup - The popup dialog (the overlay surface).
58
58
  * @csspart panel - The `<bk-color-panel>` in the popup.
59
59
  * @csspart hint - Hint text.
@@ -246,9 +246,6 @@ export declare class BkInputColor extends TextField {
246
246
  render(): import("lit-html").TemplateResult<1>;
247
247
  /** The box of `editable`: the swatch opens the panel, the text field contains the colour as text. */
248
248
  private renderEditableBox;
249
- /** The chevron of `editable` opens and closes the panel like the swatch, and keeps the focus where it is. */
250
- private onChevronPointerdown;
251
- private onChevronClick;
252
249
  }
253
250
  declare global {
254
251
  interface HTMLElementTagNameMap {
@@ -72,8 +72,6 @@ class BkInputColor extends TextField {
72
72
  .box:has(.pick:focus) {
73
73
  border-color: var(--bk-field-border, var(--bk-line-strong)); box-shadow: var(--bk-field-shadow, var(--bk-shadow-control));
74
74
  }
75
- :host([editable]) .chevron { cursor: pointer; }
76
- :host([editable][disabled]) .chevron { cursor: not-allowed; }
77
75
  input { font-variant-numeric: tabular-nums; }
78
76
  /* The trigger fills the box: its ::before covers the whole box, so a click anywhere opens the panel. */
79
77
  .trigger {
@@ -364,20 +362,8 @@ class BkInputColor extends TextField {
364
362
  ${this.renderSuffix()}
365
363
  ${this.renderClear()}
366
364
  ${this.renderEnd()}
367
- <bk-icon class="chevron" part="chevron" name="chevron-down"
368
- @pointerdown=${this.onChevronPointerdown} @click=${this.onChevronClick}></bk-icon>
369
365
  </div>`;
370
366
  }
371
- /** The chevron of `editable` opens and closes the panel like the swatch, and keeps the focus where it is. */
372
- onChevronPointerdown(e) {
373
- e.preventDefault();
374
- this.onBoxPointerdown();
375
- }
376
- onChevronClick() {
377
- if (this.isDisabled)
378
- return;
379
- this.onBoxClick();
380
- }
381
367
  }
382
368
  define("bk-input-color", BkInputColor);
383
369
  export {
@@ -86,11 +86,27 @@ export type FilePasteScope = "focus" | "page";
86
86
  * a button that opens a gallery of the app. The field styles them like its browse button. The
87
87
  * app passes the chosen files to `addFiles()`. `accept` and `max-files` apply to them too.
88
88
  *
89
+ * Put a preview of the chosen file in the `preview` slot, for example a picture, a 3D viewer or a crop
90
+ * tool. The zone then shows the preview in place of its icon, with the prompt, the browse button and
91
+ * the actions in a row below it. The field shows no list and no tiles: the app shows the files and
92
+ * uploads them. The zone still accepts dropped and pasted files, and fires `input` and `change`.
93
+ * Without `multiple` a new file replaces the chosen one. A click on the preview does not open the
94
+ * file dialog. To show the empty zone again, remove the preview and set `files = []`
95
+ * (a form reset clears `files` too).
96
+ *
97
+ * ```html
98
+ * <bk-input-file name="image" label="Image" accept="image/*">
99
+ * <img slot="preview" src="blob:…" alt="The chosen image">
100
+ * </bk-input-file>
101
+ * ```
102
+ *
89
103
  * @slot - Prompt in the zone before the browse button (default: i18n `fileDropPrompt`).
90
104
  * @slot actions - Other sources of files after the browse button: `<button type="button">` elements, in the look of the browse button.
105
+ * @slot preview - A preview of the chosen file in the zone, in place of the icon (a picture, a viewer, a crop tool). The field then shows no list and no tiles.
91
106
  * @csspart field - Wrapper of label, zone, hint and list.
92
107
  * @csspart label - The visible label.
93
108
  * @csspart zone - The dashed drop zone.
109
+ * @csspart preview - The area of the `preview` slot in the zone.
94
110
  * @csspart browse - The button that opens the file dialog.
95
111
  * @csspart browse-folder - The button that opens the folder dialog (`folders`).
96
112
  * @csspart files - The list of chosen files.
@@ -114,6 +130,7 @@ export type FilePasteScope = "focus" | "page";
114
130
  * @cssprop --bk-input-file-padding-block - Space above and below the zone content (default from `size`: --bk-space-3, --bk-space-5, --bk-space-8).
115
131
  * @cssprop --bk-input-file-padding-inline - Space before and after the zone content (default from `size`: --bk-space-3, --bk-space-4, --bk-space-6).
116
132
  * @cssprop --bk-input-file-gap - Space between icon and prompt (default --bk-space-1).
133
+ * @cssprop --bk-input-file-preview-gap - Space between the preview and the row of the browse button (default --bk-space-2).
117
134
  * @cssprop --bk-input-file-font-size - Zone text size (default from `size`: --bk-type-small, --bk-type-small, --bk-type-body).
118
135
  * @cssprop --bk-input-file-icon-size - Zone icon size (default from `size`: --bk-icon-md, --bk-icon-lg, 1.5 × --bk-icon-lg).
119
136
  * @cssprop --bk-input-file-icon-color - Zone icon colour (default: the text colour).
@@ -135,10 +135,14 @@ class BkInputFile extends FormControl {
135
135
  font-size: var(--_bk-input-file-font); line-height: var(--bk-line-height-tight); text-align: center;
136
136
  cursor: pointer; transition: border-color var(--bk-duration-fast), background-color var(--bk-duration-fast), box-shadow var(--bk-duration-fast);
137
137
  }
138
+ .zone.has-preview { gap: var(--bk-input-file-preview-gap, var(--bk-space-2)); }
139
+ .preview { justify-self: stretch; display: grid; place-items: center; min-inline-size: 0; cursor: auto; }
140
+ .preview[hidden] { display: none; }
141
+ .preview ::slotted(*) { max-inline-size: 100%; }
138
142
  .zone bk-icon { --bk-icon-size: var(--_bk-input-file-icon-size); color: var(--bk-input-file-icon-color, currentColor); }
139
143
  @media (hover: hover) { :host(:not([disabled])) .zone:hover:not(:focus-within) { border-color: var(--bk-input-file-hover-border, var(--bk-line-hover)); } }
140
- /* The zone is the field: it shows focus on any focus, like the box of an input. */
141
- .zone:focus-within {
144
+ /* The zone is the field: it shows focus on any focus, like the box of an input. A preview with focus shows its own focus. */
145
+ .zone:not(.has-preview):focus-within, .zone.has-preview:has(> .line:focus-within) {
142
146
  border-style: solid; border-color: var(--bk-input-file-active-border, var(--bk-accent-solid));
143
147
  box-shadow: var(--bk-field-focus-ring, var(--bk-ring-focus));
144
148
  }
@@ -439,6 +443,9 @@ class BkInputFile extends FormControl {
439
443
  onZoneClick(e) {
440
444
  if (e.target.closest?.(".browse, [slot='actions']"))
441
445
  return;
446
+ const preview = this.renderRoot.querySelector(".preview");
447
+ if (preview && e.composedPath().includes(preview))
448
+ return;
442
449
  this.showPicker();
443
450
  }
444
451
  hasFiles(e) {
@@ -597,12 +604,14 @@ class BkInputFile extends FormControl {
597
604
  ?disabled=${this.isDisabled} @change=${this.onPick} @click=${(e) => e.stopPropagation()} />
598
605
  ${this.folders ? html`<input type="file" webkitdirectory tabindex="-1" aria-hidden="true" ?disabled=${this.isDisabled}
599
606
  @change=${this.onPick} @click=${(e) => e.stopPropagation()} />` : nothing}`;
600
- const zone = html`<div class="zone ${this.dragging ? "dragging" : ""} ${this.invalid ? "has-error" : ""}" part="zone"
607
+ const preview = this.slots.has("preview");
608
+ const zone = html`<div class="zone ${this.dragging ? "dragging" : ""} ${this.invalid ? "has-error" : ""} ${preview ? "has-preview" : ""}" part="zone"
601
609
  aria-disabled=${ifDefined(this.isDisabled ? "true" : void 0)}
602
610
  @click=${this.onZoneClick} @dragenter=${this.onDragEnter} @dragover=${this.onDragOver}
603
611
  @dragleave=${this.onDragLeave} @drop=${this.onDrop}>
604
- <bk-icon name=${this.icon}></bk-icon>
605
- <span><span class="prompt" id="prompt"><slot></slot>${this.slots.has("") ? nothing : this.i18n.t(this.folders ? "fileDropPromptFolders" : this.multiple ? "fileDropPromptMany" : "fileDropPrompt")}</span>
612
+ ${preview ? nothing : html`<bk-icon name=${this.icon}></bk-icon>`}
613
+ <div class="preview" part="preview" ?hidden=${!preview}><slot name="preview"></slot></div>
614
+ <span class="line"><span class="prompt" id="prompt"><slot></slot>${this.slots.has("") ? nothing : this.i18n.t(this.folders ? "fileDropPromptFolders" : this.multiple ? "fileDropPromptMany" : "fileDropPrompt")}</span>
606
615
  <button type="button" class="browse" part="browse" id="control" ?disabled=${this.isDisabled}
607
616
  aria-labelledby=${ifDefined(this.label ? "label control" : void 0)}
608
617
  aria-label=${ifDefined(external ? `${external}, ${browse}` : void 0)}
@@ -614,7 +623,8 @@ class BkInputFile extends FormControl {
614
623
  @click=${() => this.showFolderPicker()}>${folder}</button>` : nothing}${this.slots.has("actions") ? html`<span aria-hidden="true"> · </span>` : nothing}<slot name="actions"></slot></span>
615
624
  ${inputs}
616
625
  </div>`;
617
- const tiles = this.variant === "tiles" && this.files.length > 0;
626
+ const tiles = this.variant === "tiles" && this.files.length > 0 && !preview;
627
+ const list = this.files.length > 0 && !tiles && !preview;
618
628
  return html`${fieldTemplate({
619
629
  label: this.label,
620
630
  hint: this.fieldHint(this.hint),
@@ -626,10 +636,10 @@ class BkInputFile extends FormControl {
626
636
  labelFor: "control",
627
637
  control: tiles ? this.renderTiles(inputs, desc, external) : zone
628
638
  })}
629
- ${this.files.length && !tiles ? html`<ul class="files" part="files" aria-label=${this.i18n.t("fileList")}>
639
+ ${list ? html`<ul class="files" part="files" aria-label=${this.i18n.t("fileList")}>
630
640
  ${repeat(this.files, (f) => f, (f, i) => this.renderFile(f, i))}
631
641
  </ul>` : nothing}
632
- ${many && this.files.length ? html`<bk-bar class="footer" part="footer">
642
+ ${many && this.files.length && !preview ? html`<bk-bar class="footer" part="footer">
633
643
  <span>${this.maxFiles === void 0 ? this.i18n.t("fileCount", { count: this.files.length }) : this.i18n.t("fileCountOf", { count: this.files.length, max: this.maxFiles })}</span>
634
644
  <bk-button slot="end" class="remove-all" part="remove-all" variant="ghost" size="sm" ?disabled=${this.isDisabled}
635
645
  @click=${this.onRemoveAll}>${this.i18n.t("fileRemoveAll")}</bk-button>
@@ -26,9 +26,10 @@ export interface InputInlineSaveDetail {
26
26
  * With a mouse the pencil overlays the row after the text. It needs no room, so content after the
27
27
  * element keeps the normal gap and does not move when the pencil shows. On a touch screen the pencil is in the row.
28
28
  * A field rendered open from the start (`editing` in the markup) waits for the user. On hover the text shows a tint where
29
- * the frame of the open field is. The check button replaces the pencil. Enter or the check saves.
30
- * Esc or a click outside cancels. Tab out keeps the field open. Esc never reaches a surrounding dialog.
31
- * Focus returns to the pencil afterwards.
29
+ * the frame of the open field is. The check button replaces the pencil.
30
+ * Enter, the check, Tab out of the element and a click outside save, as in a cell of a spreadsheet. Only Esc and the
31
+ * cancel button of an `edit` control cancel. Esc never reaches a surrounding dialog. After Enter, the check or Esc, the
32
+ * focus returns to the pencil. The first Tab reaches the check. The next Tab saves and moves the focus on.
32
33
  *
33
34
  * Editing does not change the look of the line. The field uses the font, weight, colour and line
34
35
  * height of the text. The text stays where it is, and the field is as wide as its text. The frame
@@ -40,7 +41,9 @@ export interface InputInlineSaveDetail {
40
41
  * Saving fires `save` with `{ value, done }`. For a server round trip call `preventDefault()`,
41
42
  * then `done()` on success or `done("Name already taken")` to keep the field open with that
42
43
  * error (shown under the field and announced as an alert); the field is busy until then. Without `preventDefault()` the field
43
- * accepts the new value right away. An unchanged value closes the field like cancel.
44
+ * accepts the new value right away. An unchanged value closes the field like cancel. An empty value also fires `save`
45
+ * (without `required`), so the app can put a default name in its place. An error keeps the field open and takes the focus
46
+ * back, also after Tab or a click outside.
44
47
  *
45
48
  * **Any field.** Put a form control in the `edit` slot to edit more than text: a select, a date, a text area, a
46
49
  * combobox. Put the read view in the `display` slot (a badge, a formatted date, a link); without it the view shows
@@ -78,11 +81,12 @@ export interface InputInlineSaveDetail {
78
81
  * @cssprop --bk-input-inline-error-bg - Background of the error under the field (default --bk-layer-overlay-bg).
79
82
  * @cssprop --bk-input-inline-error-shadow - Shadow of the error under the field (default --bk-layer-overlay-shadow).
80
83
  * @fires {CustomEvent<InputInlineSaveDetail>} save - The user confirms a changed value; `event.detail` is `{ value, done }`.
81
- * @fires {Event} cancel - The field closes without saving: Esc or a click outside (does not bubble, so dialogs around it stay open).
84
+ * @fires {Event} cancel - The field closes without saving: Esc, the cancel button or an unchanged value (does not bubble, so dialogs around it stay open).
82
85
  *
83
86
  * @tag bk-input-inline
84
87
  * @keyboard Enter, Space - On the edit button: open the field.
85
88
  * @keyboard Enter - In the field: save. A multiline field and a list in the `edit` slot keep their own Enter.
89
+ * @keyboard Tab, Shift+Tab - Out of the element: save and move the focus on. Inside it, Tab reaches the check first.
86
90
  * @keyboard Escape - Cancel and show the old value. A dialog around the field stays open.
87
91
  * @a11y The read view is text with an edit button that names what it edits. The open field receives the focus and names the Escape key in its description. After save or cancel the focus returns to the edit button. An error is an alert.
88
92
  */
@@ -165,8 +169,13 @@ export declare class BkInputInline extends LitElement {
165
169
  private renderSave;
166
170
  /** A click on the read view opens the field, unless it hits a link or a button of the view. */
167
171
  private onDisplayClick;
168
- /** A press outside the element cancels; a save in progress stays. Tab out keeps the field open. */
172
+ /** A press outside the element saves; a save in progress stays. */
169
173
  private onOutside;
174
+ /**
175
+ * Focus that leaves the element (Tab, Shift+Tab) saves. Focus that moves inside it (the check, the popup of a control)
176
+ * does not. Without a new target (the window loses the focus) the field stays open.
177
+ */
178
+ private onFocusOut;
170
179
  disconnectedCallback(): void;
171
180
  render(): import("lit-html").TemplateResult<1>;
172
181
  }
@@ -41,6 +41,7 @@ class BkInputInline extends LitElement {
41
41
  this.editing = false;
42
42
  this.busy = false;
43
43
  this.error = "";
44
+ this.addEventListener("focusout", this.onFocusOut);
44
45
  }
45
46
  static styles = [base, srOnly, css`
46
47
  :host {
@@ -48,7 +49,11 @@ class BkInputInline extends LitElement {
48
49
  --_bk-inline-px: var(--bk-input-inline-pad-inline, var(--bk-space-1-5));
49
50
  --_bk-inline-py: var(--bk-input-inline-pad-block, var(--bk-space-1));
50
51
  --_bk-inline-bw: var(--bk-field-border-width, var(--bk-border-width));
52
+ --_bk-input-inline-ctl: var(--bk-control-md);
53
+ --_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
51
54
  }
55
+ :host([size="sm"]) { --_bk-input-inline-ctl: var(--bk-control-sm); }
56
+ :host([size="lg"]) { --_bk-input-inline-ctl: var(--bk-control-lg); }
52
57
  :host([size="sm"]) :is(.text, input) { font-size: var(--bk-type-small); }
53
58
  :host([size="lg"]) :is(.text, input) { font-size: var(--bk-type-lead); }
54
59
  /* One line, as tall in both: with line-height normal an input and a span measure their line differently. */
@@ -73,11 +78,8 @@ class BkInputInline extends LitElement {
73
78
  reach over the line by the same amount above and below instead of making the line taller, so the text stays. */
74
79
  .pencil {
75
80
  display: inline-flex;
76
- --_bk-input-inline-ctl: var(--bk-control-md);
77
81
  margin-block: min(0px, calc((1lh - var(--_bk-input-inline-ctl)) / 2));
78
82
  }
79
- :host([size="sm"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-sm); }
80
- :host([size="lg"]) .pencil { --_bk-input-inline-ctl: var(--bk-control-lg); }
81
83
  .pencil { opacity: 0; transition: opacity var(--bk-duration-fast); }
82
84
  /* The pencil reaches over the line: its focus ring goes inside it, so it does not touch the text around. */
83
85
  .pencil bk-button { --bk-button-focus-offset: var(--bk-focus-offset-inset); }
@@ -126,8 +128,9 @@ class BkInputInline extends LitElement {
126
128
  pointer. The check of the open field stands in the same place. With a slotted editor the check and the cancel
127
129
  button stay in the row. */
128
130
  @media (hover: hover) and (forced-colors: none) {
131
+ /* The host leaves room for the pencil in its container: a full line does not push the pencil out of it. */
132
+ :host { max-width: calc(100% - var(--_bk-input-inline-pencil-gap) - var(--_bk-input-inline-ctl)); }
129
133
  :is(.text, .display, .edit:not(.slotted)) + .pencil {
130
- --_bk-input-inline-pencil-gap: max(var(--bk-input-inline-gap, var(--bk-space-1)), calc(var(--_bk-inline-px) + var(--_bk-inline-bw)));
131
134
  position: relative; z-index: 1; flex: none;
132
135
  inline-size: calc(var(--_bk-input-inline-pencil-gap) + var(--_bk-input-inline-ctl));
133
136
  margin-inline: calc(-1 * var(--bk-input-inline-gap, var(--bk-space-1))) calc(-1 * (var(--_bk-input-inline-pencil-gap) + var(--_bk-input-inline-ctl)));
@@ -304,11 +307,24 @@ class BkInputInline extends LitElement {
304
307
  return;
305
308
  this.edit();
306
309
  };
307
- /** A press outside the element cancels; a save in progress stays. Tab out keeps the field open. */
310
+ /** A press outside the element saves; a save in progress stays. */
308
311
  onOutside = (e) => {
309
312
  if (this.busy || e.composedPath().includes(this))
310
313
  return;
311
- this.cancel();
314
+ this.save();
315
+ };
316
+ /**
317
+ * Focus that leaves the element (Tab, Shift+Tab) saves. Focus that moves inside it (the check, the popup of a control)
318
+ * does not. Without a new target (the window loses the focus) the field stays open.
319
+ */
320
+ onFocusOut = (e) => {
321
+ if (!this.editing || this.busy)
322
+ return;
323
+ const next = e.relatedTarget;
324
+ if (!next || next === this || this.contains(next) || this.renderRoot?.contains(next))
325
+ return;
326
+ this.save();
327
+ this.restoreFocus = false;
312
328
  };
313
329
  disconnectedCallback() {
314
330
  super.disconnectedCallback();
@@ -6,6 +6,7 @@ import { emit } from "../internal/events.js";
6
6
  import { parseNumber, snapToStep, stepDecimals, stepFormat } from "../internal/number.js";
7
7
  import { TextField } from "../internal/text-field.js";
8
8
  import "./bk-icon.js";
9
+ import { submitImplicitly } from "../internal/submit.js";
9
10
  import "../icons/set/add.js";
10
11
  import "../icons/set/remove.js";
11
12
  class BkInputNumber extends TextField {
@@ -301,7 +302,7 @@ class BkInputNumber extends TextField {
301
302
  case "Enter":
302
303
  this.commitText(true);
303
304
  if (this.internals.form)
304
- setTimeout(() => this.internals.form?.requestSubmit());
305
+ setTimeout(() => submitImplicitly(this.internals.form));
305
306
  return;
306
307
  default:
307
308
  return;
@@ -98,7 +98,7 @@ export declare function clauseText(c: SearchClause): string;
98
98
  * @cssprop --bk-input-search-input-min-width - Narrowest text field next to the tokens before it wraps (default 6ch).
99
99
  * @cssprop --bk-input-search-popup-bg - Popup background (default --bk-layer-overlay-bg).
100
100
  * @cssprop --bk-input-search-popup-border - Popup border colour (default --bk-layer-overlay-border).
101
- * @cssprop --bk-input-search-popup-radius - Popup corner radius (default --bk-radius-md).
101
+ * @cssprop --bk-input-search-popup-radius - Popup corner radius (default --bk-row-radius + the padding + the border: concentric with the rows).
102
102
  * @cssprop --bk-input-search-popup-shadow - Popup shadow (default --bk-layer-overlay-shadow).
103
103
  * @cssprop --bk-input-search-popup-padding - Space between popup edge and rows (default --bk-space-1).
104
104
  * @cssprop --bk-input-search-popup-offset - Gap between box and popup (default --bk-space-1).
@@ -8,6 +8,7 @@ import { edgeOption, matchesText } from "../internal/options.js";
8
8
  import "./bk-chip.js";
9
9
  import "./bk-icon.js";
10
10
  import "./bk-spinner.js";
11
+ import { submitImplicitly } from "../internal/submit.js";
11
12
  import "../icons/set/search.js";
12
13
  function splitWords(text) {
13
14
  return text.match(/(?:[^\s"]|"[^"]*"?)+/g) ?? [];
@@ -299,7 +300,7 @@ class BkInputSearch extends ChoiceField {
299
300
  const go = emitDetail(this, "search", detail, true);
300
301
  const form = this.internals.form;
301
302
  if (go && form)
302
- setTimeout(() => form.requestSubmit());
303
+ setTimeout(() => submitImplicitly(form));
303
304
  }
304
305
  /* ---------- events ---------- */
305
306
  onInput(e) {
@@ -0,0 +1,219 @@
1
+ import { type PropertyValues } from "lit";
2
+ import { TextField } from "../internal/text-field.js";
3
+ import type { BkChip } from "./bk-chip.js";
4
+ import "./bk-chip.js";
5
+ /** `detail` of the `add` event: the text that the user wants to add as a tag. */
6
+ export type InputTagsAddDetail = {
7
+ value: string;
8
+ };
9
+ /** `detail` of the `remove` event: the value of the tag, and the slotted chip (undefined for a chip of the element). */
10
+ export type InputTagsRemoveDetail = {
11
+ value: string;
12
+ chip?: BkChip;
13
+ };
14
+ /**
15
+ * A text field for a list of short values, for example the tags of a record. Each value shows as a `<bk-chip>` before
16
+ * the text. The user types a value and adds it with Enter or a comma.
17
+ *
18
+ * ```html
19
+ * <bk-input-tags label="Tags" name="tags" placeholder="Add a tag…"></bk-input-tags>
20
+ * ```
21
+ *
22
+ * - **Value**: `values` is the list of values, in the order the user added them. A value that is already in the list
23
+ * is not added again. The compare is case-sensitive: "Design" and "design" are two values.
24
+ * - **Keyboard**: Enter or a comma adds the typed text. Backspace in the empty text removes the last tag. When the
25
+ * field loses focus, the field adds the typed text. A pasted list (parts with a comma, a semicolon or a line break
26
+ * between them) adds one tag for each part.
27
+ * - **Events**: before the field adds a value, it fires a cancelable `add` event (`detail.value`). Before it removes a
28
+ * value (Backspace or the remove button of a chip), it fires a cancelable `remove` event (`detail.value`). Cancel the
29
+ * event to keep the list as it is, for example for a value that is not valid. The typed text of a cancelled `add`
30
+ * stays in the field. After a change of `values`, the field fires `input` and `change`.
31
+ * - **Slotted chips**: put `<bk-chip>` elements in the default slot, and the field shows them instead of its own
32
+ * chips. The app then controls the chips: the field adds and removes no chip itself. `add` and `remove`
33
+ * (`detail.chip` is the chip) tell the app what the user wants. The app adds a chip, removes it, or marks it
34
+ * (`removed`, `tone="success"`), for example in a diff of tags. The value is the text of each chip that is not
35
+ * `removed`. The field stops the `remove` event of a slotted chip and fires its own `remove` (`detail.chip` is the
36
+ * chip), so a listener on the field gets one shape for Backspace and for the remove button. A listener on the chip
37
+ * still gets the event of the chip. The `restore` event of a `removed` chip bubbles to the app unchanged: its target
38
+ * is the chip. Give the chips `removable` and the `size` of the field. Without slotted chips, the field shows
39
+ * `values` again.
40
+ * - **Forms**: form-associated like a native control: `name`, `values` (one entry for each value), `required` (an empty
41
+ * list is not valid), reset (to the values at the first connection), disabled fieldsets, `<label for>`.
42
+ * - **Box**: the shared text box of `<bk-input-text>`: `label`, `hint`, `error`, `size`, the `icon` attribute and the
43
+ * `start` slot, `prefix` and `suffix` (the prefix comes before the tags), the `end` slot and `clearable`. The clear
44
+ * button empties the typed text and the values of the field (not slotted chips).
45
+ *
46
+ * i18n keys: `valueRequired`, `clear`; the chips use `removeItem` and `restoreItem`. `clear-label` overrides the name of
47
+ * the clear button.
48
+ *
49
+ * @tag bk-input-tags
50
+ * @keyboard Enter, Comma - Add the typed text as a tag. Enter in an empty field submits the form.
51
+ * @keyboard Backspace - In an empty field, remove the last tag (not a `removed` chip).
52
+ * @a11y A native text `<input>` with its `<label>`. The description of the input lists the values. The remove button of each chip is a native button in the tab order, named "Remove {item}" ("Restore {item}" on a `removed` chip). The clear button is not in the tab order.
53
+ * @fires {Event} restore - The `restore` event of a slotted `removed` chip, unchanged (the chip is the target).
54
+ * @slot - `<bk-chip>` elements that the app controls (see "Slotted chips").
55
+ * @slot start - Leading content inside the box, for example a `<bk-icon>`.
56
+ * @slot end - Trailing content inside the box.
57
+ * @slot label-end - Content after the label in its row, for example a `<bk-popover-help>`.
58
+ * @slot hint - Rich hint below the control, for example with inline `<code>`. It replaces the `hint` text. The control uses it as its description.
59
+ * @csspart field - Wrapper of label, box and hint.
60
+ * @csspart label - The `<label>`.
61
+ * @csspart box - The bordered box.
62
+ * @csspart input - The text `<input>`.
63
+ * @csspart tag - Each value of the field (a `<bk-chip>`). Slotted chips are not parts.
64
+ * @csspart prefix - The `prefix` text.
65
+ * @csspart suffix - The `suffix` text.
66
+ * @csspart clear-button - The clear button of `clearable`.
67
+ * @csspart hint - Hint text under the box.
68
+ * @csspart error - Error text.
69
+ * @cssprop --bk-input-tags-font-size - Text size in the box (default from `size`: --bk-type-small, --bk-type-body, --bk-type-lead).
70
+ * @cssprop --bk-input-tags-tag-gap - Space between the tags and the text (default --bk-space-1).
71
+ * @cssprop --bk-input-tags-tags-padding - Padding of the box with tags above, below and before the first chip (default the inset of a button in a field: --bk-field-button-inset, else --bk-space-0 / --bk-space-1 / --bk-space-1-5 by size).
72
+ * @cssprop --bk-input-tags-input-min-width - Narrowest text field next to the tags before it wraps (default --bk-target-min).
73
+ * @cssprop --bk-field-* - Shared field tokens, see `<bk-input-text>`.
74
+ * @fires {CustomEvent<InputTagsAddDetail>} add - The user adds a value (Enter, comma, paste, blur). Cancelable: cancel it to keep the list as it is. It bubbles and is composed.
75
+ * @fires {CustomEvent<InputTagsRemoveDetail>} remove - The user removes a value (Backspace, or the remove button of a chip of the field). Cancelable. It bubbles and is composed. With slotted chips, `detail.chip` is the chip. The field stops the `remove` event of a slotted chip at the field and fires this event instead.
76
+ * @fires {Event} input - When the values of the field change by the user (added, removed, cleared).
77
+ * @fires {Event} change - When the values of the field change by the user.
78
+ */
79
+ export declare class BkInputTags extends TextField {
80
+ static properties: {
81
+ name: {
82
+ reflect: boolean;
83
+ useDefault: boolean;
84
+ };
85
+ disabled: {
86
+ type: BooleanConstructor;
87
+ reflect: boolean;
88
+ };
89
+ required: {
90
+ type: BooleanConstructor;
91
+ reflect: boolean;
92
+ };
93
+ invalid: {
94
+ type: BooleanConstructor;
95
+ reflect: boolean;
96
+ };
97
+ validationText: {
98
+ state: boolean;
99
+ };
100
+ externalLabel: {
101
+ state: boolean;
102
+ };
103
+ optional: {
104
+ type: BooleanConstructor;
105
+ reflect: boolean;
106
+ };
107
+ label: {};
108
+ hint: {};
109
+ error: {};
110
+ icon: {};
111
+ size: {
112
+ reflect: boolean;
113
+ useDefault: boolean;
114
+ };
115
+ prefixText: {
116
+ attribute: string;
117
+ };
118
+ suffixText: {
119
+ attribute: string;
120
+ };
121
+ clearable: {
122
+ type: BooleanConstructor;
123
+ reflect: boolean;
124
+ };
125
+ clearLabel: {
126
+ attribute: string;
127
+ };
128
+ labelPosition: {
129
+ attribute: string;
130
+ reflect: boolean;
131
+ useDefault: boolean;
132
+ };
133
+ values: {
134
+ attribute: boolean;
135
+ noAccessor: boolean;
136
+ };
137
+ placeholder: {};
138
+ readonly: {
139
+ type: BooleanConstructor;
140
+ reflect: boolean;
141
+ };
142
+ enterKeyHint: {
143
+ attribute: string;
144
+ };
145
+ text: {
146
+ state: boolean;
147
+ };
148
+ };
149
+ static styles: import("lit").CSSResultGroup[];
150
+ /** Text shown while the field has no tags. */
151
+ placeholder: string | undefined;
152
+ /** Shows the values, but the user cannot change them. */
153
+ readonly: boolean;
154
+ /** Label of the Enter key on a phone keyboard, like the native `enterkeyhint`: `enter`, `done`, `go`, `next`, `previous`, `search`, `send`. */
155
+ enterKeyHint: string;
156
+ /** The typed text that is not a tag yet. */
157
+ private text;
158
+ /** The values of the field when it has no slotted chips. */
159
+ private own;
160
+ /** The values at the first connection, restored on form reset. */
161
+ defaultValues: string[];
162
+ private connectedOnce;
163
+ private observer;
164
+ constructor();
165
+ /** The slotted `<bk-chip>` elements, in their order. */
166
+ private get chips();
167
+ /** The app controls the chips: the default slot has `<bk-chip>` elements. */
168
+ private get controlled();
169
+ /** The values: the text of the slotted chips that are not `removed`, else the values of the field. */
170
+ get values(): string[];
171
+ set values(v: string[]);
172
+ connectedCallback(): void;
173
+ disconnectedCallback(): void;
174
+ protected get control(): HTMLInputElement | null;
175
+ focus(options?: FocusOptions): void;
176
+ blur(): void;
177
+ protected get changeable(): boolean;
178
+ protected formValue(): FormData | null;
179
+ protected formState(): string;
180
+ protected resetValue(): void;
181
+ protected restoreValue(state: string): void;
182
+ protected computeValidity(): {
183
+ flags: ValidityStateFlags;
184
+ message: string;
185
+ };
186
+ protected get filled(): boolean;
187
+ protected emptyValue(): false | undefined;
188
+ /** Sets the values of the field after a user action; fires `input` and `change` when they changed. */
189
+ private commit;
190
+ /**
191
+ * Asks to add each of `values`: a cancelable `add` for each value that is not in the list yet. Without slotted
192
+ * chips the field adds the values that nobody cancelled. Returns the cancelled values.
193
+ */
194
+ private addValues;
195
+ /** Adds the typed text as a tag. A cancelled `add` keeps the text in the field. */
196
+ private addTyped;
197
+ /** Asks to remove `value`: a cancelable `remove`. Without slotted chips the field removes it. */
198
+ private removeValue;
199
+ /** The last tag that is not `removed`: the value and the slotted chip. */
200
+ private get lastTag();
201
+ private onInput;
202
+ private onKeydown;
203
+ /** A pasted list adds one tag for each part. The parts with a cancelled `add` stay in the field as text. */
204
+ private onPaste;
205
+ private onFocusOut;
206
+ /** A click in the box puts the caret into the text. Chips, the clear button and the `end` slot content have their own action. */
207
+ private onBoxClick;
208
+ /** The remove button of a slotted chip: the field stops the event of the chip and fires its own `remove`. */
209
+ private onSlottedRemove;
210
+ private onTagRemove;
211
+ protected willUpdate(changed: PropertyValues): void;
212
+ render(): import("lit-html").TemplateResult<1>;
213
+ }
214
+ declare global {
215
+ interface HTMLElementTagNameMap {
216
+ "bk-input-tags": BkInputTags;
217
+ }
218
+ }
219
+ //# sourceMappingURL=bk-input-tags.d.ts.map