@bk2k/ui 0.6.7 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/BUILDING.md +88 -2
  2. package/CHANGELOG.md +193 -0
  3. package/USAGE.md +102 -33
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/chart-tokens.js +1 -1
  6. package/dist/charts/fields.d.ts +20 -0
  7. package/dist/charts/fields.js +27 -0
  8. package/dist/charts/frame.d.ts +2 -0
  9. package/dist/charts/frame.js +4 -2
  10. package/dist/clipboard.js +1 -0
  11. package/dist/components/bk-alert.js +2 -1
  12. package/dist/components/bk-avatar-group.js +4 -6
  13. package/dist/components/bk-avatar.d.ts +10 -0
  14. package/dist/components/bk-avatar.js +17 -0
  15. package/dist/components/bk-bar.js +2 -0
  16. package/dist/components/bk-button-group.js +1 -1
  17. package/dist/components/bk-button-top.js +2 -1
  18. package/dist/components/bk-button.d.ts +55 -17
  19. package/dist/components/bk-button.js +71 -24
  20. package/dist/components/bk-card.d.ts +4 -0
  21. package/dist/components/bk-card.js +15 -2
  22. package/dist/components/bk-carousel-controls.d.ts +2 -0
  23. package/dist/components/bk-carousel-controls.js +4 -2
  24. package/dist/components/bk-chart-area.d.ts +6 -0
  25. package/dist/components/bk-chart-bar.d.ts +63 -9
  26. package/dist/components/bk-chart-bar.js +152 -41
  27. package/dist/components/bk-chart-line.d.ts +13 -0
  28. package/dist/components/bk-chart-line.js +11 -1
  29. package/dist/components/bk-chip-group.d.ts +2 -2
  30. package/dist/components/bk-chip-group.js +4 -0
  31. package/dist/components/bk-chip.d.ts +53 -8
  32. package/dist/components/bk-chip.js +43 -7
  33. package/dist/components/bk-code.js +6 -2
  34. package/dist/components/bk-columns.d.ts +11 -0
  35. package/dist/components/bk-columns.js +8 -1
  36. package/dist/components/bk-combobox.d.ts +30 -6
  37. package/dist/components/bk-combobox.js +63 -20
  38. package/dist/components/bk-delta.d.ts +10 -0
  39. package/dist/components/bk-delta.js +8 -6
  40. package/dist/components/bk-dialog.d.ts +16 -6
  41. package/dist/components/bk-dialog.js +20 -8
  42. package/dist/components/bk-disclosure.js +4 -2
  43. package/dist/components/bk-drop-target.d.ts +7 -1
  44. package/dist/components/bk-drop-target.js +20 -4
  45. package/dist/components/bk-error-summary.d.ts +5 -0
  46. package/dist/components/bk-error-summary.js +13 -4
  47. package/dist/components/bk-facts-item.js +8 -6
  48. package/dist/components/bk-facts.d.ts +6 -4
  49. package/dist/components/bk-facts.js +22 -10
  50. package/dist/components/bk-footnote.d.ts +73 -0
  51. package/dist/components/bk-footnote.js +97 -0
  52. package/dist/components/bk-footnotes-item.d.ts +92 -0
  53. package/dist/components/bk-footnotes-item.js +139 -0
  54. package/dist/components/bk-footnotes.d.ts +51 -0
  55. package/dist/components/bk-footnotes.js +43 -0
  56. package/dist/components/bk-icon.js +2 -2
  57. package/dist/components/bk-image-compare.d.ts +33 -5
  58. package/dist/components/bk-image-compare.js +72 -24
  59. package/dist/components/bk-image-crop.d.ts +3 -3
  60. package/dist/components/bk-image-editor.d.ts +1 -1
  61. package/dist/components/bk-image-viewer.d.ts +107 -11
  62. package/dist/components/bk-image-viewer.js +205 -34
  63. package/dist/components/bk-input-inline.d.ts +15 -6
  64. package/dist/components/bk-input-inline.js +22 -6
  65. package/dist/components/bk-input-number.js +2 -1
  66. package/dist/components/bk-input-search.d.ts +1 -1
  67. package/dist/components/bk-input-search.js +2 -1
  68. package/dist/components/bk-input-text.d.ts +11 -0
  69. package/dist/components/bk-input-text.js +17 -3
  70. package/dist/components/bk-input-time-zone.d.ts +3 -0
  71. package/dist/components/bk-input-time.js +2 -1
  72. package/dist/components/bk-item.js +2 -1
  73. package/dist/components/bk-lightbox.d.ts +12 -3
  74. package/dist/components/bk-lightbox.js +6 -3
  75. package/dist/components/bk-link.d.ts +9 -1
  76. package/dist/components/bk-link.js +14 -4
  77. package/dist/components/bk-menu-item.d.ts +40 -0
  78. package/dist/components/bk-menu-item.js +57 -9
  79. package/dist/components/bk-menu-label.js +2 -1
  80. package/dist/components/bk-menu-list.d.ts +1 -0
  81. package/dist/components/bk-menu-list.js +10 -0
  82. package/dist/components/bk-menu.d.ts +8 -1
  83. package/dist/components/bk-menu.js +16 -5
  84. package/dist/components/bk-message-feedback.d.ts +4 -3
  85. package/dist/components/bk-message-feedback.js +7 -5
  86. package/dist/components/bk-message-list.js +2 -1
  87. package/dist/components/bk-message-source.d.ts +1 -2
  88. package/dist/components/bk-message-source.js +3 -11
  89. package/dist/components/bk-message.js +2 -0
  90. package/dist/components/bk-model-viewer.d.ts +12 -1
  91. package/dist/components/bk-model-viewer.js +15 -2
  92. package/dist/components/bk-nav-group.js +1 -1
  93. package/dist/components/bk-nav-item.d.ts +18 -0
  94. package/dist/components/bk-nav-item.js +18 -5
  95. package/dist/components/bk-nav.d.ts +1 -1
  96. package/dist/components/bk-page-cta.js +2 -0
  97. package/dist/components/bk-page-section.d.ts +1 -1
  98. package/dist/components/bk-page-section.js +3 -9
  99. package/dist/components/bk-pane.d.ts +1 -0
  100. package/dist/components/bk-pane.js +7 -5
  101. package/dist/components/bk-panel.d.ts +1 -1
  102. package/dist/components/bk-panel.js +6 -5
  103. package/dist/components/bk-period-nav.d.ts +102 -0
  104. package/dist/components/bk-period-nav.js +69 -0
  105. package/dist/components/bk-picture.d.ts +17 -4
  106. package/dist/components/bk-picture.js +8 -1
  107. package/dist/components/bk-segmented-item.d.ts +24 -4
  108. package/dist/components/bk-segmented-item.js +37 -5
  109. package/dist/components/bk-segmented.js +2 -13
  110. package/dist/components/bk-select-cascade.d.ts +1 -1
  111. package/dist/components/bk-select-tree.d.ts +1 -1
  112. package/dist/components/bk-select.d.ts +1 -1
  113. package/dist/components/bk-select.js +2 -1
  114. package/dist/components/bk-shell-app.d.ts +13 -6
  115. package/dist/components/bk-shell-app.js +47 -11
  116. package/dist/components/bk-shell-sites.d.ts +2 -1
  117. package/dist/components/bk-shell-sites.js +3 -5
  118. package/dist/components/bk-sortable.d.ts +3 -0
  119. package/dist/components/bk-sortable.js +10 -17
  120. package/dist/components/bk-split-grid.d.ts +104 -3
  121. package/dist/components/bk-split-grid.js +425 -2
  122. package/dist/components/bk-split.d.ts +3 -0
  123. package/dist/components/bk-split.js +3 -0
  124. package/dist/components/bk-stat-group.js +2 -1
  125. package/dist/components/bk-stat.d.ts +17 -0
  126. package/dist/components/bk-stat.js +7 -3
  127. package/dist/components/bk-steps.js +2 -1
  128. package/dist/components/bk-surface.d.ts +2 -0
  129. package/dist/components/bk-surface.js +6 -3
  130. package/dist/components/bk-table.d.ts +17 -13
  131. package/dist/components/bk-table.js +94 -15
  132. package/dist/components/bk-tabs-item.d.ts +45 -7
  133. package/dist/components/bk-tabs-item.js +51 -20
  134. package/dist/components/bk-tabs-panel.d.ts +6 -3
  135. package/dist/components/bk-tabs-panel.js +6 -0
  136. package/dist/components/bk-tabs.d.ts +50 -7
  137. package/dist/components/bk-tabs.js +168 -96
  138. package/dist/components/bk-text.js +2 -1
  139. package/dist/components/bk-toast-group.d.ts +3 -1
  140. package/dist/components/bk-toast-group.js +11 -1
  141. package/dist/components/bk-tooltip.d.ts +3 -1
  142. package/dist/components/bk-tooltip.js +2 -1
  143. package/dist/components/bk-video.js +2 -2
  144. package/dist/components/bk-zoom.d.ts +3 -1
  145. package/dist/components/confirm.d.ts +15 -0
  146. package/dist/components/confirm.js +27 -4
  147. package/dist/i18n/de.js +19 -1
  148. package/dist/i18n/en.d.ts +2 -0
  149. package/dist/i18n/en.js +3 -0
  150. package/dist/i18n.d.ts +23 -2
  151. package/dist/i18n.js +35 -4
  152. package/dist/icons/brands-static.d.ts +3 -0
  153. package/dist/icons/brands-static.js +5 -0
  154. package/dist/icons/core.d.ts +1 -0
  155. package/dist/icons/core.js +2 -0
  156. package/dist/icons/load-static.d.ts +3 -0
  157. package/dist/icons/load-static.js +5 -0
  158. package/dist/icons/load.js +1 -0
  159. package/dist/icons/registry.js +1 -1
  160. package/dist/icons/set/save-as.d.ts +3 -0
  161. package/dist/icons/set/save-as.js +7 -0
  162. package/dist/index.d.ts +4 -0
  163. package/dist/index.js +4 -0
  164. package/dist/internal/announcer.d.ts +8 -1
  165. package/dist/internal/announcer.js +26 -10
  166. package/dist/internal/backdrop.d.ts +19 -0
  167. package/dist/internal/backdrop.js +29 -0
  168. package/dist/internal/busy.d.ts +3 -2
  169. package/dist/internal/busy.js +4 -5
  170. package/dist/internal/choice-field.js +1 -1
  171. package/dist/internal/choice-item.d.ts +17 -6
  172. package/dist/internal/choice-item.js +20 -9
  173. package/dist/internal/cloak.d.ts +3 -0
  174. package/dist/internal/cloak.js +7 -0
  175. package/dist/internal/crop-frame.d.ts +1 -1
  176. package/dist/internal/crop-frame.js +2 -7
  177. package/dist/internal/date-field.js +2 -1
  178. package/dist/internal/drag.d.ts +11 -0
  179. package/dist/internal/drag.js +23 -0
  180. package/dist/internal/english-static.d.ts +3 -0
  181. package/dist/internal/english-static.js +5 -0
  182. package/dist/internal/english.d.ts +8 -0
  183. package/dist/internal/english.js +6 -0
  184. package/dist/internal/footnotes.d.ts +56 -0
  185. package/dist/internal/footnotes.js +143 -0
  186. package/dist/internal/handle-menu.d.ts +2 -3
  187. package/dist/internal/handle-menu.js +11 -3
  188. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  189. package/dist/internal/late/bk-shell-app.js +7 -0
  190. package/dist/internal/late/bk-table.d.ts +4 -0
  191. package/dist/internal/late/bk-table.js +17 -0
  192. package/dist/internal/late/handle-menu.d.ts +4 -0
  193. package/dist/internal/late/handle-menu.js +9 -0
  194. package/dist/internal/late/static.d.ts +7 -0
  195. package/dist/internal/late/static.js +5 -0
  196. package/dist/internal/late.d.ts +20 -0
  197. package/dist/internal/late.js +45 -0
  198. package/dist/internal/link.d.ts +2 -0
  199. package/dist/internal/link.js +11 -1
  200. package/dist/internal/own-text.d.ts +8 -0
  201. package/dist/internal/own-text.js +7 -0
  202. package/dist/internal/scope.js +1 -1
  203. package/dist/internal/scroll-lock.d.ts +4 -1
  204. package/dist/internal/scroll-lock.js +17 -4
  205. package/dist/internal/slider.js +2 -1
  206. package/dist/internal/styles.js +3 -0
  207. package/dist/internal/submit.d.ts +23 -0
  208. package/dist/internal/submit.js +57 -0
  209. package/dist/jsx.d.ts +176 -56
  210. package/dist/reset.css +10 -0
  211. package/dist/standalone/all.js +226 -221
  212. package/dist/standalone/appearance.js +1 -1
  213. package/dist/standalone/bk-accordion-item.js +4 -4
  214. package/dist/standalone/bk-accordion.js +2 -2
  215. package/dist/standalone/bk-action-bar.js +3 -3
  216. package/dist/standalone/bk-alert-offline.js +1 -2
  217. package/dist/standalone/bk-alert.js +13 -12
  218. package/dist/standalone/bk-app-state.js +1 -1
  219. package/dist/standalone/bk-attachment.js +4 -4
  220. package/dist/standalone/bk-avatar-group.js +12 -10
  221. package/dist/standalone/bk-avatar.js +14 -4
  222. package/dist/standalone/bk-badge.js +2 -2
  223. package/dist/standalone/bk-bar.js +3 -1
  224. package/dist/standalone/bk-brand.js +3 -3
  225. package/dist/standalone/bk-breadcrumbs.js +5 -5
  226. package/dist/standalone/bk-button-copy.js +5 -5
  227. package/dist/standalone/bk-button-group.js +5 -5
  228. package/dist/standalone/bk-button-share.js +5 -5
  229. package/dist/standalone/bk-button-top.js +9 -8
  230. package/dist/standalone/bk-button.js +74 -34
  231. package/dist/standalone/bk-calendar-event.js +1 -1
  232. package/dist/standalone/bk-calendar-week.js +3 -3
  233. package/dist/standalone/bk-calendar.js +4 -4
  234. package/dist/standalone/bk-card.js +20 -7
  235. package/dist/standalone/bk-carousel-controls.js +7 -6
  236. package/dist/standalone/bk-carousel-item.js +2 -2
  237. package/dist/standalone/bk-carousel.js +1 -1
  238. package/dist/standalone/bk-chart-area.js +1 -1
  239. package/dist/standalone/bk-chart-bar-list.js +8 -8
  240. package/dist/standalone/bk-chart-bar.js +253 -166
  241. package/dist/standalone/bk-chart-bridge.js +7 -7
  242. package/dist/standalone/bk-chart-bullet.js +6 -6
  243. package/dist/standalone/bk-chart-calendar.js +7 -7
  244. package/dist/standalone/bk-chart-heatmap.js +7 -7
  245. package/dist/standalone/bk-chart-histogram.js +5 -5
  246. package/dist/standalone/bk-chart-legend.js +6 -6
  247. package/dist/standalone/bk-chart-line.js +116 -103
  248. package/dist/standalone/bk-chart-mark.js +1 -1
  249. package/dist/standalone/bk-chart-scatter.js +6 -6
  250. package/dist/standalone/bk-chart-sparkline.js +6 -6
  251. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  252. package/dist/standalone/bk-chart-tracker.js +6 -6
  253. package/dist/standalone/bk-chart-waterfall.js +6 -6
  254. package/dist/standalone/bk-checkbox-group.js +4 -4
  255. package/dist/standalone/bk-checkbox.js +4 -4
  256. package/dist/standalone/bk-chip-group.js +9 -5
  257. package/dist/standalone/bk-chip.js +56 -17
  258. package/dist/standalone/bk-cluster.js +1 -1
  259. package/dist/standalone/bk-code-diff.js +4 -4
  260. package/dist/standalone/bk-code-stack.js +4 -4
  261. package/dist/standalone/bk-code.js +10 -6
  262. package/dist/standalone/bk-color-panel.js +5 -5
  263. package/dist/standalone/bk-columns.js +13 -5
  264. package/dist/standalone/bk-combobox.js +53 -33
  265. package/dist/standalone/bk-command-menu.js +6 -6
  266. package/dist/standalone/bk-command-palette.js +6 -5
  267. package/dist/standalone/bk-composer.js +6 -6
  268. package/dist/standalone/bk-delta.js +11 -10
  269. package/dist/standalone/bk-diagram.js +1 -1
  270. package/dist/standalone/bk-dialog.js +1 -1
  271. package/dist/standalone/bk-disclosure.js +7 -5
  272. package/dist/standalone/bk-divider.js +2 -2
  273. package/dist/standalone/bk-drawer.js +3 -3
  274. package/dist/standalone/bk-drop-target.js +12 -6
  275. package/dist/standalone/bk-empty-state.js +3 -3
  276. package/dist/standalone/bk-error-summary.js +9 -6
  277. package/dist/standalone/bk-facts-item.js +10 -8
  278. package/dist/standalone/bk-facts.js +28 -16
  279. package/dist/standalone/bk-feature.js +3 -3
  280. package/dist/standalone/bk-fieldset.js +3 -3
  281. package/dist/standalone/bk-filter-bar.js +4 -4
  282. package/dist/standalone/bk-folder-browser.js +4 -4
  283. package/dist/standalone/bk-footnote.js +82 -0
  284. package/dist/standalone/bk-footnotes-item.js +122 -0
  285. package/dist/standalone/bk-footnotes.js +37 -0
  286. package/dist/standalone/bk-form-guard.js +2 -2
  287. package/dist/standalone/bk-form-steps.js +3 -3
  288. package/dist/standalone/bk-grid.js +1 -1
  289. package/dist/standalone/bk-icon-tile.js +3 -3
  290. package/dist/standalone/bk-icon.js +1 -1
  291. package/dist/standalone/bk-image-compare.js +88 -47
  292. package/dist/standalone/bk-image-crop.js +6 -6
  293. package/dist/standalone/bk-image-editor.js +2 -1
  294. package/dist/standalone/bk-image-viewer.js +180 -59
  295. package/dist/standalone/bk-input-code.js +4 -4
  296. package/dist/standalone/bk-input-color.js +4 -4
  297. package/dist/standalone/bk-input-date-range.js +2 -2
  298. package/dist/standalone/bk-input-date.js +2 -2
  299. package/dist/standalone/bk-input-file.js +5 -5
  300. package/dist/standalone/bk-input-group.js +4 -4
  301. package/dist/standalone/bk-input-inline.js +17 -10
  302. package/dist/standalone/bk-input-number.js +9 -8
  303. package/dist/standalone/bk-input-rating.js +6 -6
  304. package/dist/standalone/bk-input-rich.js +1 -1
  305. package/dist/standalone/bk-input-search.js +23 -22
  306. package/dist/standalone/bk-input-slider-range.js +5 -5
  307. package/dist/standalone/bk-input-slider.js +5 -5
  308. package/dist/standalone/bk-input-text.js +1 -1
  309. package/dist/standalone/bk-input-time-zone.js +1 -1
  310. package/dist/standalone/bk-input-time.js +29 -28
  311. package/dist/standalone/bk-item-group.js +3 -3
  312. package/dist/standalone/bk-item.js +12 -11
  313. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  314. package/dist/standalone/bk-kbd.js +68 -1
  315. package/dist/standalone/bk-lightbox.js +11 -7
  316. package/dist/standalone/bk-lines.js +1 -1
  317. package/dist/standalone/bk-link.js +33 -19
  318. package/dist/standalone/bk-listbox-columns.js +6 -6
  319. package/dist/standalone/bk-listbox-item.js +1 -1
  320. package/dist/standalone/bk-listbox-search.js +7 -7
  321. package/dist/standalone/bk-listbox-transfer.js +6 -6
  322. package/dist/standalone/bk-listbox.js +7 -7
  323. package/dist/standalone/bk-logo-wall.js +2 -2
  324. package/dist/standalone/bk-logo.js +3 -3
  325. package/dist/standalone/bk-menu-bar.js +3 -3
  326. package/dist/standalone/bk-menu-context.js +1 -1
  327. package/dist/standalone/bk-menu-divider.js +2 -2
  328. package/dist/standalone/bk-menu-item.js +73 -29
  329. package/dist/standalone/bk-menu-label.js +7 -6
  330. package/dist/standalone/bk-menu-list.js +10 -4
  331. package/dist/standalone/bk-menu.js +19 -10
  332. package/dist/standalone/bk-message-approval.js +4 -4
  333. package/dist/standalone/bk-message-branches.js +3 -3
  334. package/dist/standalone/bk-message-citation.js +10 -10
  335. package/dist/standalone/bk-message-feedback.js +10 -6
  336. package/dist/standalone/bk-message-list.js +6 -5
  337. package/dist/standalone/bk-message-reasoning.js +5 -5
  338. package/dist/standalone/bk-message-source.js +13 -21
  339. package/dist/standalone/bk-message-tool-group.js +5 -5
  340. package/dist/standalone/bk-message-tool.js +5 -5
  341. package/dist/standalone/bk-message.js +6 -4
  342. package/dist/standalone/bk-meter.js +3 -3
  343. package/dist/standalone/bk-model-viewer.js +1 -1
  344. package/dist/standalone/bk-nav-divider.js +2 -2
  345. package/dist/standalone/bk-nav-group.js +6 -6
  346. package/dist/standalone/bk-nav-item.js +31 -23
  347. package/dist/standalone/bk-nav-toc.js +3 -3
  348. package/dist/standalone/bk-nav.js +3 -3
  349. package/dist/standalone/bk-overflow.js +3 -3
  350. package/dist/standalone/bk-page-cta.js +5 -3
  351. package/dist/standalone/bk-page-footer-column.js +2 -2
  352. package/dist/standalone/bk-page-footer.js +3 -3
  353. package/dist/standalone/bk-page-header.js +3 -3
  354. package/dist/standalone/bk-page-hero.js +3 -3
  355. package/dist/standalone/bk-page-pager.js +5 -5
  356. package/dist/standalone/bk-page-section.js +6 -6
  357. package/dist/standalone/bk-pagination.js +6 -6
  358. package/dist/standalone/bk-pane.js +10 -9
  359. package/dist/standalone/bk-panel.js +9 -10
  360. package/dist/standalone/bk-period-nav.js +69 -0
  361. package/dist/standalone/bk-picture.js +24 -15
  362. package/dist/standalone/bk-popover-help.js +3 -3
  363. package/dist/standalone/bk-popover.js +2 -2
  364. package/dist/standalone/bk-presence-cursor.js +2 -2
  365. package/dist/standalone/bk-preview.js +4 -4
  366. package/dist/standalone/bk-progress.js +3 -3
  367. package/dist/standalone/bk-prose.js +3 -3
  368. package/dist/standalone/bk-qr-code.js +1 -1
  369. package/dist/standalone/bk-radio-group.js +4 -4
  370. package/dist/standalone/bk-radio.js +3 -3
  371. package/dist/standalone/bk-rating.js +5 -5
  372. package/dist/standalone/bk-scroll.js +3 -3
  373. package/dist/standalone/bk-segmented-item.js +40 -16
  374. package/dist/standalone/bk-segmented.js +15 -13
  375. package/dist/standalone/bk-select-cascade.js +3 -3
  376. package/dist/standalone/bk-select-tree.js +4 -4
  377. package/dist/standalone/bk-select.js +7 -6
  378. package/dist/standalone/bk-shell-app.js +1 -1217
  379. package/dist/standalone/bk-shell-centered.js +2 -2
  380. package/dist/standalone/bk-shell-sites.js +5 -7
  381. package/dist/standalone/bk-skeleton.js +2 -2
  382. package/dist/standalone/bk-sortable.js +58 -60
  383. package/dist/standalone/bk-spinner.js +2 -2
  384. package/dist/standalone/bk-split-grid.js +318 -41
  385. package/dist/standalone/bk-split.js +9 -6
  386. package/dist/standalone/bk-stack.js +1 -1
  387. package/dist/standalone/bk-stat-group.js +8 -7
  388. package/dist/standalone/bk-stat.js +11 -8
  389. package/dist/standalone/bk-status-dot.js +3 -3
  390. package/dist/standalone/bk-steps-item.js +5 -5
  391. package/dist/standalone/bk-steps.js +8 -7
  392. package/dist/standalone/bk-surface.js +1 -1
  393. package/dist/standalone/bk-swatch-group.js +4 -4
  394. package/dist/standalone/bk-swatch-palette.js +1 -1
  395. package/dist/standalone/bk-swatch.js +2 -2
  396. package/dist/standalone/bk-switch.js +4 -4
  397. package/dist/standalone/bk-table.js +1 -1887
  398. package/dist/standalone/bk-tabs-item.js +58 -35
  399. package/dist/standalone/bk-tabs-panel.js +7 -3
  400. package/dist/standalone/bk-tabs.js +160 -98
  401. package/dist/standalone/bk-tasks-item.js +4 -4
  402. package/dist/standalone/bk-tasks.js +2 -2
  403. package/dist/standalone/bk-testimonial.js +3 -3
  404. package/dist/standalone/bk-text.js +19 -18
  405. package/dist/standalone/bk-time-countdown.js +4 -4
  406. package/dist/standalone/bk-time-relative.js +3 -3
  407. package/dist/standalone/bk-timeline-item.js +4 -4
  408. package/dist/standalone/bk-timeline.js +2 -2
  409. package/dist/standalone/bk-toast-group.js +1 -1
  410. package/dist/standalone/bk-toast.js +4 -4
  411. package/dist/standalone/bk-toolbar.js +2 -2
  412. package/dist/standalone/bk-tooltip.js +8 -7
  413. package/dist/standalone/bk-tree-item.js +6 -6
  414. package/dist/standalone/bk-tree.js +3 -3
  415. package/dist/standalone/bk-video.js +6 -6
  416. package/dist/standalone/bk-visually-hidden.js +2 -2
  417. package/dist/standalone/bk-zoom.js +5 -5
  418. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  419. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  420. package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  421. package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-Biz7t8sL.js} +4 -4
  422. package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-D_fQf6SF.js} +5 -5
  423. package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DwZyUUHh.js} +65 -27
  424. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  425. package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-BADsoLRL.js} +5 -5
  426. package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  427. package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-CFhW6vRa.js} +6 -6
  428. package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DviyLBqj.js} +63 -54
  429. package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-w_Ah4Tvs.js} +22 -8
  430. package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-CYMovNVl.js} +3 -3
  431. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  432. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  433. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  434. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  435. package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-CoL6W7uk.js} +27 -24
  436. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  437. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  438. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  439. package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-poOTerh1.js} +6 -6
  440. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  441. package/dist/standalone/chunks/clipboard-RqIeP9Uz.js +29 -0
  442. package/dist/standalone/chunks/clipboard-UVLSkL4C.js +34 -0
  443. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  444. package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-B-fCXa2D.js} +48 -47
  445. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  446. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  447. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  448. package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CHpfKAKa.js} +2 -2
  449. package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-xIMVEUCi.js} +7 -4
  450. package/dist/standalone/chunks/handle-menu-BgYUbGO2.js +56 -0
  451. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  452. package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-DFfGgd3d.js} +56 -34
  453. package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-DQAcbHkY.js} +1 -1
  454. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  455. package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-pOUDNUf1.js} +2 -2
  456. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  457. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  458. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  459. package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-hxo-Vh6E.js} +2 -2
  460. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  461. package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-CGDOcqBZ.js} +1 -1
  462. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  463. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  464. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  465. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  466. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  467. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  468. package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-W5s0TFqV.js} +1 -1
  469. package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-CqhJSAwZ.js} +4 -4
  470. package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-lvZbQtGW.js} +2 -2
  471. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  472. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  473. package/dist/standalone/confirm.js +27 -14
  474. package/dist/standalone/i18n-de.js +20 -2
  475. package/dist/standalone/icons.js +100 -98
  476. package/dist/standalone/links.js +1 -1
  477. package/dist/standalone/reset.css +10 -0
  478. package/dist/standalone/toast.js +1 -1
  479. package/dist/standalone/tokens.css +9 -5
  480. package/dist/tokens.css +9 -5
  481. package/dist/tokens.js +4 -3
  482. package/package.json +25 -2
  483. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  484. package/dist/standalone/chunks/bk-kbd-B7bz8hmV.js +0 -275
  485. package/dist/standalone/chunks/clipboard-DBGdJ-1S.js +0 -61
  486. package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
  487. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -1,1218 +1,2 @@
1
- import { a as e, d as t, n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js";
2
- import { t as a } from "./chunks/if-defined-z_20pBRr.js";
3
- import { t as o } from "./chunks/style-map-BMvn17E7.js";
4
- import { c as s } from "./chunks/anchor-CNX3nt2F.js";
5
- import { n as c, r as l, t as u } from "./chunks/define-CzVPD4Zi.js";
6
- import { t as d } from "./chunks/link-CWSMsx04.js";
7
- import { t as f } from "./chunks/i18n-CNsBRNPu.js";
8
- import { n as p, r as m } from "./chunks/events-DQ4e9cPN.js";
9
- import { n as h, r as g, t as _ } from "./chunks/handle-menu-DsxWvv4D.js";
10
- import { t as v } from "./chunks/state-XYmTmnOw.js";
11
- import { f as y, m as b } from "./chunks/bk-kbd-B7bz8hmV.js";
12
- import { a as x, d as S, t as C, v as w } from "./chunks/styles-DwSR-9a3.js";
13
- import "./bk-drawer.js";
14
- import "./chunks/bk-icon-DssFsNuB.js";
15
- import "./bk-button.js";
16
1
  import "./bk-nav-item.js";
17
- import "./chunks/close-CcDDKPf9.js";
18
- import "./chunks/menu-BTWBQt5u.js";
19
- import "./chunks/search-Cm9mOqRy.js";
20
- import "./chunks/sidebar-collapse-uvu3jE3r.js";
21
- import "./chunks/sidebar-expand-QkDkPjTV.js";
22
- // dist/components/bk-shell-app.js
23
- var T = ToggleEvent, E = class extends T {
24
- region;
25
- constructor(e, t) {
26
- super("toggle", {
27
- oldState: t ? "closed" : "open",
28
- newState: t ? "open" : "closed"
29
- }), this.region = e;
30
- }
31
- get detail() {
32
- return { region: this.region };
33
- }
34
- }, D = [
35
- "sidebar-header",
36
- "nav",
37
- "sidebar",
38
- "sidebar-footer",
39
- "drawer"
40
- ], O = [
41
- "sidebar-header",
42
- "sidebar",
43
- "sidebar-footer"
44
- ], k = /* @__PURE__ */ new Set([
45
- "bk-pane",
46
- "bk-split",
47
- "bk-columns"
48
- ]), A = /* @__PURE__ */ new Set(["bk-page-section", "bk-page-hero"]), j = /* @__PURE__ */ new Set([
49
- "style",
50
- "script",
51
- "template",
52
- "link",
53
- "meta"
54
- ]), M = "bk-input-search, bk-input-text[type=\"search\"], bk-combobox[type=\"search\"], [data-header-search]", N = "var(--bk-height-header, calc(var(--bk-control-md) + var(--bk-space-5)))", P = `var(--bk-height-header-nav, ${N})`, F = ["header", "header-end"], I = "bk-input-search, bk-input-text, bk-combobox, input", L = "header-search", R = class extends r {
55
- static properties = {
56
- sidebarCollapsed: {
57
- type: Boolean,
58
- reflect: !0,
59
- attribute: "sidebar-collapsed"
60
- },
61
- persistKey: { attribute: "persist-key" },
62
- breakpoint: { type: Number },
63
- asideBreakpoint: {
64
- type: Number,
65
- attribute: "aside-breakpoint"
66
- },
67
- asideOpen: {
68
- type: Boolean,
69
- reflect: !0,
70
- attribute: "aside-open"
71
- },
72
- asideResizable: {
73
- type: Boolean,
74
- reflect: !0,
75
- attribute: "aside-resizable"
76
- },
77
- asideWidth: {
78
- type: Number,
79
- attribute: "aside-width"
80
- },
81
- navigationOpen: {
82
- type: Boolean,
83
- reflect: !0,
84
- attribute: "navigation-open"
85
- },
86
- narrow: {
87
- type: Boolean,
88
- attribute: !1
89
- },
90
- workspace: {
91
- type: Boolean,
92
- attribute: !1
93
- },
94
- asideOverlay: {
95
- type: Boolean,
96
- attribute: !1
97
- },
98
- skipLabel: { attribute: "skip-label" },
99
- asideLabel: { attribute: "aside-label" },
100
- asideResizeLabel: { attribute: "aside-resize-label" },
101
- navPlacement: {
102
- attribute: "nav-placement",
103
- reflect: !0,
104
- useDefault: !0
105
- },
106
- transitions: {
107
- type: Boolean,
108
- reflect: !0
109
- },
110
- searchOpen: {
111
- type: Boolean,
112
- reflect: !0,
113
- attribute: "search-open"
114
- },
115
- searchShortcut: { attribute: "search-shortcut" },
116
- snapTitle: { state: !0 },
117
- snapCollapsed: { state: !0 },
118
- asideDrawerOpen: { state: !0 },
119
- statusbarHeight: { state: !0 },
120
- asideMoves: { state: !0 },
121
- bottomNavHeight: { state: !0 }
122
- };
123
- get sections() {
124
- return this.internals.states.has("sections");
125
- }
126
- internals = this.attachInternals();
127
- pressAt = {
128
- x: 0,
129
- y: 0
130
- };
131
- paddingSheet;
132
- i18n = new f(this);
133
- links = new d(this);
134
- used = /* @__PURE__ */ new Set();
135
- authored;
136
- fromState = /* @__PURE__ */ new Set();
137
- persisted = {
138
- sidebarCollapsed: this.persistedFlag("sidebarCollapsed", ""),
139
- asideOpen: this.persistedFlag("asideOpen", ".aside")
140
- };
141
- authoredWidth;
142
- storedWidth = new v(this, () => this.persistKey && `app-shell:${this.persistKey}.aside-width`, { onChange: (e) => {
143
- this.authoredWidth ??= this.asideWidth ?? null, this.asideWidth = typeof e == "number" ? e : this.authoredWidth ?? void 0;
144
- } });
145
- draggingAside = !1;
146
- resizeObserver;
147
- children$ = l(() => this.requestUpdate());
148
- asideTriggers = [];
149
- sidebarTriggers = [];
150
- persistedFlag(e, t) {
151
- return new v(this, () => this.persistKey && `app-shell:${this.persistKey}${t}`, { onChange: (t) => {
152
- this.authored ??= {
153
- sidebarCollapsed: this.sidebarCollapsed,
154
- asideOpen: this.asideOpen
155
- };
156
- let n = typeof t == "boolean" ? t : this.authored[e];
157
- n !== this[e] && this.fromState.add(e), this[e] = n;
158
- } });
159
- }
160
- constructor() {
161
- super(), this.sidebarCollapsed = !1, this.breakpoint = 900, this.asideBreakpoint = 1200, this.asideOpen = !1, this.asideResizable = !1, this.navigationOpen = !1, this.narrow = !1, this.asideOverlay = !1, this.workspace = !1, this.asideDrawerOpen = !1, this.transitions = !1, this.searchOpen = !1, this.searchShortcut = "Mod+K", this.snapTitle = "", this.snapCollapsed = !1, this.statusbarHeight = 0, this.bottomNavHeight = 0, this.asideMoves = [], this.navPlacement = "top", this.addEventListener("click", this.onHostClick), this.addEventListener("toggle", this.onPageToggle, !0);
162
- }
163
- onPageToggle = (e) => {
164
- let t = e.target;
165
- t?.localName === "bk-page-header" && t.hasAttribute("snap") && (this.snapCollapsed = e.newState === "closed");
166
- };
167
- connectedCallback() {
168
- super.connectedCallback(), this.children$.observe(this, {
169
- childList: !0,
170
- attributes: !0,
171
- attributeFilter: ["slot"]
172
- }), typeof ResizeObserver < "u" && (this.resizeObserver ??= new ResizeObserver(this.onResize), this.resizeObserver.observe(this), this.hasUpdated && this.observeStatusbar()), this.hasUpdated && (this.observeNav(), this.syncScrollPadding(), this.bindSearchShortcut());
173
- }
174
- disconnectedCallback() {
175
- super.disconnectedCallback(), this.children$.disconnect(), this.headerContent.disconnect(), this.watched = [], this.bottomItems.disconnect(), this.resizeObserver?.disconnect(), cancelAnimationFrame(this.fitFrame), this.bindSearchShortcut(), this.paddingSheet && (document.adoptedStyleSheets = document.adoptedStyleSheets.filter((e) => e !== this.paddingSheet));
176
- }
177
- headerHeight() {
178
- return this.narrow ? `var(--bk-height-header-narrow, ${N})` : this.navRow ? `calc(${N} + ${P})` : N;
179
- }
180
- syncScrollPadding() {
181
- if (!this.isConnected) return;
182
- let e = this.paddingSheet ??= new CSSStyleSheet();
183
- document.adoptedStyleSheets.includes(e) || (document.adoptedStyleSheets = [...document.adoptedStyleSheets, e]);
184
- let t = this.showHeader ? `scroll-padding-top: calc(${this.headerHeight()} + var(--bk-safe-top));` : "", n = this.statusbarHeight + this.bottomNavHeight;
185
- e.replaceSync(`:root { ${t} ${n ? `scroll-padding-bottom: ${n}px;` : ""} }`);
186
- }
187
- static styles = [
188
- C,
189
- x,
190
- S,
191
- w,
192
- h,
193
- i`
194
- :host {
195
- font-weight: var(--bk-weight-body, var(--bk-weight-regular)); font-feature-settings: var(--bk-features, normal);
196
- --_bk-shell-app-vh: var(--bk-app-viewport-height); /* the screen the shell fills: the viewport, or a frame that sets the token */
197
- /* The defaults of the optional app tokens. The shell sets no public token: a value of the app (in :root, on a scope
198
- root or on the shell) reaches it through inheritance. */
199
- --_bk-shell-app-header-height: ${t(N)};
200
- --_bk-shell-app-bar-font-size: var(--bk-app-bar-font-size, var(--bk-type-small));
201
- --_bk-shell-app-region-padding: var(--bk-app-region-padding, var(--bk-space-4));
202
- --_bk-shell-app-header-gap: var(--bk-app-header-gap, var(--bk-space-3));
203
- --_bk-shell-app-header-end-gap: var(--bk-app-header-end-gap, var(--bk-space-cluster));
204
- --_bk-shell-app-nav-offset: var(--bk-app-nav-offset, var(--bk-space-4));
205
- --_bk-shell-app-bar-padding-block: var(--bk-app-bar-padding-block, var(--bk-space-2));
206
- --_bk-shell-app-statusbar-padding-inline: var(--bk-app-statusbar-padding-inline, var(--_bk-shell-app-region-padding));
207
- --_bk-shell-app-statusbar-gap: var(--bk-app-statusbar-gap, var(--bk-space-4));
208
- --_bk-shell-app-footer-padding-block: var(--bk-app-footer-padding-block, var(--bk-space-4));
209
- --_bk-shell-app-drawer-width: var(--bk-app-drawer-width, calc(var(--bk-width-sidebar) + var(--bk-space-8)));
210
- --_bk-shell-app-drawer-gap: var(--bk-app-drawer-gap, var(--bk-space-4));
211
- --_bk-shell-app-aside-padding: var(--bk-app-aside-padding, var(--bk-space-5));
212
- --_bk-shell-app-aside-min: var(--bk-app-aside-min, 240px);
213
- --_bk-shell-app-aside-max: var(--bk-app-aside-max, 640px);
214
- --_bk-shell-app-page-padding-block-start: var(--bk-app-page-padding-block-start, var(--bk-space-8));
215
- --_bk-shell-app-page-padding-block-end: var(--bk-app-page-padding-block-end, var(--bk-space-8));
216
- --_bk-shell-app-page-padding-inline: var(--bk-app-page-padding-inline, var(--bk-space-8));
217
- --_bk-shell-app-page-padding-narrow: var(--bk-app-page-padding-narrow, var(--bk-space-4));
218
- --_bk-shell-app-page-gap: var(--bk-app-page-gap, var(--bk-space-components));
219
- --_bk-shell-app-bg: var(--bk-app-bg, var(--bk-layer-base-bg));
220
- --_bk-shell-app-header-border: var(--bk-app-header-border, var(--bk-line));
221
- --_bk-shell-app-sidebar-border: var(--bk-app-sidebar-border, var(--bk-line));
222
- --_bk-shell-app-statusbar-border: var(--bk-app-statusbar-border, var(--bk-line));
223
- --_bk-shell-app-hh: var(--_bk-shell-app-header-height);
224
- --_bk-shell-app-pad: var(--_bk-shell-app-region-padding);
225
- --_bk-shell-app-main-start: var(--_bk-shell-app-page-padding-block-start);
226
- --_bk-shell-app-main-end: var(--_bk-shell-app-page-padding-block-end);
227
- --_bk-shell-app-main-inline: var(--_bk-shell-app-page-padding-inline);
228
- /* Beside a sidebar with a line, the page padding starts at the line, as on the other side at the window edge. */
229
- --_bk-shell-app-main-inline-start: var(--_bk-shell-app-main-inline);
230
- /* Block padding of the brand rows: a control-high first row sits centred in the header band, however many rows follow. */
231
- --_bk-shell-app-band-pad: max(0px, calc((var(--_bk-shell-app-hh) - var(--bk-control-md)) / 2));
232
- /* Rail icons sit exactly where they sit in the expanded nav, under the toggle button */
233
- --_bk-shell-app-sw-rail: var(--bk-app-rail-width,
234
- calc(2 * (var(--_bk-shell-app-pad) + var(--bk-nav-item-padding, var(--bk-row-pad-inline))) + var(--bk-nav-item-icon-size, var(--bk-icon-sm))));
235
- /* The box in the rail that icons and marks are centred in. It is fixed, so they don't move while the sidebar changes width. */
236
- --_bk-shell-app-rail-box: calc(var(--_bk-shell-app-sw-rail) - 2 * var(--_bk-shell-app-pad));
237
- --_bk-shell-app-sw: calc(var(--bk-width-sidebar) + var(--bk-safe-start));
238
- display: block; min-height: var(--_bk-shell-app-vh);
239
- background: var(--_bk-shell-app-bg); color: var(--bk-text);
240
- }
241
- :host([sidebar-collapsed]:not(:state(narrow))) { --_bk-shell-app-sw: calc(var(--_bk-shell-app-sw-rail) + var(--bk-safe-start)); }
242
- :host(:state(narrow)) {
243
- --_bk-shell-app-main-start: var(--_bk-shell-app-page-padding-narrow); --_bk-shell-app-main-end: var(--_bk-shell-app-page-padding-narrow); --_bk-shell-app-main-inline: var(--_bk-shell-app-page-padding-narrow);
244
- --_bk-shell-app-main-inline-start: var(--_bk-shell-app-main-inline);
245
- --_bk-shell-app-pad: var(--bk-app-region-padding-narrow, var(--_bk-shell-app-region-padding));
246
- --_bk-shell-app-hh: var(--bk-height-header-narrow, var(--_bk-shell-app-header-height));
247
- }
248
- .shell { display: contents; }
249
-
250
- .skip {
251
- position: absolute; z-index: calc(var(--bk-z-sticky) + 1); inset-inline-start: var(--bk-space-2); top: var(--bk-space-2);
252
- padding: var(--bk-space-2) var(--bk-space-3); border-radius: var(--bk-radius-md);
253
- background: var(--bk-accent-solid); color: var(--bk-on-accent); box-shadow: var(--bk-layer-overlay-shadow);
254
- font-size: var(--bk-text-sm); font-weight: var(--bk-weight-medium); text-decoration: none;
255
- opacity: 0; pointer-events: none; translate: 0 calc(-100% - var(--bk-space-4));
256
- transition: translate var(--bk-duration-fast) var(--bk-ease), opacity var(--bk-duration-fast);
257
- }
258
- .skip:focus { opacity: 1; pointer-events: auto; translate: 0 0; outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset); }
259
-
260
- /* The banner element brings its own look (bk-alert banner); the shell only places it. */
261
- .banner { display: block; }
262
-
263
- /* Regions: all on the app background, a line between neighbours. */
264
- .header {
265
- position: sticky; top: 0; z-index: var(--bk-z-sticky); height: calc(var(--_bk-shell-app-hh) + var(--bk-safe-top));
266
- /* The header draws its background under the notch and pads its content clear of it. */
267
- padding-block-start: var(--bk-safe-top);
268
- background: var(--bk-app-header-bg, var(--_bk-shell-app-bg));
269
- backdrop-filter: var(--bk-app-header-backdrop, none); -webkit-backdrop-filter: var(--bk-app-header-backdrop, none);
270
- border-block-end: var(--bk-border-width) solid var(--_bk-shell-app-header-border);
271
- box-shadow: var(--bk-app-header-shadow, none);
272
- }
273
- .header-inner {
274
- display: flex; align-items: center; gap: var(--_bk-shell-app-header-gap); height: 100%;
275
- max-width: var(--bk-app-frame-width); margin-inline: auto;
276
- --_bk-shell-header-pad: var(--_bk-shell-app-pad);
277
- }
278
- /* --bk-app-header-width: the content keeps that width in the middle, in line with the page sections.
279
- Not with a sidebar: there the header lines up with the sidebar at the start. */
280
- .header-inner.page-width { --_bk-shell-header-pad: max(var(--_bk-shell-app-pad), calc((100% - var(--bk-app-header-width, 100%)) / 2)); }
281
- /* In an installed app whose window controls sit over the page (window controls overlay: a PWA,
282
- Electron's titleBarOverlay) the header is the title bar: it drags the window, is as tall as the
283
- title bar area at least, and keeps clear of the controls. Elsewhere the env() values are unset,
284
- so nothing changes. What sits in the header stays clickable. */
285
- .header {
286
- -webkit-app-region: drag; app-region: drag;
287
- height: calc(max(var(--_bk-shell-app-hh), env(titlebar-area-height, 0px)) + var(--_bk-shell-app-nav-row, 0px) + var(--bk-safe-top));
288
- }
289
- .header-inner, .nav-row {
290
- padding-inline-start: max(var(--_bk-shell-header-pad), env(titlebar-area-x, 0px), var(--bk-safe-start));
291
- padding-inline-end: max(var(--_bk-shell-header-pad), calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw)), var(--bk-safe-end));
292
- }
293
- /* nav-placement="below": the nav is a second row of the header (--bk-height-header-nav, unset as high as the header band), in the width of the first row.
294
- The line of the header is under the second row: the nav and the underline of its current item sit as in a header of one row. */
295
- .header.has-row .header-inner { height: calc(100% - var(--_bk-shell-app-nav-row) + var(--bk-border-width)); }
296
- .nav-row {
297
- display: flex; align-items: center; height: calc(var(--_bk-shell-app-nav-row) - var(--bk-border-width));
298
- max-width: var(--bk-app-frame-width); margin-inline: auto;
299
- --_bk-shell-header-pad: var(--_bk-shell-app-pad);
300
- /* The underline of the current item stays on the line of the header, also in a row of another height (--bk-height-header-nav). */
301
- --_bk-nav-indicator-offset: calc(var(--bk-space-3) + (var(--_bk-shell-app-nav-row) - var(--_bk-shell-app-header-height)) / 2);
302
- }
303
- .nav-row.page-width { --_bk-shell-header-pad: max(var(--_bk-shell-app-pad), calc((100% - var(--bk-app-header-width, 100%)) / 2)); }
304
- .nav-row ::slotted(*) { -webkit-app-region: no-drag; app-region: no-drag; }
305
- /* The heading of a collapsed page header (snap): the shell keeps its room, so nothing moves when it fades in. It gives way first. */
306
- .title {
307
- flex: 0 100 auto; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; user-select: none;
308
- font-size: var(--bk-type-body); font-weight: var(--bk-weight-semibold); color: var(--bk-text);
309
- opacity: 0; transition: opacity var(--bk-duration) var(--bk-ease);
310
- }
311
- .title.shown { opacity: 1; }
312
- /* A search field in the header takes the width of a panel and gives way down to the minimum measure. */
313
- :is(.header-start, .header-end) ::slotted(:is(bk-input-search, bk-input-text[type="search"], bk-combobox[type="search"], [data-header-search])) { flex: 0 1 var(--bk-width-panel); min-inline-size: var(--bk-measure-min); }
314
- /* A search at the end of the header: on a wide screen the end region gives way first (the field gets narrower),
315
- and the start region keeps its content. */
316
- :host(:not(:state(narrow))) .header-end.search { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
317
- :host(:not(:state(narrow))) .header-end.search ::slotted(:not(bk-input-search, bk-input-text[type="search"], bk-combobox[type="search"], [data-header-search])) { flex-shrink: 0; }
318
- :host(:not(:state(narrow))) .header.end-search .header-start { flex: 0 0 auto; }
319
- /* While the shell measures the header (class fit), the content of the start region keeps its width: a brand is cut
320
- only when no item can give way any more. */
321
- .header-inner.fit .header-start ::slotted(:not(bk-input-search, bk-input-text[type="search"], bk-combobox[type="search"], [data-header-search])) { flex-shrink: 0; }
322
- /* Search in the header: a narrow header swaps the field for an icon; the open search takes the whole row. */
323
- :host(:state(narrow)) .search ::slotted([data-header-search]) { display: none; }
324
- :host(:state(narrow)[search-open]) .search ::slotted([data-header-search]) { display: block; flex: 1 1 auto; min-inline-size: 0; }
325
- :host(:state(narrow)[search-open]) .search ::slotted(:not([data-header-search])), :host([search-open]) .title,
326
- :host([search-open]) .toggle, :host([search-open]) .nav, :host([search-open]) :is(.header-start, .header-end):not(.search) { display: none; }
327
- :host([search-open]) .header-end.search { flex: 1 1 auto; min-width: 0; }
328
- .search-toggle, .search-cancel { flex: none; }
329
- .search-scopes {
330
- position: absolute; inset-inline: 0; inset-block-start: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--bk-space-cluster);
331
- padding: var(--bk-space-2) max(var(--_bk-shell-app-pad), var(--bk-safe-start)) var(--bk-space-2) max(var(--_bk-shell-app-pad), var(--bk-safe-end));
332
- background: var(--bk-app-header-bg, var(--_bk-shell-app-bg)); border-block-end: var(--bk-border-width) solid var(--_bk-shell-app-header-border);
333
- }
334
- .header-inner ::slotted(*), .header-inner button { -webkit-app-region: no-drag; app-region: no-drag; }
335
- .header-start { display: flex; align-items: center; gap: var(--_bk-shell-app-header-gap); min-width: 0; flex: 1; }
336
- /* Beside a nav the start region keeps its content, but a search field gives way down to its minimum. The nav keeps
337
- its width: the header measures what does not fit and moves the nav into the drawer, before a brand is cut. */
338
- .header.has-nav .header-start { flex: 0 1 auto; }
339
- .header.has-nav .header-start ::slotted(:not(bk-input-search, bk-input-text[type="search"], bk-combobox[type="search"], [data-header-search])) { flex-shrink: 0; }
340
- .nav { display: flex; align-items: center; flex: 1 0 auto; min-width: 0; margin-inline-start: var(--_bk-shell-app-nav-offset); }
341
- /* The first label of the row stands on the edge of the brand: the row gives back the inner padding of the items. */
342
- .nav-row .nav { flex: 1 1 auto; margin-inline-start: calc(-1 * var(--bk-nav-horizontal-item-padding, var(--bk-space-3))); }
343
- /* --bk-app-nav-align: center (the state nav-center): the outer regions have the same width, so the nav stands in the middle. */
344
- :host(:state(nav-center)) .header.has-nav .header-start, :host(:state(nav-center)) .header.has-nav .header-end { flex: 1 1 0; min-width: 0; }
345
- :host(:state(nav-center)) .header.has-nav .header-end { justify-content: flex-end; }
346
- :host(:state(nav-center)) .header.has-nav .header-end ::slotted(*) { flex-shrink: 0; }
347
- :host(:state(nav-center)) .header.has-nav .nav { flex: none; margin-inline-start: 0; }
348
- /* Without header-end content an empty track of the same width keeps the nav in the middle. */
349
- :host(:state(nav-center)) .header.has-nav .header-inner.no-end::after { content: ""; flex: 1 1 0; }
350
- :host(:state(nav-center)) .nav-row .nav { justify-content: safe center; }
351
- .header-end { display: flex; align-items: center; gap: var(--_bk-shell-app-header-end-gap); flex: none; }
352
- .toggle { flex: none; }
353
-
354
- .body {
355
- display: grid; grid-template-columns: var(--_bk-shell-app-sw) minmax(0, 1fr) auto; align-items: start;
356
- max-width: var(--bk-app-frame-width); width: 100%; margin-inline: auto;
357
- /* The screen without header and status bar: what sidebar and aside fill, and the least the content takes. */
358
- --_bk-shell-app-area: calc(var(--_bk-shell-app-vh) - var(--_bk-shell-app-top) - var(--_bk-shell-app-bottom));
359
- transition: grid-template-columns var(--bk-duration) var(--bk-ease);
360
- }
361
- /* Without a sidebar the body runs edge to edge: sections and the page width hold the content. */
362
- .body.no-sidebar { grid-template-columns: minmax(0, 1fr) auto; max-width: none; --_bk-shell-app-main-inline-start: var(--_bk-shell-app-main-inline); }
363
-
364
- .sidebar, .aside, .aside-resize {
365
- position: sticky; top: var(--_bk-shell-app-top); height: var(--_bk-shell-app-area);
366
- overflow-x: hidden; overscroll-behavior: contain;
367
- }
368
- /* A brand lines up with the nav below it: the mark sits over the icons. */
369
- .sidebar, bk-drawer.start {
370
- --bk-nav-rail-size: var(--_bk-shell-app-rail-box);
371
- --bk-brand-mark-box: var(--_bk-shell-app-rail-box);
372
- }
373
- .sidebar {
374
- display: flex; flex-direction: column; background: var(--bk-app-sidebar-bg); padding-inline-start: var(--bk-safe-start);
375
- border-inline-end: var(--bk-border-width) solid var(--_bk-shell-app-sidebar-border);
376
- }
377
- .sidebar-header { flex: none; display: flex; align-items: center; min-height: var(--_bk-shell-app-hh); padding: var(--_bk-shell-app-band-pad) var(--_bk-shell-app-pad); }
378
- .sidebar-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding: var(--_bk-shell-app-pad); display: flex; flex-direction: column; }
379
- /* Expanded, the scroll bar's room is always kept and taken from the end padding: the items don't move when the list
380
- starts to scroll, and stand as far from the sidebar's end as from its start. (--_bk-shell-app-sbw is measured.) */
381
- :host(:not([sidebar-collapsed])) .sidebar-scroll, :host(:state(narrow)) .sidebar-scroll {
382
- scrollbar-gutter: stable; padding-inline-end: max(0px, calc(var(--_bk-shell-app-pad) - var(--_bk-shell-app-sbw, 0px)));
383
- }
384
- /* It stands in the gutter beside the page, so it shows while the pointer or the focus is in the sidebar. */
385
- @media (hover: hover) {
386
- :host(:not([sidebar-collapsed])) .sidebar-scroll:not(:hover):not(:focus-within) { scrollbar-color: transparent transparent; }
387
- }
388
- .sidebar-header:not([hidden]) + .sidebar-scroll { padding-top: 0; }
389
- .sidebar-footer { flex: none; padding: var(--_bk-shell-app-bar-padding-block) var(--_bk-shell-app-pad); border-block-start: var(--bk-border-width) solid var(--_bk-shell-app-sidebar-border); }
390
- .sidebar-toggle { flex: none; display: flex; padding: var(--_bk-shell-app-bar-padding-block) var(--_bk-shell-app-pad); }
391
- /* The own toggle is one more row of the footer: the gap of the nav items above it, no pad between them. */
392
- .sidebar-footer.joined { padding-block-end: 0; }
393
- .sidebar-footer:not([hidden]) + .sidebar-toggle { padding-block-start: var(--bk-nav-gap, var(--bk-row-spacing)); }
394
- .sidebar-footer ::slotted(bk-button[data-sidebar-toggle]) { margin-block-start: var(--_bk-shell-app-bar-padding-block); }
395
- .sidebar-toggle-button { flex: 1; min-width: 0; }
396
- :host([sidebar-collapsed]) .sidebar-toggle-button { flex: none; inline-size: var(--_bk-shell-app-rail-box); }
397
-
398
- .aside {
399
- width: calc(var(--_bk-shell-app-aw) + var(--bk-safe-end)); overflow-y: auto; padding: var(--_bk-shell-app-aside-padding); padding-inline-end: calc(var(--_bk-shell-app-aside-padding) + var(--bk-safe-end));
400
- background: var(--bk-app-aside-bg, var(--_bk-shell-app-bg));
401
- border-inline-start: var(--bk-border-width) solid var(--bk-app-aside-border, var(--bk-line));
402
- }
403
- :host([aside-resizable]) .aside { min-width: var(--_bk-shell-app-aside-min); max-width: var(--_bk-shell-app-aside-max); }
404
- /* The aside and its drag edge share the last column; the edge sits on the line, over the aside. */
405
- .aside, .aside-resize { grid-row: 1; grid-column: -2 / -1; }
406
- .aside-resize {
407
- z-index: 1; justify-self: start; width: var(--bk-space-2); translate: -50% 0;
408
- overflow: visible; cursor: col-resize; touch-action: none; outline: none;
409
- }
410
- .aside-resize:dir(rtl) { translate: 50% 0; }
411
- /* The line lights up over the aside's border: after a short delay on hover, at once while dragging or focused. */
412
- .aside-resize::after {
413
- content: ""; position: absolute; inset-block: 0; left: 50%; width: var(--bk-border-width); translate: -50% 0;
414
- transition: background-color var(--bk-duration-fast) var(--bk-ease), width var(--bk-duration-fast) var(--bk-ease);
415
- }
416
- @media (hover: hover) {
417
- .aside-resize:hover::after { transition-delay: 150ms; background: var(--bk-accent-solid); width: calc(3 * var(--bk-border-width)); }
418
- }
419
- .aside-resize:focus-visible::after, :host([resizing]) .aside-resize::after { background: var(--bk-accent-solid); width: calc(3 * var(--bk-border-width)); }
420
- :host([resizing]) { cursor: col-resize; user-select: none; -webkit-user-select: none; }
421
- :host([resizing]) ::slotted(*) { pointer-events: none; }
422
-
423
- /* Flat by default; an app that sets its work area apart (the backend of a CMS) gives it a background and a corner. */
424
- .content {
425
- min-width: 0; min-height: var(--_bk-shell-app-area); display: flex; flex-direction: column;
426
- background: var(--bk-app-content-bg, transparent); border-start-start-radius: var(--bk-app-content-radius, 0px);
427
- }
428
- main { flex: 1; padding: var(--_bk-shell-app-main-start) var(--_bk-shell-app-main-inline) var(--_bk-shell-app-main-end); padding-inline-start: var(--_bk-shell-app-main-inline-start); scroll-margin-top: var(--bk-shell-app-sticky-top); outline: none; min-width: 0; }
429
- .main-inner { max-width: var(--bk-width-page); margin-inline: auto; }
430
- /* Where the page touches a screen edge it keeps clear of the notch (landscape) and the home bar. */
431
- .body:not(.has-aside) main { padding-inline-end: max(var(--_bk-shell-app-main-inline), var(--bk-safe-end)); }
432
- .body.no-header { padding-block-start: var(--bk-safe-top); }
433
- .body.no-sidebar main { padding-inline-start: max(var(--_bk-shell-app-main-inline-start), var(--bk-safe-start)); }
434
- .content.edge { padding-block-end: var(--bk-safe-bottom); }
435
- :host([transitions]) main { view-transition-name: bk-content; }
436
- /* The page's own stack separates page parts (header, toolbar, cards) as components; stacks inside it keep the flow. */
437
- :host(:not(:state(workspace))) .main-inner ::slotted(bk-stack) { gap: var(--_bk-shell-app-page-gap); }
438
- /* A page of sections: each section runs edge to edge and holds its content in its width, with the
439
- page padding beside it (like the footer). <main> adds no padding and no page width. */
440
- :host(:state(sections)) main { padding: 0; }
441
- :host(:state(sections)) .main-inner { max-width: none; }
442
- :host(:state(sections)) .main-inner ::slotted(bk-page-section) { --bk-page-section-padding-inline: max(var(--_bk-shell-app-main-inline), var(--bk-safe-start), var(--bk-safe-end)); }
443
- :host(:state(sections)) .main-inner ::slotted(bk-page-hero) { --bk-page-hero-padding-inline: max(var(--_bk-shell-app-main-inline), var(--bk-safe-start), var(--bk-safe-end)); }
444
- /* The footer is a bk-page-footer or sections (bk-page-section), each a band of its own with the footer's line and spacing.
445
- Other content gets the same as one band in the page padding. */
446
- .footer-inner {
447
- display: flex; flex-direction: column;
448
- --bk-page-section-border: var(--bk-border-width) solid var(--bk-app-footer-border, var(--bk-line));
449
- --bk-page-section-padding-inline: max(var(--bk-app-footer-padding-inline, var(--_bk-shell-app-main-inline)), var(--bk-safe-start), var(--bk-safe-end));
450
- }
451
- .footer-inner ::slotted(:not(bk-page-section, bk-page-footer)) {
452
- padding: var(--_bk-shell-app-footer-padding-block) max(var(--bk-app-footer-padding-inline, var(--_bk-shell-app-main-inline)), var(--bk-safe-end)) var(--_bk-shell-app-footer-padding-block) max(var(--bk-app-footer-padding-inline, var(--_bk-shell-app-main-inline)), var(--bk-safe-start));
453
- border-block-start: var(--bk-page-section-border);
454
- }
455
- :host(:state(workspace)) .footer { flex: none; }
456
- .footer.edge { padding-block-end: var(--bk-safe-bottom); }
457
- .footer {
458
- background: var(--bk-app-footer-bg, transparent);
459
- font-size: var(--_bk-shell-app-bar-font-size); color: var(--bk-app-bar-fg, var(--bk-text-muted));
460
- }
461
- .statusbar {
462
- position: sticky; bottom: calc(var(--_bk-shell-app-bottom-nav, 0px) + var(--bk-keyboard-inset)); z-index: var(--bk-z-sticky); display: flex; align-items: center; gap: var(--_bk-shell-app-statusbar-gap);
463
- padding: var(--_bk-shell-app-bar-padding-block) max(var(--_bk-shell-app-statusbar-padding-inline), var(--bk-safe-end)) var(--_bk-shell-app-bar-padding-block) max(var(--_bk-shell-app-statusbar-padding-inline), var(--bk-safe-start));
464
- background: var(--bk-app-statusbar-bg, var(--_bk-shell-app-bg)); border-block-start: var(--bk-border-width) solid var(--_bk-shell-app-statusbar-border);
465
- font-size: var(--_bk-shell-app-bar-font-size); color: var(--bk-app-bar-fg, var(--bk-text-muted));
466
- /* A bk-bar in the status bar keeps its facts as far apart as the bar keeps its items. */
467
- --bk-bar-gap: var(--_bk-shell-app-statusbar-gap);
468
- }
469
-
470
- /* Bottom navigation: the items of the nav as a bar at the foot of the screen, icon over label, as wide as each other. It sits below
471
- the status bar, which stands above it while both stick to the viewport. It keeps clear of the home bar of a phone. */
472
- .bottom-nav {
473
- position: sticky; bottom: var(--bk-keyboard-inset); z-index: var(--bk-z-sticky);
474
- padding-block-end: var(--bk-safe-bottom); padding-inline: var(--bk-safe-start) var(--bk-safe-end);
475
- background: var(--bk-app-bottom-nav-bg, var(--bk-app-statusbar-bg, var(--_bk-shell-app-bg)));
476
- border-block-start: var(--bk-border-width) solid var(--bk-app-bottom-nav-border, var(--_bk-shell-app-statusbar-border));
477
- }
478
- .statusbar.edge { padding-block-end: calc(var(--_bk-shell-app-bar-padding-block) + var(--bk-safe-bottom)); }
479
- .bottom-list { display: flex; margin: 0; padding: 0; list-style: none; }
480
- .bottom-list li { flex: 1 1 0; min-width: 0; display: flex; }
481
- .bn-item {
482
- --_bk-interactive-hover: var(--bk-app-bottom-nav-hover, var(--bk-hover)); --_bk-interactive-pressed: var(--bk-app-bottom-nav-pressed, var(--bk-pressed)); --_bk-interactive-focus-offset: var(--bk-focus-offset-inset);
483
- flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--bk-app-bottom-nav-gap, var(--bk-space-0));
484
- min-block-size: var(--bk-app-bottom-nav-height, calc(var(--bk-icon-lg) + 1.4 * var(--bk-text-xs) + 2 * var(--bk-space-2)));
485
- padding: var(--bk-space-1) var(--bk-space-1); border: 0; border-radius: 0; background: transparent; font: inherit; text-decoration: none;
486
- color: var(--bk-app-bottom-nav-fg, var(--bk-nav-item-fg, var(--bk-text-muted)));
487
- }
488
- .bn-icon { position: relative; display: inline-flex; --bk-icon-size: var(--bk-app-bottom-nav-icon-size, var(--bk-icon-md)); }
489
- .bn-label {
490
- max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4;
491
- font-size: var(--bk-app-bottom-nav-font-size, var(--bk-text-xs)); font-weight: var(--bk-weight-medium);
492
- }
493
- .bn-count { position: absolute; inset-block-start: calc(-1 * var(--bk-space-1)); inset-inline-start: 60%; }
494
- .bn-item[aria-current="page"] { color: var(--bk-app-bottom-nav-current-fg, var(--bk-nav-item-current-icon-color, var(--bk-accent-text))); }
495
- .bn-item[aria-current="page"] .bn-label { font-weight: var(--bk-weight-semibold); }
496
- .bn-item:disabled, .bn-item[aria-disabled="true"] { opacity: var(--bk-disabled-opacity); }
497
- @media (forced-colors: active) { .bottom-nav { border-color: CanvasText; } .bn-item[aria-current="page"] { color: Highlight; } }
498
-
499
- /* Workspace: the shell is the viewport, content scrolls inside */
500
- :host(:state(workspace)) { display: flex; flex-direction: column; height: var(--_bk-shell-app-vh); min-height: 0; overflow: hidden; }
501
- :host(:state(workspace)) .banner, :host(:state(workspace)) .header, :host(:state(workspace)) .statusbar, :host(:state(workspace)) .bottom-nav { flex: none; position: relative; }
502
- :host(:state(workspace)) .body { flex: 1; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
503
- :host(:state(workspace)) .sidebar, :host(:state(workspace)) .aside, :host(:state(workspace)) .aside-resize { position: relative; top: 0; height: auto; min-height: 0; }
504
- :host(:state(workspace)) .content { min-height: 0; overflow: hidden; }
505
- /* Scroll containers are also containing blocks: absolute content (sr-only text) must not escape them and scroll the page. */
506
- :host(:state(workspace)) main { position: relative; padding: 0; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
507
- :host(:state(workspace)) .main-inner { max-width: none; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
508
- /* A bk-pane directly in the main content is the page: it fills <main> with the page padding and gap, its content scrolls inside. */
509
- /* Through the pane's tokens, so a pane may still set its own (a tool view edge to edge: --bk-pane-padding: 0). */
510
- :host(:state(workspace)) .main-inner ::slotted(bk-pane) { flex: 1; min-height: 0; --bk-pane-padding: var(--_bk-shell-app-main-start) var(--_bk-shell-app-main-inline) var(--_bk-shell-app-main-end) var(--_bk-shell-app-main-inline-start); --bk-pane-gap: var(--_bk-shell-app-page-gap); --bk-pane-content-width: var(--bk-width-page); --bk-pane-stack-gap: var(--_bk-shell-app-page-gap); }
511
- /* Split and columns fill <main> edge to edge. */
512
- :host(:state(workspace)) .main-inner ::slotted(bk-split), :host(:state(workspace)) .main-inner ::slotted(bk-columns) { flex: 1; min-height: 0; }
513
- /* A workspace is one flat surface: <main> has no page padding (also without a sidebar or an aside), and the panels
514
- of its split lie on the content ground, divided by the lines of the split. --bk-app-content-bg raises the whole
515
- content region; a panel of the app can still set its own --bk-panel-bg. */
516
- :host(:state(workspace)) .body main { padding: 0; }
517
- :host(:state(workspace)) .main-inner ::slotted(bk-split), :host(:state(workspace)) .main-inner ::slotted(bk-columns) {
518
- --bk-panel-bg: var(--bk-app-content-bg, var(--_bk-shell-app-bg));
519
- }
520
-
521
- /* Drawers: bk-drawer gives surface, motion and modality; here they have square corners and a line only towards the page. */
522
- bk-drawer { --bk-drawer-radius: 0px; --bk-drawer-size: min(var(--_bk-shell-app-drawer-width), calc(100vw - var(--bk-space-12))); }
523
- bk-drawer.end { --bk-drawer-size: min(var(--_bk-shell-app-aw), calc(100vw - var(--bk-space-12))); }
524
- bk-drawer::part(dialog) { border-width: 0; }
525
- bk-drawer.start::part(dialog) { border-inline-end-width: var(--bk-border-width); }
526
- bk-drawer.end::part(dialog) { border-inline-start-width: var(--bk-border-width); }
527
- .drawer-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
528
- .drawer-head { display: flex; align-items: center; gap: var(--bk-space-2); flex: none; min-height: var(--_bk-shell-app-hh); padding: var(--_bk-shell-app-band-pad) var(--_bk-shell-app-pad); }
529
- .drawer-head .grow { flex: 1; min-width: 0; display: flex; align-items: center; }
530
- .drawer-body { position: relative; flex: 1; overflow-y: auto; padding: 0 var(--_bk-shell-app-pad) var(--_bk-shell-app-pad); display: flex; flex-direction: column; gap: var(--_bk-shell-app-drawer-gap); }
531
- bk-drawer.end .drawer-head { padding-inline: var(--_bk-shell-app-aside-padding); }
532
- bk-drawer.end .drawer-body { padding: 0 var(--_bk-shell-app-aside-padding) var(--_bk-shell-app-aside-padding); }
533
- .drawer-footer { flex: none; padding: var(--_bk-shell-app-bar-padding-block) var(--_bk-shell-app-pad); border-block-start: var(--bk-border-width) solid var(--bk-layer-modal-border); }
534
- /* The rail and drawers clip: keyboard rings of their own buttons go inside */
535
- .sidebar bk-button, bk-drawer bk-button { --bk-button-focus-offset: var(--bk-focus-offset-inset); }
536
- @media (forced-colors: active) {
537
- .header, .sidebar, .sidebar-footer, .aside, .statusbar, .footer-inner ::slotted(:not(bk-page-section, bk-page-footer)) { border-color: CanvasText; }
538
- .skip { border: var(--bk-border-width) solid CanvasText; }
539
- }
540
-
541
- /* Print: only the page itself. The frame (banner, header, sidebar, aside, status bar, bottom navigation) stays on screen. */
542
- @media print {
543
- :is([part="skip-link"], [part="banner"], [part="header"], [part="sidebar"], [part="aside"], [part="aside-resize"], [part="statusbar"], [part="bottom-nav"]) { display: none; }
544
- .shell, .body, .content, main { display: block; block-size: auto; min-block-size: 0; max-block-size: none; overflow: visible; }
545
- }
546
- `
547
- ];
548
- t(e) {
549
- return this.i18n.t(e);
550
- }
551
- has(e) {
552
- return this.used.has(e);
553
- }
554
- get hasSidebar() {
555
- return O.some((e) => this.has(e));
556
- }
557
- get hasDrawer() {
558
- return [
559
- "nav",
560
- "sidebar",
561
- "sidebar-footer",
562
- "drawer"
563
- ].some((e) => this.has(e) && !(e === "nav" && this.navMoved));
564
- }
565
- get bottomNav() {
566
- return this.navPlacement === "bottom" && this.narrow && (this.has("nav") || this.has("sidebar"));
567
- }
568
- get bottomSource() {
569
- return this.has("nav") ? "nav" : "sidebar";
570
- }
571
- get navMoved() {
572
- return this.bottomNav && this.has("nav");
573
- }
574
- get navRow() {
575
- return this.navPlacement === "below" && !this.narrow && this.has("nav");
576
- }
577
- get hasHeaderContent() {
578
- return [
579
- "header",
580
- "nav",
581
- "header-end"
582
- ].some((e) => this.has(e) && !(e === "nav" && this.navMoved));
583
- }
584
- get showHeader() {
585
- return this.hasHeaderContent || this.narrow && this.hasDrawer;
586
- }
587
- slotOf(e) {
588
- return [...this.children].find((t) => t.contains(e))?.getAttribute("slot") ?? "";
589
- }
590
- get placedToggles() {
591
- let e = [...c(this)?.querySelectorAll("[data-sidebar-toggle]") ?? []];
592
- return {
593
- all: e,
594
- inHeader: e.some((e) => [
595
- "header",
596
- "nav",
597
- "header-end"
598
- ].includes(this.slotOf(e)))
599
- };
600
- }
601
- get searchElement() {
602
- return [...c(this)?.querySelectorAll("[data-header-search]") ?? []].find((e) => F.includes(this.slotOf(e))) ?? null;
603
- }
604
- get hasSearch() {
605
- return !!this.searchElement;
606
- }
607
- get searchSlot() {
608
- let e = this.searchElement;
609
- return e ? this.slotOf(e) : "";
610
- }
611
- get searchField() {
612
- let e = this.searchElement;
613
- return e ? e.matches(I) ? e : e.querySelector(I) : null;
614
- }
615
- openSearch() {
616
- this.searchOpen = !0, this.updateComplete.then(() => this.searchField?.focus());
617
- }
618
- onSearchShortcut = () => {
619
- let e = this.searchField;
620
- if (!e || !this.isConnected) return !1;
621
- this.narrow ? this.searchOpen ? e.focus() : this.openSearch() : e.focus();
622
- };
623
- boundSearchKeys = "";
624
- unbindSearch;
625
- bindSearchShortcut() {
626
- let e = this.isConnected && this.hasSearch && this.searchShortcut !== "none" ? this.searchShortcut.trim() : "";
627
- if (e === this.boundSearchKeys || (this.unbindSearch?.(), this.unbindSearch = void 0, this.boundSearchKeys = e, !e)) return;
628
- let t = b([{
629
- id: L,
630
- keys: e,
631
- label: this.t("searchShortcut"),
632
- global: !0
633
- }]), n = y(L, this.onSearchShortcut);
634
- this.unbindSearch = () => {
635
- n(), t();
636
- };
637
- }
638
- closeSearch(e) {
639
- let t = this.searchField;
640
- e && t && t.value && (t.value = "", t.dispatchEvent(new Event("input", {
641
- bubbles: !0,
642
- composed: !0
643
- }))), this.searchOpen = !1, this.updateComplete.then(() => this.renderRoot.querySelector(".search-toggle")?.focus());
644
- }
645
- onHeaderKeydown = (e) => {
646
- e.key === "Escape" && !e.defaultPrevented && this.searchOpen && (e.preventDefault(), this.closeSearch(!0));
647
- };
648
- get asideVisible() {
649
- return this.asideOverlay ? this.asideDrawerOpen : this.asideOpen;
650
- }
651
- onResize = (e) => {
652
- for (let t of e) {
653
- if (t.target === this) {
654
- let e = t.contentBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
655
- if (e <= 0) continue;
656
- this.width = e, this.applyWidth();
657
- continue;
658
- }
659
- if (t.target.classList.contains("bottom-nav")) {
660
- let e = Math.round(t.borderBoxSize?.[0]?.blockSize ?? t.contentRect.height);
661
- cancelAnimationFrame(this.barFrame), this.barFrame = requestAnimationFrame(() => this.bottomNavHeight = e);
662
- continue;
663
- }
664
- if (!t.target.classList.contains("statusbar")) {
665
- let e = this.fitSizes.get(t.target), n = t.borderBoxSize?.[0]?.inlineSize ?? t.contentRect.width;
666
- e !== void 0 && n < e - 1 && !this.gaveWay.has(t.target) && this.resetFit(), cancelAnimationFrame(this.fitFrame), this.fitFrame = requestAnimationFrame(() => this.applyWidth());
667
- continue;
668
- }
669
- let e = Math.round(t.borderBoxSize?.[0]?.blockSize ?? t.contentRect.height);
670
- cancelAnimationFrame(this.sizeFrame), this.sizeFrame = requestAnimationFrame(() => this.statusbarHeight = e);
671
- }
672
- };
673
- sizeFrame = 0;
674
- barFrame = 0;
675
- fitFrame = 0;
676
- width = 0;
677
- navFitsFrom = 0;
678
- centerFitsFrom = 0;
679
- fitSizes = /* @__PURE__ */ new WeakMap();
680
- watched = [];
681
- resets = {
682
- count: 0,
683
- since: 0
684
- };
685
- gaveWay = /* @__PURE__ */ new Set();
686
- get headerSlots() {
687
- return this.brandInHeader ? [
688
- "sidebar-header",
689
- "nav",
690
- "header-end"
691
- ] : [
692
- "header",
693
- "nav",
694
- "header-end"
695
- ];
696
- }
697
- get optionalItems() {
698
- let e = this.headerSlots;
699
- return [...c(this)?.querySelectorAll("[data-header-priority]") ?? []].filter((t) => e.includes(this.slotOf(t))).map((e, t) => ({
700
- el: e,
701
- i: t,
702
- p: Number(e.dataset.headerPriority) || 1
703
- })).sort((e, t) => e.p - t.p || t.i - e.i).map((e) => e.el);
704
- }
705
- regionOverflow(e) {
706
- if (!e || e.hidden) return 0;
707
- let t = [...e.querySelectorAll("slot")].flatMap((e) => e.assignedElements()), n = t.map((e) => e.getBoundingClientRect().width).filter((e) => e > 0), r = parseFloat(getComputedStyle(e).columnGap) || 0, i = n.reduce((e, t) => e + t, 0) + r * Math.max(0, n.length - 1) - e.clientWidth;
708
- return t.some((e) => e.truncated === !0) && (i = Math.max(i, 2)), i;
709
- }
710
- headerOverflow() {
711
- let e = this.renderRoot.querySelector(".header-inner");
712
- if (!e) return 0;
713
- let t = this.regionOverflow(e.querySelector(".header-start")), n = e.querySelector(".nav"), r = n ? n.scrollWidth - n.clientWidth : 0, i = [...e.children].filter((e) => !e.hidden).at(-1)?.getBoundingClientRect(), a = e.getBoundingClientRect(), o = getComputedStyle(e), s = parseFloat(o.paddingInlineEnd) || 0, c = i ? o.direction === "rtl" ? a.left + s - i.left : i.right - (a.right - s) : 0, l = e.querySelector(".header-end.search"), u = l && !this.narrow ? this.regionOverflow(l) : 0;
714
- return Math.max(c, Math.max(0, t) + Math.max(0, r) + Math.max(0, u));
715
- }
716
- navRowOverflow() {
717
- let e = this.renderRoot.querySelector(".nav-row .nav");
718
- return e ? e.scrollWidth - e.clientWidth : 0;
719
- }
720
- centerOverflow() {
721
- let e = this.renderRoot.querySelector(".header-inner");
722
- return e ? Math.max(this.regionOverflow(e.querySelector(".header-start")), this.regionOverflow(e.querySelector(".header-end"))) : 0;
723
- }
724
- isContentChange(e) {
725
- return e.some((e) => !(e.target instanceof Element ? e.target : e.target.parentElement)?.closest("[data-sidebar-toggle]"));
726
- }
727
- resetFit() {
728
- let e = performance.now();
729
- e - this.resets.since > 1e3 && (this.resets = {
730
- count: 0,
731
- since: e
732
- }), ++this.resets.count > 8 || (this.navFitsFrom = 0, this.centerFitsFrom = 0, this.fitSizes = /* @__PURE__ */ new WeakMap());
733
- }
734
- recordFit() {
735
- let e = this.searchElement;
736
- for (let t of this.children) ["header", "header-end"].includes(t.getAttribute("slot") ?? "") && t !== e && !t.matches(M) && this.fitSizes.set(t, t.getBoundingClientRect().width);
737
- }
738
- showGaveWay() {
739
- for (let e of this.gaveWay) e.hidden = !1;
740
- this.gaveWay.clear(), this.headerContent.takeRecords();
741
- }
742
- fitHeader() {
743
- this.isContentChange(this.headerContent.takeRecords()) && this.resetFit(), this.showGaveWay();
744
- let e = !!this.renderRoot.querySelector(".nav-row"), t = this.optionalItems.filter((e) => !e.hidden), n = this.renderRoot.querySelector(".header-inner");
745
- t.length && n?.classList.add("fit");
746
- for (let n of t) (e && this.slotOf(n) === "nav" ? this.navRowOverflow() : this.headerOverflow()) <= 1 || (n.hidden = !0, this.gaveWay.add(n));
747
- n?.classList.remove("fit"), this.headerContent.takeRecords();
748
- }
749
- applyWidth() {
750
- if (!this.width) return;
751
- this.isContentChange(this.headerContent.takeRecords()) && this.resetFit();
752
- let e = this.renderRoot.querySelector(".header-inner"), t = this.renderRoot.querySelector(".header .nav"), n = !!this.renderRoot.querySelector(".nav-row"), r = !!e && e.getBoundingClientRect().width < this.width - 1, i = (this.has("nav") ? getComputedStyle(this).getPropertyValue("--bk-app-nav-align").trim() : "") === "center" && (n || this.width >= this.centerFitsFrom);
753
- if (this.setState("nav-center", i), i && t && !n) {
754
- this.showGaveWay();
755
- let e = this.centerOverflow();
756
- e > 1 && (this.centerFitsFrom = r ? 1e400 : Math.ceil(this.width + 2 * e), this.recordFit(), i = !1, this.setState("nav-center", !1));
757
- }
758
- i && t && !n || this.fitHeader();
759
- let a = t ? n ? this.navRowOverflow() : this.headerOverflow() : 0;
760
- t && a > 1 && (this.navFitsFrom = r ? 1e400 : Math.ceil(this.width + a), this.recordFit());
761
- let o = this.width < Math.max(this.breakpoint, this.navFitsFrom), s = this.width < this.asideBreakpoint;
762
- o !== this.narrow && (this.narrow = o), s !== this.asideOverlay && (this.asideOverlay = s);
763
- }
764
- toggleSidebar(e) {
765
- let t = e ?? !this.sidebarCollapsed;
766
- t !== this.sidebarCollapsed && (this.sidebarCollapsed = t, this.fireToggle("sidebar"));
767
- }
768
- toggleAside(e) {
769
- if (this.asideOverlay) {
770
- let t = e ?? !this.asideDrawerOpen;
771
- if (t === this.asideDrawerOpen) return;
772
- this.asideDrawerOpen = t;
773
- } else {
774
- let t = e ?? !this.asideOpen;
775
- if (t === this.asideOpen) return;
776
- this.asideOpen = t;
777
- }
778
- this.fireToggle("aside");
779
- }
780
- showNavigation() {
781
- this.narrow && (this.navigationOpen = !0);
782
- }
783
- hideNavigation() {
784
- this.navigationOpen = !1;
785
- }
786
- fireToggle(e) {
787
- let t = e === "sidebar" ? !this.sidebarCollapsed : this.asideVisible;
788
- this.dispatchEvent(new E(e, t));
789
- }
790
- willUpdate(e) {
791
- super.willUpdate(e);
792
- let t = /* @__PURE__ */ new Set(), n = !1, r = 0, i = !1;
793
- for (let e of c(this)?.childNodes ?? []) if (e instanceof Element) {
794
- let a = e.getAttribute("slot") || "default";
795
- if (t.add(a), a !== "default" || j.has(e.localName)) continue;
796
- k.has(e.localName) && (n = !0), A.has(e.localName) ? r++ : i = !0;
797
- } else e.nodeType === Node.TEXT_NODE && e.textContent?.trim() && (t.add("default"), i = !0);
798
- this.used = t, n !== this.workspace && (this.workspace = n), this.setState("sections", !n && !i && r > 0), (e.has("breakpoint") || e.has("asideBreakpoint")) && this.applyWidth(), !this.narrow && this.navigationOpen && (this.navigationOpen = !1), this.narrow && this.hasSearch || !this.searchOpen || (this.searchOpen = !1);
799
- let a = c(this)?.querySelector("bk-page-header[snap]"), o = a?.headingText ?? "";
800
- o !== this.snapTitle && (this.snapTitle = o);
801
- let s = !!a?.collapsed;
802
- s !== this.snapCollapsed && (this.snapCollapsed = s), !this.asideOverlay && this.asideDrawerOpen && (this.asideDrawerOpen = !1), this.setState("narrow", this.narrow), this.setState("aside-overlay", this.asideOverlay), this.setState("workspace", this.workspace);
803
- }
804
- setState(e, t) {
805
- t ? this.internals.states.add(e) : this.internals.states.delete(e);
806
- }
807
- checkFlatSidebar() {
808
- let e = this.renderRoot.querySelector(".sidebar");
809
- if (!e) return;
810
- let t = getComputedStyle(e), n = parseFloat(t.borderInlineEndWidth) || 0, r = t.borderInlineEndColor, i = n === 0 || r === "transparent" || /\/\s*0\)$|,\s*0\)$/.test(r);
811
- this.setState("flat-sidebar", i);
812
- }
813
- updated(e) {
814
- this.checkFlatSidebar(), super.updated(e), this.measureScrollbar();
815
- for (let t of ["sidebarCollapsed", "asideOpen"]) e.has(t) && e.get(t) !== void 0 && !this.fromState.has(t) && this.persisted[t].set(this[t]);
816
- this.fromState.clear(), this.syncNavs(), this.bindSearchShortcut(), e.has("narrow") && e.get("narrow") !== void 0 && (this.fitHeader(), requestAnimationFrame(() => this.applyWidth())), e.has("navPlacement") && e.get("navPlacement") !== void 0 && this.refit(), this.observeNav(), this.watchBottomItems(), this.observeStatusbar();
817
- let t = this.renderRoot.querySelector(".header .toggle");
818
- t && s(t, this.narrow ? {
819
- haspopup: "dialog",
820
- expanded: this.navigationOpen
821
- } : {
822
- haspopup: null,
823
- expanded: null
824
- }), this.asideTriggers = this.syncTriggers("data-aside-toggle", this.asideTriggers, this.has("aside") ? {
825
- expanded: this.asideVisible,
826
- haspopup: this.asideOverlay ? "dialog" : null
827
- } : void 0), this.sidebarTriggers = this.syncTriggers("data-sidebar-toggle", this.sidebarTriggers, this.narrow ? {
828
- expanded: this.navigationOpen,
829
- haspopup: "dialog"
830
- } : {
831
- expanded: !this.sidebarCollapsed,
832
- haspopup: null
833
- }), this.syncToggleLook(), this.syncScrollPadding(), this.asideResizable && this.syncAsideResize();
834
- }
835
- syncToggleLook() {
836
- let { icon: e, label: t } = this.toggleLook;
837
- for (let n of this.sidebarTriggers) n.localName === "bk-button" && Object.assign(n, {
838
- icon: e,
839
- label: t
840
- }), n.localName === "bk-nav-item" && (n.icon = e, n.textContent !== t && (n.textContent = t)), n.hidden = this.narrow && this.slotOf(n) === "sidebar-footer";
841
- }
842
- async getUpdateComplete() {
843
- let e = await super.getUpdateComplete();
844
- return await Promise.all([...this.renderRoot.querySelectorAll("bk-drawer")].map((e) => e.updateComplete)), e;
845
- }
846
- measureScrollbar() {
847
- let e = this.renderRoot.querySelector(".sidebar-scroll");
848
- if (!e || this.sidebarCollapsed && !this.narrow) return;
849
- let t = e.offsetWidth - e.clientWidth;
850
- t >= 0 && `${t}px` !== e.style.getPropertyValue("--_bk-shell-app-sbw") && e.style.setProperty("--_bk-shell-app-sbw", `${t}px`);
851
- }
852
- firstUpdated() {
853
- this.observeStatusbar();
854
- }
855
- observeNav() {
856
- let e = this.renderRoot.querySelector(".header .nav");
857
- e && this.resizeObserver?.observe(e);
858
- let t = this.headerSlots, n = [];
859
- for (let r of this.children) {
860
- let i = r.getAttribute("slot") ?? "";
861
- i === "nav" ? e ? this.resizeObserver?.observe(r) : this.resizeObserver?.unobserve(r) : t.includes(i) ? this.resizeObserver?.observe(r) : this.resizeObserver?.unobserve(r), [
862
- "header",
863
- "nav",
864
- "header-end"
865
- ].includes(i) && n.push(r);
866
- }
867
- if (n.length === this.watched.length && n.every((e, t) => e === this.watched[t])) return;
868
- let r = this.headerContent.takeRecords();
869
- this.headerContent.disconnect();
870
- for (let e of n) this.headerContent.observe(e, {
871
- subtree: !0,
872
- childList: !0,
873
- characterData: !0,
874
- attributes: !0,
875
- attributeFilter: ["hidden"]
876
- });
877
- (this.watched.length || r.length) && this.refit(), this.watched = n;
878
- }
879
- headerContent = l((e) => {
880
- this.isContentChange(e) && this.refit();
881
- });
882
- refit() {
883
- this.resetFit(), cancelAnimationFrame(this.fitFrame), this.fitFrame = requestAnimationFrame(() => this.applyWidth());
884
- }
885
- observeStatusbar() {
886
- let e = this.renderRoot.querySelector(".statusbar");
887
- e && this.resizeObserver?.observe(e);
888
- let t = this.renderRoot.querySelector(".bottom-nav");
889
- t ? this.resizeObserver?.observe(t) : this.bottomNavHeight &&= 0;
890
- }
891
- bottomItems = l(() => this.requestUpdate());
892
- watchBottomItems() {
893
- if (this.bottomItems.disconnect(), this.bottomNav) for (let e of this.children) e.getAttribute("slot") === this.bottomSource && this.bottomItems.observe(e, {
894
- subtree: !0,
895
- attributes: !0,
896
- childList: !0,
897
- characterData: !0
898
- });
899
- }
900
- bottomNavItems() {
901
- let e = [];
902
- for (let t of this.children) {
903
- if (t.getAttribute("slot") !== this.bottomSource) continue;
904
- let n = t.matches("bk-nav-item") ? [t] : [...t.querySelectorAll("bk-nav-item:not(bk-nav-group bk-nav-item)")];
905
- for (let t of n) {
906
- let n = [...t.childNodes].filter((e) => !(e instanceof Element && e.hasAttribute("slot"))).map((e) => e.textContent).join("").replace(/\s+/g, " ").trim();
907
- n && e.push({
908
- el: t,
909
- label: n,
910
- icon: t.icon,
911
- href: t.href,
912
- target: t.target,
913
- rel: t.rel,
914
- count: t.count,
915
- current: t.current,
916
- disabled: t.disabled
917
- });
918
- }
919
- }
920
- return e.slice(0, 5);
921
- }
922
- onBottomItem(e, t) {
923
- t.href !== void 0 && (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || t.target === "_blank") || (e.preventDefault(), t.el.shadowRoot?.querySelector("[part=link]")?.click());
924
- }
925
- renderBottomNav() {
926
- let t = this.bottomNavItems();
927
- return e`<nav class="bottom-nav" part="bottom-nav" aria-label=${this.t("mainNavigation")}>
928
- <ul class="bottom-list">${t.map((t) => {
929
- let r = e`<span class="bn-icon">${t.icon ? e`<bk-icon name=${t.icon}></bk-icon>` : n}${t.count !== void 0 && t.count !== "" && t.count !== 0 ? e`<span class="count bn-count" part="bottom-nav-count">${t.count}</span>` : n}</span><span class="bn-label">${t.label}</span>`, i = t.current ? "page" : void 0;
930
- return e`<li>${t.href === void 0 ? e`<button type="button" class="bn-item interactive" part="bottom-nav-item" ?disabled=${t.disabled} aria-current=${a(i)} @click=${(e) => this.onBottomItem(e, t)}>${r}</button>` : e`<a class="bn-item interactive" part="bottom-nav-item" href=${a(t.disabled ? void 0 : this.links.href(t.href))} target=${a(t.target)}
931
- rel=${a(t.rel ?? (t.target === "_blank" ? "noopener noreferrer" : void 0))} aria-disabled=${a(t.disabled ? "true" : void 0)}
932
- aria-current=${a(i)} @click=${(e) => this.onBottomItem(e, t)}>${r}</a>`}</li>`;
933
- })}</ul>
934
- </nav>`;
935
- }
936
- syncNavs() {
937
- let e = this.sidebarCollapsed && !this.narrow, t = this.renderRoot.querySelector(".sidebar-toggle-button");
938
- t && (t.collapsed = e, s(t, { expanded: !this.sidebarCollapsed }));
939
- for (let t of this.children) {
940
- let n = t.getAttribute("slot") ?? "";
941
- if (!D.includes(n)) continue;
942
- let r = [...t.matches("bk-nav, bk-brand") ? [t] : [], ...t.querySelectorAll("bk-nav, bk-brand")];
943
- for (let t of r) t.localName === "bk-nav" && (t.drawer = this.narrow), t.collapsed = e && O.includes(n);
944
- }
945
- }
946
- syncTriggers(e, t, n) {
947
- let r = [...c(this)?.querySelectorAll(`[${e}]`) ?? []];
948
- for (let e of t) r.includes(e) || s(e, {
949
- expanded: null,
950
- haspopup: null
951
- });
952
- if (n) for (let e of r) s(e, n);
953
- return r;
954
- }
955
- onNavDrawerOpen(e) {
956
- this.focusDrawer(e.currentTarget, () => {
957
- for (let e of this.children) {
958
- if (!D.includes(e.getAttribute("slot") ?? "")) continue;
959
- let t = e.matches("[current]") ? e : e.querySelector("[current]");
960
- if (t instanceof HTMLElement) return t;
961
- }
962
- return null;
963
- }), m(this, "open");
964
- }
965
- focusDrawer(e, t = () => null) {
966
- (t() ?? e.querySelector(".drawer-head bk-button"))?.focus();
967
- }
968
- onHostClick = (e) => {
969
- let t = e.composedPath(), n = t.find((e) => e instanceof Element && e.hasAttribute?.("data-aside-toggle"));
970
- n && this.contains(n) && this.toggleAside();
971
- let r = t.find((e) => e instanceof Element && e.hasAttribute?.("data-sidebar-toggle"));
972
- r && this.contains(r) && (this.narrow ? this.navigationOpen ? this.hideNavigation() : this.showNavigation() : this.toggleSidebar());
973
- };
974
- onSkip(e) {
975
- e.preventDefault(), this.renderRoot.querySelector("main")?.focus();
976
- }
977
- onHeaderToggle() {
978
- this.narrow ? this.showNavigation() : this.toggleSidebar();
979
- }
980
- onNavDrawerClick(e) {
981
- e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || e.composedPath().some((e) => e instanceof HTMLAnchorElement && e.hasAttribute("href")) && this.hideNavigation();
982
- }
983
- onNavDrawerClose() {
984
- this.navigationOpen &&= !1, m(this, "close");
985
- }
986
- onAsideDrawerClose() {
987
- this.asideDrawerOpen && (this.asideDrawerOpen = !1, this.fireToggle("aside"));
988
- }
989
- get toggleLook() {
990
- return this.narrow ? {
991
- icon: "menu",
992
- label: this.t("openNavigation")
993
- } : this.sidebarCollapsed ? {
994
- icon: "sidebar-expand",
995
- label: this.t("expandSidebar")
996
- } : {
997
- icon: "sidebar-collapse",
998
- label: this.t("collapseSidebar")
999
- };
1000
- }
1001
- get brandInHeader() {
1002
- return this.narrow && !this.has("header") && this.has("sidebar-header");
1003
- }
1004
- renderHeader() {
1005
- let t = this.placedToggles, r = this.narrow ? this.hasDrawer && !t.inHeader : this.hasSidebar && !t.all.length, { icon: i, label: a } = this.toggleLook, o = !this.narrow && this.has("nav"), s = this.navRow, c = this.narrow && this.hasSearch, l = this.searchSlot, u = this.hasSidebar ? "" : "page-width", d = e`<div class="nav"><slot name="nav"></slot></div>`, f = c && !this.searchOpen ? e`<bk-button variant="ghost" class="search-toggle" part="search-toggle" icon="search" label=${this.t("openSearch")}
1006
- aria-expanded="false" @click=${this.openSearch}></bk-button>` : n, p = c && this.searchOpen ? e`<bk-button variant="ghost" class="search-cancel" part="search-cancel" @click=${() => this.closeSearch(!0)}>${this.t("cancel")}</bk-button>` : n, m = l !== "header-end";
1007
- return e`<header class="header ${o && !s ? "has-nav" : ""} ${s ? "has-row" : ""} ${l === "header-end" ? "end-search" : ""}" part="header" role="banner" @keydown=${this.onHeaderKeydown}>
1008
- <div class="header-inner ${u} ${this.has("header-end") ? "" : "no-end"}">
1009
- ${r ? e`<bk-button variant="ghost" class="toggle" part="toggle" icon=${i} label=${a} @click=${this.onHeaderToggle}></bk-button>` : n}
1010
- <div class="header-start ${l === "header" ? "search" : ""}">${this.brandInHeader ? e`<slot name="sidebar-header"></slot>` : e`<slot name="header"></slot>`}${this.snapTitle ? e`<span class="title ${this.snapCollapsed ? "shown" : ""}" part="title" aria-hidden="true">${this.snapTitle}</span>` : n}</div>
1011
- ${m ? f : n}
1012
- ${m ? p : n}
1013
- ${o && !s ? d : n}
1014
- <div class="header-end ${l === "header-end" ? "search" : ""}" ?hidden=${!this.has("header-end")}>${m ? n : f}<slot name="header-end"></slot>${m ? n : p}</div>
1015
- </div>
1016
- ${s ? e`<div class="nav-row ${u}">${d}</div>` : n}
1017
- <div class="search-scopes" part="search-scopes" ?hidden=${!(c && this.searchOpen && this.has("search-scopes"))}><slot name="search-scopes"></slot></div>
1018
- </header>`;
1019
- }
1020
- renderSidebar() {
1021
- let t = !this.hasHeaderContent && !this.placedToggles.all.length, { icon: r, label: i } = this.toggleLook;
1022
- return e`<div class="sidebar" part="sidebar">
1023
- <div class="sidebar-header" ?hidden=${!this.has("sidebar-header")}><slot name="sidebar-header"></slot></div>
1024
- <div class="sidebar-scroll"><slot name="sidebar"></slot></div>
1025
- <div class="sidebar-footer ${t ? "joined" : ""}" ?hidden=${!this.has("sidebar-footer")}><slot name="sidebar-footer"></slot></div>
1026
- ${t ? e`<div class="sidebar-toggle"><bk-nav-item class="sidebar-toggle-button" part="sidebar-toggle" role="none" icon=${r} @click=${() => this.toggleSidebar()}>${i}</bk-nav-item></div>` : n}
1027
- </div>`;
1028
- }
1029
- renderNavDrawer() {
1030
- let t = this.narrow;
1031
- return e`<bk-drawer class="start" placement="start" bare exportparts="dialog:drawer" heading=${this.t("mainNavigation")} .open=${this.navigationOpen}
1032
- @click=${this.onNavDrawerClick} @open=${this.onNavDrawerOpen} @close=${this.onNavDrawerClose}>
1033
- <div class="drawer-content">
1034
- <div class="drawer-head">
1035
- <div class="grow">${t && !this.brandInHeader ? e`<slot name="sidebar-header"></slot>` : n}</div>
1036
- <bk-button variant="ghost" icon="close" label=${this.t("closeNavigation")} @click=${() => this.hideNavigation()}></bk-button>
1037
- </div>
1038
- <div class="drawer-body">${t ? e`${this.navMoved ? n : e`<slot name="nav"></slot>`}<slot name="sidebar"></slot><slot name="drawer"></slot>` : n}</div>
1039
- <div class="drawer-footer" ?hidden=${!this.has("sidebar-footer")}>${t ? e`<slot name="sidebar-footer"></slot>` : n}</div>
1040
- </div>
1041
- </bk-drawer>`;
1042
- }
1043
- renderAsideDrawer(t) {
1044
- return e`<bk-drawer class="end" placement="end" bare exportparts="dialog:aside-drawer" heading=${t} .open=${this.asideDrawerOpen}
1045
- @open=${(e) => this.focusDrawer(e.currentTarget)} @close=${this.onAsideDrawerClose}>
1046
- <div class="drawer-content">
1047
- <div class="drawer-head"><div class="grow"></div>
1048
- <bk-button variant="ghost" icon="close" label=${this.t("closePanel")} @click=${() => this.toggleAside(!1)}></bk-button>
1049
- </div>
1050
- <div class="drawer-body">${this.asideOverlay ? e`<slot name="aside"></slot>` : n}</div>
1051
- </div>
1052
- </bk-drawer>`;
1053
- }
1054
- renderAsideResize() {
1055
- return e`<div class="aside-resize" part="aside-resize" role="separator" tabindex="0" aria-orientation="vertical"
1056
- aria-controls="aside" aria-label=${this.asideResizeLabel || this.t("resizePanel")}
1057
- @pointerdown=${this.onResizeStart} @keydown=${this.onResizeKey} @click=${this.onResizeClick} @dblclick=${this.resetAsideWidth}><span class="bk-grip" aria-hidden="true"></span></div>`;
1058
- }
1059
- asideLimits() {
1060
- let e = this.renderRoot.querySelector(".aside");
1061
- if (!e) return null;
1062
- let t = getComputedStyle(e), n = parseFloat(t.minWidth) || 0;
1063
- return {
1064
- min: n,
1065
- max: Math.max(n, parseFloat(t.maxWidth) || 1e400),
1066
- now: e.getBoundingClientRect().width
1067
- };
1068
- }
1069
- emitAsideResize(e) {
1070
- let t = this.renderRoot.querySelector(".sidebar")?.getBoundingClientRect().width ?? 0, n = Math.max(this.getBoundingClientRect().width - t, e, 1), r = Math.min(Math.max(e / n, 0), 1);
1071
- p(this, "resize", { sizes: [1 - r, r] });
1072
- }
1073
- setAsideWidth(e, t) {
1074
- let n = Math.round(Math.min(t.max, Math.max(t.min, e)));
1075
- return n !== this.asideWidth && (this.asideWidth = n, this.emitAsideResize(n), !0);
1076
- }
1077
- onResizeStart(e) {
1078
- if (e.button !== 0 || this.draggingAside) return;
1079
- let t = this.asideLimits();
1080
- if (!t) return;
1081
- e.preventDefault(), this.pressAt = {
1082
- x: e.clientX,
1083
- y: e.clientY
1084
- };
1085
- let n = e.currentTarget, r = this.matches(":dir(rtl)") ? 1 : -1, i = this.asideWidth, a = t.now, o = !0;
1086
- try {
1087
- n.setPointerCapture(e.pointerId);
1088
- } catch {
1089
- o = !1;
1090
- }
1091
- let s = o ? n : window;
1092
- this.draggingAside = !0, this.toggleAttribute("resizing", !0);
1093
- let c = null, l = 0, u = !1, d = () => {
1094
- l = 0, c === null || u || (this.setAsideWidth(a + r * (c - e.clientX), t), c = null);
1095
- }, f = (t) => {
1096
- let n = t;
1097
- n.pointerId === e.pointerId && (c = n.clientX, l ||= requestAnimationFrame(d));
1098
- }, p = () => {
1099
- this.draggingAside && (s.removeEventListener("pointermove", f), s.removeEventListener("pointerup", p), s.removeEventListener("pointercancel", p), n.removeEventListener("lostpointercapture", p), window.removeEventListener("keydown", m, !0), l && cancelAnimationFrame(l), u || d(), this.draggingAside = !1, this.toggleAttribute("resizing", !1), !u && this.asideWidth !== i && this.storedWidth.set(this.asideWidth));
1100
- }, m = (t) => {
1101
- t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), u = !0, this.asideWidth = i, this.emitAsideResize(i ?? a), p(), o && n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId));
1102
- };
1103
- s.addEventListener("pointermove", f, { passive: !0 }), s.addEventListener("pointerup", p, { passive: !0 }), s.addEventListener("pointercancel", p, { passive: !0 }), o && n.addEventListener("lostpointercapture", p, { once: !0 }), window.addEventListener("keydown", m, !0);
1104
- }
1105
- asideStepsOf() {
1106
- let e = this.asideLimits(), t = (e) => () => {
1107
- let t = this.asideLimits();
1108
- t && this.setAsideWidth(t.now + e * 64, t) && this.storedWidth.set(this.asideWidth);
1109
- };
1110
- return [
1111
- {
1112
- key: "wider",
1113
- label: this.t("sizeWider"),
1114
- disabled: !e || e.now >= e.max - .5,
1115
- run: t(1)
1116
- },
1117
- {
1118
- key: "narrower",
1119
- label: this.t("sizeNarrower"),
1120
- disabled: !e || e.now <= e.min + .5,
1121
- run: t(-1)
1122
- },
1123
- {
1124
- key: "reset",
1125
- label: this.t("sizeReset"),
1126
- divider: !0,
1127
- disabled: this.asideWidth === void 0,
1128
- run: () => this.resetAsideWidth()
1129
- }
1130
- ];
1131
- }
1132
- openAsideMenu(e, t) {
1133
- this.draggingAside || (this.asideMoves = this.asideStepsOf(), g(this, e, t));
1134
- }
1135
- onResizeClick(e) {
1136
- e.detail !== 1 || e.button !== 0 || this.draggingAside || Math.hypot(e.clientX - this.pressAt.x, e.clientY - this.pressAt.y) > 4 || this.openAsideMenu(e.currentTarget, {
1137
- x: e.clientX,
1138
- y: e.clientY
1139
- });
1140
- }
1141
- onResizeKey(e) {
1142
- if (this.draggingAside) return;
1143
- if (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey) {
1144
- e.preventDefault(), this.openAsideMenu(e.currentTarget);
1145
- return;
1146
- }
1147
- if (e.key === "Enter") {
1148
- e.preventDefault(), this.resetAsideWidth();
1149
- return;
1150
- }
1151
- let t = this.asideLimits();
1152
- if (!t) return;
1153
- let n = this.matches(":dir(rtl)"), r = e.shiftKey ? 64 : 16, i = n ? "ArrowRight" : "ArrowLeft", a = n ? "ArrowLeft" : "ArrowRight", o;
1154
- switch (e.key) {
1155
- case i:
1156
- o = t.now + r;
1157
- break;
1158
- case a:
1159
- o = t.now - r;
1160
- break;
1161
- case "Home":
1162
- o = t.min;
1163
- break;
1164
- case "End":
1165
- o = t.max;
1166
- break;
1167
- default: return;
1168
- }
1169
- e.preventDefault(), this.setAsideWidth(o, t) && this.storedWidth.set(this.asideWidth);
1170
- }
1171
- resetAsideWidth = () => {
1172
- this.asideWidth !== void 0 && (this.asideWidth = void 0, this.storedWidth.set(void 0), this.updateComplete.then(() => {
1173
- let e = this.asideLimits()?.now;
1174
- e && this.emitAsideResize(Math.round(e));
1175
- }));
1176
- };
1177
- syncAsideResize() {
1178
- let e = this.renderRoot.querySelector(".aside-resize");
1179
- if (!e) return;
1180
- if (this.draggingAside && this.asideWidth) {
1181
- e.setAttribute("aria-valuenow", String(this.asideWidth));
1182
- return;
1183
- }
1184
- let t = this.asideLimits();
1185
- t && (e.setAttribute("aria-valuenow", String(Math.round(t.now))), e.setAttribute("aria-valuemin", String(Math.round(t.min))), e.setAttribute("aria-valuemax", String(Math.round(Math.min(t.max, 1e6)))));
1186
- }
1187
- render() {
1188
- let t = !this.narrow && this.hasSidebar, r = this.showHeader, i = this.asideLabel || this.t("sidePanel"), a = this.has("aside") && !this.asideOverlay && this.asideOpen, s = r && this.navRow ? P : "0px", c = r ? "calc(var(--_bk-shell-app-hh) + var(--_bk-shell-app-nav-row) + var(--bk-safe-top))" : "var(--bk-safe-top)", l = this.bottomNav ? "" : this.has("statusbar") ? "statusbar" : this.has("footer") ? "footer" : "content", u = e`<footer class="footer ${l === "footer" ? "edge" : ""}" part="footer" role="contentinfo" ?hidden=${!this.has("footer")}><div class="footer-inner"><slot name="footer"></slot></div></footer>`, d = {
1189
- "--_bk-shell-app-nav-row": s,
1190
- "--_bk-shell-app-top": c,
1191
- "--_bk-shell-app-bottom": `${this.statusbarHeight + this.bottomNavHeight}px`,
1192
- "--_bk-shell-app-bottom-nav": `${this.bottomNavHeight}px`,
1193
- "--bk-shell-app-sticky-top": c,
1194
- "--_bk-shell-app-aw": this.asideWidth ? `${this.asideWidth}px` : "var(--bk-width-panel)"
1195
- };
1196
- return e`<div class="shell" style=${o(d)}>
1197
- <a class="skip" part="skip-link" href="#main" @click=${this.onSkip}>${this.skipLabel || this.t("skipToContent")}</a>
1198
- <div class="banner" part="banner" ?hidden=${!this.has("banner")}><slot name="banner"></slot></div>
1199
- ${r ? this.renderHeader() : n}
1200
- <div class="body ${t ? "" : "no-sidebar"} ${a ? "has-aside" : ""} ${r || this.has("banner") ? "" : "no-header"}">
1201
- ${t ? this.renderSidebar() : n}
1202
- <div class="content ${l === "content" ? "edge" : ""}" part="content">
1203
- <main id="main" part="main" tabindex="-1"><div class="main-inner"><slot></slot></div></main>
1204
- ${u}
1205
- </div>
1206
- ${a ? e`<aside class="aside" part="aside" id="aside" aria-label=${i}><slot name="aside"></slot></aside>` : n}
1207
- ${a && this.asideResizable ? this.renderAsideResize() : n}
1208
- </div>
1209
- <div class="statusbar ${l === "statusbar" ? "edge" : ""}" part="statusbar" ?hidden=${!this.has("statusbar")}><slot name="statusbar"></slot></div>
1210
- ${this.bottomNav ? this.renderBottomNav() : n}
1211
- ${this.renderNavDrawer()}
1212
- ${this.has("aside") ? this.renderAsideDrawer(i) : n}
1213
- ${this.asideMoves.length ? _(this.asideResizeLabel || this.t("resizePanel"), this.asideMoves) : n}
1214
- </div>`;
1215
- }
1216
- };
1217
- u("bk-shell-app", R);
1218
- export { R as BkShellApp, E as ShellAppToggleEvent };
2
+ export { t as BkShellApp, n as ShellAppToggleEvent } from "./chunks/bk-shell-app-B2lxHit8.js";