@bk2k/ui 0.6.8 → 0.7.0

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