@bk2k/ui 0.6.8 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUILDING.md +56 -2
- package/CHANGELOG.md +199 -0
- package/USAGE.md +102 -28
- package/custom-elements.json +1 -1
- package/dist/charts/chart-tokens.js +1 -1
- package/dist/charts/fields.d.ts +20 -0
- package/dist/charts/fields.js +27 -0
- package/dist/charts/frame.d.ts +2 -0
- package/dist/charts/frame.js +2 -1
- package/dist/clipboard.js +1 -0
- package/dist/components/bk-alert.js +3 -2
- package/dist/components/bk-avatar-group.js +4 -6
- package/dist/components/bk-avatar.d.ts +10 -0
- package/dist/components/bk-avatar.js +17 -0
- package/dist/components/bk-bar.js +2 -0
- package/dist/components/bk-button-group.js +1 -1
- package/dist/components/bk-button-top.js +2 -1
- package/dist/components/bk-button.d.ts +42 -14
- package/dist/components/bk-button.js +67 -20
- package/dist/components/bk-card.d.ts +7 -0
- package/dist/components/bk-card.js +21 -2
- package/dist/components/bk-carousel-controls.d.ts +2 -0
- package/dist/components/bk-carousel-controls.js +4 -2
- package/dist/components/bk-chart-area.d.ts +10 -0
- package/dist/components/bk-chart-bar.d.ts +17 -0
- package/dist/components/bk-chart-bar.js +25 -4
- package/dist/components/bk-chart-line.d.ts +28 -0
- package/dist/components/bk-chart-line.js +27 -7
- package/dist/components/bk-chip-group.d.ts +2 -2
- package/dist/components/bk-chip-group.js +4 -0
- package/dist/components/bk-chip.d.ts +55 -8
- package/dist/components/bk-chip.js +46 -8
- package/dist/components/bk-code.js +6 -2
- package/dist/components/bk-columns.d.ts +11 -0
- package/dist/components/bk-columns.js +8 -1
- package/dist/components/bk-combobox.d.ts +3 -3
- package/dist/components/bk-combobox.js +9 -21
- package/dist/components/bk-delta.d.ts +10 -0
- package/dist/components/bk-delta.js +8 -6
- package/dist/components/bk-dialog.d.ts +12 -5
- package/dist/components/bk-dialog.js +14 -6
- package/dist/components/bk-disclosure.js +4 -2
- package/dist/components/bk-drop-target.d.ts +7 -1
- package/dist/components/bk-drop-target.js +20 -4
- package/dist/components/bk-error-summary.d.ts +5 -0
- package/dist/components/bk-error-summary.js +13 -4
- package/dist/components/bk-facts.js +3 -2
- package/dist/components/bk-footnote.d.ts +73 -0
- package/dist/components/bk-footnote.js +97 -0
- package/dist/components/bk-footnotes-item.d.ts +92 -0
- package/dist/components/bk-footnotes-item.js +139 -0
- package/dist/components/bk-footnotes.d.ts +51 -0
- package/dist/components/bk-footnotes.js +43 -0
- package/dist/components/bk-icon.js +2 -2
- package/dist/components/bk-image-compare.d.ts +69 -6
- package/dist/components/bk-image-compare.js +116 -32
- package/dist/components/bk-image-crop.d.ts +3 -3
- package/dist/components/bk-image-editor.d.ts +1 -1
- package/dist/components/bk-image-viewer.d.ts +178 -11
- package/dist/components/bk-image-viewer.js +310 -52
- package/dist/components/bk-input-color.d.ts +2 -5
- package/dist/components/bk-input-color.js +0 -14
- package/dist/components/bk-input-file.d.ts +17 -0
- package/dist/components/bk-input-file.js +18 -8
- package/dist/components/bk-input-inline.d.ts +15 -6
- package/dist/components/bk-input-inline.js +22 -6
- package/dist/components/bk-input-number.js +2 -1
- package/dist/components/bk-input-search.d.ts +1 -1
- package/dist/components/bk-input-search.js +2 -1
- package/dist/components/bk-input-tags.d.ts +219 -0
- package/dist/components/bk-input-tags.js +293 -0
- package/dist/components/bk-input-text.d.ts +20 -0
- package/dist/components/bk-input-text.js +34 -4
- package/dist/components/bk-input-time.js +2 -1
- package/dist/components/bk-item.js +2 -1
- package/dist/components/bk-lightbox.d.ts +37 -4
- package/dist/components/bk-lightbox.js +13 -3
- package/dist/components/bk-link.d.ts +9 -1
- package/dist/components/bk-link.js +14 -4
- package/dist/components/bk-menu-item.d.ts +40 -0
- package/dist/components/bk-menu-item.js +57 -9
- package/dist/components/bk-menu-label.js +2 -1
- package/dist/components/bk-menu-list.d.ts +1 -0
- package/dist/components/bk-menu-list.js +10 -0
- package/dist/components/bk-menu.d.ts +8 -1
- package/dist/components/bk-menu.js +16 -5
- package/dist/components/bk-message-feedback.d.ts +4 -3
- package/dist/components/bk-message-feedback.js +7 -5
- package/dist/components/bk-message-list.js +2 -1
- package/dist/components/bk-message-source.d.ts +1 -2
- package/dist/components/bk-message-source.js +3 -11
- package/dist/components/bk-message.js +2 -0
- package/dist/components/bk-nav-group.js +1 -1
- package/dist/components/bk-nav-item.d.ts +18 -0
- package/dist/components/bk-nav-item.js +18 -5
- package/dist/components/bk-nav.d.ts +1 -1
- package/dist/components/bk-page-cta.d.ts +2 -0
- package/dist/components/bk-page-cta.js +10 -1
- package/dist/components/bk-page-section.d.ts +1 -1
- package/dist/components/bk-page-section.js +3 -9
- package/dist/components/bk-pane.d.ts +1 -0
- package/dist/components/bk-pane.js +7 -5
- package/dist/components/bk-panel.d.ts +1 -1
- package/dist/components/bk-panel.js +6 -5
- package/dist/components/bk-picture.d.ts +17 -4
- package/dist/components/bk-picture.js +8 -1
- package/dist/components/bk-segmented-item.d.ts +24 -4
- package/dist/components/bk-segmented-item.js +37 -5
- package/dist/components/bk-segmented.js +2 -13
- package/dist/components/bk-select-cascade.d.ts +1 -1
- package/dist/components/bk-select-tree.d.ts +1 -1
- package/dist/components/bk-select.d.ts +1 -1
- package/dist/components/bk-shell-app.d.ts +10 -4
- package/dist/components/bk-shell-app.js +32 -9
- package/dist/components/bk-shell-sites.d.ts +2 -1
- package/dist/components/bk-shell-sites.js +3 -5
- package/dist/components/bk-sortable.js +7 -17
- package/dist/components/bk-split-grid.d.ts +104 -3
- package/dist/components/bk-split-grid.js +430 -2
- package/dist/components/bk-stat-group.js +2 -1
- package/dist/components/bk-stat.d.ts +19 -0
- package/dist/components/bk-stat.js +8 -4
- package/dist/components/bk-steps.js +2 -1
- package/dist/components/bk-surface.d.ts +2 -0
- package/dist/components/bk-surface.js +6 -3
- package/dist/components/bk-table.d.ts +3 -1
- package/dist/components/bk-table.js +10 -13
- package/dist/components/bk-tabs-item.d.ts +45 -7
- package/dist/components/bk-tabs-item.js +51 -20
- package/dist/components/bk-tabs-panel.d.ts +6 -3
- package/dist/components/bk-tabs-panel.js +6 -0
- package/dist/components/bk-tabs.d.ts +52 -8
- package/dist/components/bk-tabs.js +181 -97
- package/dist/components/bk-text.js +2 -1
- package/dist/components/bk-toast-group.d.ts +3 -1
- package/dist/components/bk-toast-group.js +11 -1
- package/dist/components/bk-tooltip.d.ts +3 -1
- package/dist/components/bk-tooltip.js +2 -1
- package/dist/components/bk-video.js +2 -2
- package/dist/components/bk-zoom.d.ts +3 -1
- package/dist/components/confirm.d.ts +15 -0
- package/dist/components/confirm.js +27 -4
- package/dist/i18n/de.js +12 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n.d.ts +16 -2
- package/dist/i18n.js +28 -4
- package/dist/icons/brands-static.d.ts +3 -0
- package/dist/icons/brands-static.js +5 -0
- package/dist/icons/core.d.ts +1 -0
- package/dist/icons/core.js +2 -0
- package/dist/icons/load-static.d.ts +3 -0
- package/dist/icons/load-static.js +5 -0
- package/dist/icons/load.js +1 -0
- package/dist/icons/registry.js +1 -1
- package/dist/icons/set/save-as.d.ts +3 -0
- package/dist/icons/set/save-as.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/internal/announcer.d.ts +14 -1
- package/dist/internal/announcer.js +33 -12
- package/dist/internal/backdrop.d.ts +19 -0
- package/dist/internal/backdrop.js +29 -0
- package/dist/internal/busy.d.ts +3 -2
- package/dist/internal/busy.js +4 -5
- package/dist/internal/choice-field.js +1 -1
- package/dist/internal/choice-item.d.ts +17 -6
- package/dist/internal/choice-item.js +20 -9
- package/dist/internal/cloak.js +4 -0
- package/dist/internal/crop-frame.d.ts +1 -1
- package/dist/internal/crop-frame.js +2 -7
- package/dist/internal/date-field.js +2 -1
- package/dist/internal/define.d.ts +9 -0
- package/dist/internal/define.js +47 -1
- package/dist/internal/drag.d.ts +11 -0
- package/dist/internal/drag.js +23 -0
- package/dist/internal/elements.d.ts +6 -0
- package/dist/internal/elements.js +5 -0
- package/dist/internal/english-static.d.ts +3 -0
- package/dist/internal/english-static.js +5 -0
- package/dist/internal/english.d.ts +8 -0
- package/dist/internal/english.js +6 -0
- package/dist/internal/footnotes.d.ts +56 -0
- package/dist/internal/footnotes.js +143 -0
- package/dist/internal/handle-menu.js +2 -5
- package/dist/internal/hue.d.ts +8 -0
- package/dist/internal/hue.js +15 -4
- package/dist/internal/late/bk-shell-app.d.ts +4 -0
- package/dist/internal/late/bk-shell-app.js +7 -0
- package/dist/internal/late/bk-table.d.ts +4 -0
- package/dist/internal/late/bk-table.js +17 -0
- package/dist/internal/late/bk-tabs.d.ts +4 -0
- package/dist/internal/late/bk-tabs.js +8 -0
- package/dist/internal/late/handle-menu.d.ts +4 -0
- package/dist/internal/late/handle-menu.js +9 -0
- package/dist/internal/late/static.d.ts +7 -0
- package/dist/internal/late/static.js +5 -0
- package/dist/internal/late.d.ts +8 -3
- package/dist/internal/late.js +19 -4
- package/dist/internal/link.d.ts +2 -0
- package/dist/internal/link.js +11 -1
- package/dist/internal/own-text.d.ts +8 -0
- package/dist/internal/own-text.js +7 -0
- package/dist/internal/scope.js +1 -1
- package/dist/internal/scroll-lock.d.ts +4 -1
- package/dist/internal/scroll-lock.js +17 -4
- package/dist/internal/slider.js +2 -1
- package/dist/internal/styles.js +3 -0
- package/dist/internal/submit.d.ts +23 -0
- package/dist/internal/submit.js +57 -0
- package/dist/internal/tags.d.ts +15 -0
- package/dist/internal/tags.js +44 -0
- package/dist/internal/text-field.d.ts +2 -0
- package/dist/internal/text-field.js +8 -0
- package/dist/internal/toggle-control.js +3 -1
- package/dist/jsx.d.ts +222 -54
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +3 -0
- package/dist/reset.css +10 -0
- package/dist/standalone/all.js +226 -221
- package/dist/standalone/appearance.js +1 -1
- package/dist/standalone/bk-accordion-item.js +4 -4
- package/dist/standalone/bk-accordion.js +2 -2
- package/dist/standalone/bk-action-bar.js +3 -3
- package/dist/standalone/bk-alert-offline.js +1 -2
- package/dist/standalone/bk-alert.js +17 -13
- package/dist/standalone/bk-app-state.js +1 -1
- package/dist/standalone/bk-attachment.js +4 -4
- package/dist/standalone/bk-avatar-group.js +12 -10
- package/dist/standalone/bk-avatar.js +15 -5
- package/dist/standalone/bk-badge.js +2 -2
- package/dist/standalone/bk-bar.js +3 -1
- package/dist/standalone/bk-brand.js +3 -3
- package/dist/standalone/bk-breadcrumbs.js +5 -5
- package/dist/standalone/bk-button-copy.js +7 -7
- package/dist/standalone/bk-button-group.js +5 -5
- package/dist/standalone/bk-button-share.js +7 -7
- package/dist/standalone/bk-button-top.js +9 -8
- package/dist/standalone/bk-button.js +74 -34
- package/dist/standalone/bk-calendar-event.js +1 -1
- package/dist/standalone/bk-calendar-week.js +3 -3
- package/dist/standalone/bk-calendar.js +4 -4
- package/dist/standalone/bk-card.js +26 -7
- package/dist/standalone/bk-carousel-controls.js +7 -6
- package/dist/standalone/bk-carousel-item.js +2 -2
- package/dist/standalone/bk-carousel.js +1 -1
- package/dist/standalone/bk-chart-area.js +1 -1
- package/dist/standalone/bk-chart-bar-list.js +8 -8
- package/dist/standalone/bk-chart-bar.js +145 -117
- package/dist/standalone/bk-chart-bridge.js +7 -7
- package/dist/standalone/bk-chart-bullet.js +6 -6
- package/dist/standalone/bk-chart-calendar.js +7 -7
- package/dist/standalone/bk-chart-heatmap.js +7 -7
- package/dist/standalone/bk-chart-histogram.js +5 -5
- package/dist/standalone/bk-chart-legend.js +6 -6
- package/dist/standalone/bk-chart-line.js +128 -107
- package/dist/standalone/bk-chart-mark.js +1 -1
- package/dist/standalone/bk-chart-scatter.js +6 -6
- package/dist/standalone/bk-chart-sparkline.js +6 -6
- package/dist/standalone/bk-chart-stacked-bar.js +7 -7
- package/dist/standalone/bk-chart-tracker.js +6 -6
- package/dist/standalone/bk-chart-waterfall.js +6 -6
- package/dist/standalone/bk-checkbox-group.js +7 -7
- package/dist/standalone/bk-checkbox.js +4 -4
- package/dist/standalone/bk-chip-group.js +11 -7
- package/dist/standalone/bk-chip.js +59 -18
- package/dist/standalone/bk-cluster.js +1 -1
- package/dist/standalone/bk-code-diff.js +4 -4
- package/dist/standalone/bk-code-stack.js +4 -4
- package/dist/standalone/bk-code.js +10 -6
- package/dist/standalone/bk-color-panel.js +5 -5
- package/dist/standalone/bk-columns.js +13 -5
- package/dist/standalone/bk-combobox.js +23 -31
- package/dist/standalone/bk-command-menu.js +6 -6
- package/dist/standalone/bk-command-palette.js +8 -7
- package/dist/standalone/bk-composer.js +6 -6
- package/dist/standalone/bk-delta.js +11 -10
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-disclosure.js +7 -5
- package/dist/standalone/bk-divider.js +5 -5
- package/dist/standalone/bk-drawer.js +3 -3
- package/dist/standalone/bk-drop-target.js +12 -6
- package/dist/standalone/bk-empty-state.js +3 -3
- package/dist/standalone/bk-error-summary.js +9 -6
- package/dist/standalone/bk-facts-item.js +2 -2
- package/dist/standalone/bk-facts.js +9 -8
- package/dist/standalone/bk-feature.js +3 -3
- package/dist/standalone/bk-fieldset.js +3 -3
- package/dist/standalone/bk-filter-bar.js +4 -4
- package/dist/standalone/bk-folder-browser.js +4 -4
- package/dist/standalone/bk-footnote.js +82 -0
- package/dist/standalone/bk-footnotes-item.js +122 -0
- package/dist/standalone/bk-footnotes.js +37 -0
- package/dist/standalone/bk-form-guard.js +2 -2
- package/dist/standalone/bk-form-steps.js +3 -3
- package/dist/standalone/bk-grid.js +1 -1
- package/dist/standalone/bk-icon-tile.js +3 -3
- package/dist/standalone/bk-icon.js +1 -1
- package/dist/standalone/bk-image-compare.js +127 -58
- package/dist/standalone/bk-image-crop.js +6 -6
- package/dist/standalone/bk-image-editor.js +1 -1
- package/dist/standalone/bk-image-viewer.js +283 -92
- package/dist/standalone/bk-input-code.js +4 -4
- package/dist/standalone/bk-input-color.js +4 -14
- package/dist/standalone/bk-input-date-range.js +2 -2
- package/dist/standalone/bk-input-date.js +2 -2
- package/dist/standalone/bk-input-file.js +22 -15
- package/dist/standalone/bk-input-group.js +4 -4
- package/dist/standalone/bk-input-inline.js +17 -10
- package/dist/standalone/bk-input-number.js +9 -8
- package/dist/standalone/bk-input-rating.js +6 -6
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +23 -22
- package/dist/standalone/bk-input-slider-range.js +5 -5
- package/dist/standalone/bk-input-slider.js +5 -5
- package/dist/standalone/bk-input-tags.js +224 -0
- package/dist/standalone/bk-input-text.js +1 -1
- package/dist/standalone/bk-input-time-zone.js +1 -1
- package/dist/standalone/bk-input-time.js +29 -28
- package/dist/standalone/bk-item-group.js +3 -3
- package/dist/standalone/bk-item.js +12 -11
- package/dist/standalone/bk-kbd-shortcuts.js +4 -3
- package/dist/standalone/bk-kbd.js +68 -1
- package/dist/standalone/bk-lightbox.js +24 -7
- package/dist/standalone/bk-lines.js +1 -1
- package/dist/standalone/bk-link.js +33 -19
- package/dist/standalone/bk-listbox-columns.js +8 -8
- package/dist/standalone/bk-listbox-item.js +1 -1
- package/dist/standalone/bk-listbox-search.js +7 -7
- package/dist/standalone/bk-listbox-transfer.js +6 -6
- package/dist/standalone/bk-listbox.js +7 -7
- package/dist/standalone/bk-logo-wall.js +2 -2
- package/dist/standalone/bk-logo.js +4 -4
- package/dist/standalone/bk-menu-bar.js +3 -3
- package/dist/standalone/bk-menu-context.js +1 -1
- package/dist/standalone/bk-menu-divider.js +2 -2
- package/dist/standalone/bk-menu-item.js +73 -29
- package/dist/standalone/bk-menu-label.js +7 -6
- package/dist/standalone/bk-menu-list.js +10 -4
- package/dist/standalone/bk-menu.js +19 -10
- package/dist/standalone/bk-message-approval.js +4 -4
- package/dist/standalone/bk-message-branches.js +3 -3
- package/dist/standalone/bk-message-citation.js +10 -10
- package/dist/standalone/bk-message-feedback.js +10 -6
- package/dist/standalone/bk-message-list.js +6 -5
- package/dist/standalone/bk-message-reasoning.js +5 -5
- package/dist/standalone/bk-message-source.js +13 -21
- package/dist/standalone/bk-message-tool-group.js +5 -5
- package/dist/standalone/bk-message-tool.js +5 -5
- package/dist/standalone/bk-message.js +6 -4
- package/dist/standalone/bk-meter.js +3 -3
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-divider.js +2 -2
- package/dist/standalone/bk-nav-group.js +9 -9
- package/dist/standalone/bk-nav-item.js +31 -23
- package/dist/standalone/bk-nav-toc.js +3 -3
- package/dist/standalone/bk-nav.js +3 -3
- package/dist/standalone/bk-overflow.js +3 -3
- package/dist/standalone/bk-page-cta.js +13 -4
- package/dist/standalone/bk-page-footer-column.js +2 -2
- package/dist/standalone/bk-page-footer.js +3 -3
- package/dist/standalone/bk-page-header.js +3 -3
- package/dist/standalone/bk-page-hero.js +3 -3
- package/dist/standalone/bk-page-pager.js +5 -5
- package/dist/standalone/bk-page-section.js +6 -6
- package/dist/standalone/bk-pagination.js +6 -6
- package/dist/standalone/bk-pane.js +10 -9
- package/dist/standalone/bk-panel.js +9 -10
- package/dist/standalone/bk-period-nav.js +4 -4
- package/dist/standalone/bk-picture.js +1 -166
- package/dist/standalone/bk-popover-help.js +3 -3
- package/dist/standalone/bk-popover.js +2 -2
- package/dist/standalone/bk-presence-cursor.js +3 -3
- package/dist/standalone/bk-preview.js +4 -4
- package/dist/standalone/bk-progress.js +3 -3
- package/dist/standalone/bk-prose.js +3 -3
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +7 -7
- package/dist/standalone/bk-radio.js +3 -3
- package/dist/standalone/bk-rating.js +5 -5
- package/dist/standalone/bk-scroll.js +3 -3
- package/dist/standalone/bk-segmented-item.js +40 -16
- package/dist/standalone/bk-segmented.js +17 -15
- package/dist/standalone/bk-select-cascade.js +3 -3
- package/dist/standalone/bk-select-tree.js +4 -4
- package/dist/standalone/bk-select.js +5 -5
- package/dist/standalone/bk-shell-app.js +1 -1221
- package/dist/standalone/bk-shell-centered.js +2 -2
- package/dist/standalone/bk-shell-sites.js +5 -7
- package/dist/standalone/bk-skeleton.js +2 -2
- package/dist/standalone/bk-sortable.js +55 -60
- package/dist/standalone/bk-spinner.js +2 -2
- package/dist/standalone/bk-split-grid.js +324 -44
- package/dist/standalone/bk-split.js +8 -8
- package/dist/standalone/bk-stack.js +1 -1
- package/dist/standalone/bk-stat-group.js +8 -7
- package/dist/standalone/bk-stat.js +12 -9
- package/dist/standalone/bk-status-dot.js +3 -3
- package/dist/standalone/bk-steps-item.js +5 -5
- package/dist/standalone/bk-steps.js +8 -7
- package/dist/standalone/bk-surface.js +1 -1
- package/dist/standalone/bk-swatch-group.js +8 -8
- package/dist/standalone/bk-swatch-palette.js +1 -1
- package/dist/standalone/bk-swatch.js +2 -2
- package/dist/standalone/bk-switch.js +4 -4
- package/dist/standalone/bk-table.js +1 -1937
- package/dist/standalone/bk-tabs-item.js +58 -35
- package/dist/standalone/bk-tabs-panel.js +7 -3
- package/dist/standalone/bk-tabs.js +3 -352
- package/dist/standalone/bk-tasks-item.js +4 -4
- package/dist/standalone/bk-tasks.js +2 -2
- package/dist/standalone/bk-testimonial.js +3 -3
- package/dist/standalone/bk-text.js +21 -20
- package/dist/standalone/bk-time-countdown.js +4 -4
- package/dist/standalone/bk-time-relative.js +3 -3
- package/dist/standalone/bk-timeline-item.js +4 -4
- package/dist/standalone/bk-timeline.js +2 -2
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +4 -4
- package/dist/standalone/bk-toolbar.js +2 -2
- package/dist/standalone/bk-tooltip.js +8 -7
- package/dist/standalone/bk-tree-item.js +6 -6
- package/dist/standalone/bk-tree.js +5 -5
- package/dist/standalone/bk-video.js +6 -6
- package/dist/standalone/bk-visually-hidden.js +2 -2
- package/dist/standalone/bk-zoom.js +5 -5
- package/dist/standalone/chunks/announcer-6tMlCOq1.js +41 -0
- package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
- package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-hCLuG-RM.js} +3 -3
- package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-_dudBMVq.js} +4 -4
- package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-BB2odomE.js} +5 -5
- package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DcvwnOtN.js} +59 -25
- package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-D4kI4F18.js} +4 -3
- package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-SRVkHI-4.js} +5 -5
- package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-AmDv87E5.js} +6 -6
- package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-2n89GDIT.js} +73 -54
- package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-BoNYBd6W.js} +4 -4
- package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
- package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CSFfc8As.js} +3 -3
- package/dist/standalone/chunks/bk-shell-app-BlCOG25y.js +1236 -0
- package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-BULRdKam.js} +9 -7
- package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-Cqj85tSW.js} +6 -6
- package/dist/standalone/chunks/bk-table-DWlD7yoM.js +1945 -0
- package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
- package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-5nZg7BaJ.js} +27 -24
- package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
- package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-eG3uHonz.js} +5 -4
- package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
- package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-B0oe_9fI.js} +6 -6
- package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
- package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
- package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
- package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
- package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-Dy1_qxNv.js} +48 -47
- package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
- package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
- package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
- package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-Bmk0SRDX.js} +2 -2
- package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
- package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BAe9fPYJ.js} +14 -33
- package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-B2kF-b8p.js} +1 -1
- package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
- package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
- package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
- package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
- package/dist/standalone/chunks/link--YWr8exL.js +69 -0
- package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
- package/dist/standalone/chunks/{options-DMEc8rQt.js → options-ySaDL-dW.js} +2 -2
- package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
- package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
- package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
- package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
- package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
- package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
- package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
- package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
- package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BAUc_LqI.js} +1 -1
- package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
- package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
- package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
- package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
- package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CufOGdfr.js} +17 -11
- package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-Cgqp1jhf.js} +5 -3
- package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
- package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-D-qgACnE.js} +1 -1
- package/dist/standalone/confirm.js +27 -14
- package/dist/standalone/i18n-de.js +13 -2
- package/dist/standalone/icons.js +100 -98
- package/dist/standalone/links.js +1 -1
- package/dist/standalone/reset.css +10 -0
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +6 -5
- package/dist/tokens.css +6 -5
- package/dist/tokens.js +4 -3
- package/package.json +25 -2
- package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
- package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
- package/dist/standalone/chunks/define-CzVPD4Zi.js +0 -30
- package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
- package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
- package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
1
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
2
2
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
3
|
import { controlsList } from "../internal/anchor.js";
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
5
|
import { LinkController } from "../internal/link.js";
|
|
6
|
-
import { base } from "../internal/styles.js";
|
|
6
|
+
import { base, srOnly } from "../internal/styles.js";
|
|
7
|
+
import { LocalizeController } from "../i18n.js";
|
|
8
|
+
import "./bk-icon.js";
|
|
9
|
+
import "../icons/set/external.js";
|
|
7
10
|
class BkLink extends LitElement {
|
|
8
11
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
9
12
|
static properties = {
|
|
@@ -15,6 +18,7 @@ class BkLink extends LitElement {
|
|
|
15
18
|
};
|
|
16
19
|
forwarded = { haspopup: null, expanded: null, description: null };
|
|
17
20
|
links = new LinkController(this);
|
|
21
|
+
i18n = new LocalizeController(this);
|
|
18
22
|
constructor() {
|
|
19
23
|
super();
|
|
20
24
|
this.variant = "standalone";
|
|
@@ -30,7 +34,7 @@ class BkLink extends LitElement {
|
|
|
30
34
|
};
|
|
31
35
|
this.requestUpdate();
|
|
32
36
|
}
|
|
33
|
-
static styles = [base, css`
|
|
37
|
+
static styles = [base, srOnly, css`
|
|
34
38
|
:host { display: inline; white-space: nowrap; }
|
|
35
39
|
a {
|
|
36
40
|
color: var(--bk-link-fg, var(--bk-accent-text));
|
|
@@ -57,6 +61,12 @@ class BkLink extends LitElement {
|
|
|
57
61
|
@media (hover: hover) {
|
|
58
62
|
:host([variant="title"]) a:hover { color: var(--bk-link-title-hover-fg, inherit); text-decoration-color: currentColor; }
|
|
59
63
|
}
|
|
64
|
+
/* A link that opens a new tab: the icon after the text, on the baseline side of the line, without an underline. */
|
|
65
|
+
.new-tab {
|
|
66
|
+
display: inline-block; vertical-align: baseline; margin-inline-start: var(--bk-link-new-tab-gap, var(--bk-space-1));
|
|
67
|
+
--bk-icon-size: var(--bk-link-new-tab-size, var(--bk-icon-xs)); color: inherit;
|
|
68
|
+
}
|
|
69
|
+
:host(:dir(rtl)) .new-tab { scale: -1 1; }
|
|
60
70
|
a:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset); }
|
|
61
71
|
@media (forced-colors: active) { a { color: LinkText; } a:focus-visible { outline-color: Highlight; } }
|
|
62
72
|
`];
|
|
@@ -66,7 +76,7 @@ class BkLink extends LitElement {
|
|
|
66
76
|
rel=${ifDefined(this.rel ?? (this.target === "_blank" ? "noopener noreferrer" : void 0))}
|
|
67
77
|
download=${ifDefined(this.download)} aria-haspopup=${ifDefined(f.haspopup ?? void 0)}
|
|
68
78
|
aria-expanded=${ifDefined(f.expanded === null ? void 0 : String(f.expanded))}
|
|
69
|
-
.ariaControlsElements=${controlsList(f.controls)} aria-description=${ifDefined(f.description ?? void 0)}><slot></slot></a>`;
|
|
79
|
+
.ariaControlsElements=${controlsList(f.controls)} aria-description=${ifDefined(f.description ?? void 0)}><slot></slot>${this.target === "_blank" ? html`<bk-icon class="new-tab" part="new-tab" name="external"></bk-icon><span class="sr-only">${this.i18n.t("opensInNewTab")}</span>` : nothing}</a>`;
|
|
70
80
|
}
|
|
71
81
|
}
|
|
72
82
|
define("bk-link", BkLink);
|
|
@@ -3,10 +3,17 @@ import "./bk-icon.js";
|
|
|
3
3
|
import "./bk-kbd.js";
|
|
4
4
|
import "../icons/set/check.js";
|
|
5
5
|
import "../icons/set/chevron-right.js";
|
|
6
|
+
import "../icons/set/close.js";
|
|
6
7
|
import "../icons/set/description.js";
|
|
8
|
+
import "../icons/set/external.js";
|
|
7
9
|
import "../icons/set/label.js";
|
|
8
10
|
import "../icons/set/menu.js";
|
|
9
11
|
export type { NavigateDetail } from "../internal/link.js";
|
|
12
|
+
export interface MenuItemRemoveDetail {
|
|
13
|
+
/** The `value` of the item (or its label text when it has none). */
|
|
14
|
+
value: string;
|
|
15
|
+
item: BkMenuItem;
|
|
16
|
+
}
|
|
10
17
|
/**
|
|
11
18
|
* One entry of a `<bk-menu-list>` (and so of a `<bk-menu>`, which shows the list in a popover).
|
|
12
19
|
*
|
|
@@ -27,6 +34,9 @@ export type { NavigateDetail } from "../internal/link.js";
|
|
|
27
34
|
* `variant="tiles"`, the item is a tile: its `preview` (a small picture of the choice) is above the label,
|
|
28
35
|
* and the label is the caption.
|
|
29
36
|
*
|
|
37
|
+
* A link with `target="_blank"` shows the `external` icon after the label, and a screen reader hears "(opens in a new
|
|
38
|
+
* tab)" (i18n `opensInNewTab`). To hide the icon, set `bk-menu-item::part(new-tab) { display: none }`; the text stays.
|
|
39
|
+
*
|
|
30
40
|
* **Submenu**: a `<bk-menu-list>` in the `submenu` slot makes the item a submenu parent. It shows a chevron at
|
|
31
41
|
* its end and `aria-haspopup="menu"` + `aria-expanded`. →, Enter and Space open the submenu and focus its first item
|
|
32
42
|
* (← in RTL). ← or Esc inside the submenu close it and return to the parent item. When the user hovers the item, the submenu opens after a short
|
|
@@ -34,6 +44,12 @@ export type { NavigateDetail } from "../internal/link.js";
|
|
|
34
44
|
* the submenu fires `select` like any item. Choosing the parent only opens the submenu. It works in `<bk-menu>` and in an inline
|
|
35
45
|
* `<bk-menu-list>`. The submenu is an overlay panel beside the item.
|
|
36
46
|
*
|
|
47
|
+
* **Removable**: `removable` adds a remove button at the end of the row, for example for each entry of a history.
|
|
48
|
+
* A click on it, or the Delete key on the focused item, fires `remove` (bubbles, composed). The click does not choose
|
|
49
|
+
* the item. The app removes the item; the list first moves the focus to the next item. The button is a pointer target
|
|
50
|
+
* only (a menu item cannot contain a control): the keyboard uses Delete. The item announces this with
|
|
51
|
+
* `aria-keyshortcuts="Delete"` and the description "Press Delete to remove".
|
|
52
|
+
*
|
|
37
53
|
* @slot - Label.
|
|
38
54
|
* @slot submenu - A `<bk-menu-list>` that opens beside the item.
|
|
39
55
|
* @slot description - Second line under the label instead of `description`.
|
|
@@ -48,6 +64,8 @@ export type { NavigateDetail } from "../internal/link.js";
|
|
|
48
64
|
* @csspart shortcut - The shortcut hint (a `<bk-kbd>` for keys).
|
|
49
65
|
* @csspart description - The second line.
|
|
50
66
|
* @csspart preview - The box around the preview of a tile.
|
|
67
|
+
* @csspart remove - The remove button of a `removable` item.
|
|
68
|
+
* @csspart new-tab - The icon after the label of a link with `target="_blank"`.
|
|
51
69
|
* @cssprop --bk-menu-item-height - Minimum height (default --bk-row-height).
|
|
52
70
|
* @cssprop --bk-menu-item-start-size - Minimum width of the `start` column (default --bk-icon-sm, the icon size).
|
|
53
71
|
* @cssprop --bk-menu-item-padding - Padding (default the row padding of the menu, --bk-row-pad-inline inline).
|
|
@@ -77,12 +95,18 @@ export type { NavigateDetail } from "../internal/link.js";
|
|
|
77
95
|
* @cssprop --bk-menu-submenu-max-height - Maximum height before the submenu scrolls (default --bk-popup-height-md).
|
|
78
96
|
* @cssprop --bk-menu-item-chevron-color - Colour of the submenu chevron (default --bk-text-muted).
|
|
79
97
|
* @cssprop --bk-menu-item-danger-hover-bg - Hovered or focused background of `tone="danger"` (default --bk-danger-soft).
|
|
98
|
+
* @cssprop --bk-menu-item-new-tab-size - Size of the icon of a link with `target="_blank"` (default --bk-icon-xs).
|
|
99
|
+
* @cssprop --bk-menu-item-remove-size - Size of the remove button (default --bk-space-6).
|
|
100
|
+
* @cssprop --bk-menu-item-remove-fg - Colour of the remove button (default --bk-text-muted).
|
|
101
|
+
* @cssprop --bk-menu-item-remove-hover-bg - Background of the hovered remove button (default --bk-hover).
|
|
80
102
|
* @fires {MouseEvent} click - Native click. Does not fire while the item is disabled.
|
|
103
|
+
* @fires {CustomEvent<MenuItemRemoveDetail>} remove - The user removes a `removable` item (remove button or Delete). Bubbles, composed; `detail` is `{ value, item }`.
|
|
81
104
|
*
|
|
82
105
|
* @fires {CustomEvent<NavigateDetail>} navigate - The user makes a plain click on the link (primary button, no modifier key, no other `target`, no `download`). `detail.href` is the resolved address. The event bubbles, is composed and is cancelable. `preventDefault()` stops the browser, and the router of the app takes over.
|
|
83
106
|
* @tag bk-menu-item
|
|
84
107
|
* @keyboard → - Open the submenu and move to its first item. The arrow follows the writing direction.
|
|
85
108
|
* @keyboard ←, Escape - In the submenu: close the submenu and return to its item.
|
|
109
|
+
* @keyboard Delete - On a `removable` item: fire `remove`.
|
|
86
110
|
*/
|
|
87
111
|
export declare class BkMenuItem extends LitElement {
|
|
88
112
|
static shadowRootOptions: ShadowRootInit;
|
|
@@ -120,6 +144,13 @@ export declare class BkMenuItem extends LitElement {
|
|
|
120
144
|
type: BooleanConstructor;
|
|
121
145
|
reflect: boolean;
|
|
122
146
|
};
|
|
147
|
+
removable: {
|
|
148
|
+
type: BooleanConstructor;
|
|
149
|
+
reflect: boolean;
|
|
150
|
+
};
|
|
151
|
+
removeLabel: {
|
|
152
|
+
attribute: string;
|
|
153
|
+
};
|
|
123
154
|
tabStop: {
|
|
124
155
|
attribute: boolean;
|
|
125
156
|
};
|
|
@@ -159,6 +190,10 @@ export declare class BkMenuItem extends LitElement {
|
|
|
159
190
|
shortcut: string | undefined;
|
|
160
191
|
/** Second line under the label. */
|
|
161
192
|
description: string | undefined;
|
|
193
|
+
/** Shows a remove button; the item fires `remove` on it and on Delete. */
|
|
194
|
+
removable: boolean;
|
|
195
|
+
/** Name of the remove button (default "Remove {item}"). */
|
|
196
|
+
removeLabel: string | undefined;
|
|
162
197
|
/** Tile look. A `variant="tiles"` list sets it. Do not set it yourself. */
|
|
163
198
|
tile: boolean;
|
|
164
199
|
/** The list that contains the item sets it: this item is the Tab stop of the list (roving tabindex). */
|
|
@@ -175,6 +210,7 @@ export declare class BkMenuItem extends LitElement {
|
|
|
175
210
|
private edge;
|
|
176
211
|
private owner;
|
|
177
212
|
private links;
|
|
213
|
+
private i18n;
|
|
178
214
|
constructor();
|
|
179
215
|
disconnectedCallback(): void;
|
|
180
216
|
/** Whether the item has a submenu. */
|
|
@@ -205,6 +241,10 @@ export declare class BkMenuItem extends LitElement {
|
|
|
205
241
|
get effectiveValue(): string;
|
|
206
242
|
private get control();
|
|
207
243
|
focus(options?: FocusOptions): void;
|
|
244
|
+
/** Asks to remove the item: fires `remove`. Does nothing unless the item is `removable` and enabled. */
|
|
245
|
+
requestRemove(): void;
|
|
246
|
+
/** A click on the remove button removes the item and does not choose it. */
|
|
247
|
+
private onRemoveClick;
|
|
208
248
|
/** Clicks the inner row, so a link item navigates like a real link. */
|
|
209
249
|
click(): void;
|
|
210
250
|
static styles: import("lit").CSSResult[];
|
|
@@ -4,14 +4,19 @@ import { define } from "../internal/define.js";
|
|
|
4
4
|
import { LinkController } from "../internal/link.js";
|
|
5
5
|
import { anchorPopover, popupOffset } from "../internal/anchor.js";
|
|
6
6
|
import { SlotController } from "../internal/slots.js";
|
|
7
|
-
import { base, popupMotion, popupSurface } from "../internal/styles.js";
|
|
7
|
+
import { base, popupMotion, popupSurface, srOnly } from "../internal/styles.js";
|
|
8
8
|
import { ariaKeyShortcuts, isKeys } from "../shortcuts.js";
|
|
9
9
|
import "./bk-icon.js";
|
|
10
10
|
import "./bk-kbd.js";
|
|
11
11
|
import { lightDom } from "../internal/server.js";
|
|
12
|
+
import { ownText } from "../internal/own-text.js";
|
|
13
|
+
import { emitDetail } from "../internal/events.js";
|
|
14
|
+
import { LocalizeController } from "../i18n.js";
|
|
12
15
|
import "../icons/set/check.js";
|
|
13
16
|
import "../icons/set/chevron-right.js";
|
|
17
|
+
import "../icons/set/close.js";
|
|
14
18
|
import "../icons/set/description.js";
|
|
19
|
+
import "../icons/set/external.js";
|
|
15
20
|
import "../icons/set/label.js";
|
|
16
21
|
import "../icons/set/menu.js";
|
|
17
22
|
const openSubmenus = /* @__PURE__ */ new Set();
|
|
@@ -42,6 +47,8 @@ class BkMenuItem extends LitElement {
|
|
|
42
47
|
shortcut: {},
|
|
43
48
|
description: {},
|
|
44
49
|
tile: { type: Boolean, reflect: true },
|
|
50
|
+
removable: { type: Boolean, reflect: true },
|
|
51
|
+
removeLabel: { attribute: "remove-label" },
|
|
45
52
|
tabStop: { attribute: false },
|
|
46
53
|
expanded: { state: true }
|
|
47
54
|
};
|
|
@@ -55,6 +62,7 @@ class BkMenuItem extends LitElement {
|
|
|
55
62
|
edge = null;
|
|
56
63
|
owner = null;
|
|
57
64
|
links = new LinkController(this);
|
|
65
|
+
i18n = new LocalizeController(this);
|
|
58
66
|
constructor() {
|
|
59
67
|
super();
|
|
60
68
|
this.value = "";
|
|
@@ -65,6 +73,7 @@ class BkMenuItem extends LitElement {
|
|
|
65
73
|
this.disabled = false;
|
|
66
74
|
this.name = "";
|
|
67
75
|
this.tile = false;
|
|
76
|
+
this.removable = false;
|
|
68
77
|
this.tabStop = false;
|
|
69
78
|
this.expanded = false;
|
|
70
79
|
this.internals = this.attachInternals();
|
|
@@ -179,6 +188,11 @@ class BkMenuItem extends LitElement {
|
|
|
179
188
|
};
|
|
180
189
|
onRowPointerLeave = () => clearTimeout(this.openTimer);
|
|
181
190
|
onKeydown = (e) => {
|
|
191
|
+
if (e.key === "Delete" && this.removable && !this.disabled && !e.defaultPrevented && this.control && e.composedPath()[0] === this.control) {
|
|
192
|
+
e.preventDefault();
|
|
193
|
+
this.requestRemove();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
182
196
|
if (!this.hasSubmenu || this.disabled || e.defaultPrevented)
|
|
183
197
|
return;
|
|
184
198
|
const rtl = this.matches(":dir(rtl)");
|
|
@@ -210,7 +224,7 @@ class BkMenuItem extends LitElement {
|
|
|
210
224
|
};
|
|
211
225
|
/** The label text for typeahead (without the content of the named slots). */
|
|
212
226
|
get text() {
|
|
213
|
-
return
|
|
227
|
+
return ownText(this).replace(/\s+/g, " ").trim();
|
|
214
228
|
}
|
|
215
229
|
/** The second line as text: `description` or the description slot. */
|
|
216
230
|
get descriptionText() {
|
|
@@ -231,6 +245,18 @@ class BkMenuItem extends LitElement {
|
|
|
231
245
|
else
|
|
232
246
|
super.focus(options);
|
|
233
247
|
}
|
|
248
|
+
/** Asks to remove the item: fires `remove`. Does nothing unless the item is `removable` and enabled. */
|
|
249
|
+
requestRemove() {
|
|
250
|
+
if (!this.removable || this.disabled)
|
|
251
|
+
return;
|
|
252
|
+
emitDetail(this, "remove", { value: this.effectiveValue, item: this });
|
|
253
|
+
}
|
|
254
|
+
/** A click on the remove button removes the item and does not choose it. */
|
|
255
|
+
onRemoveClick = (e) => {
|
|
256
|
+
e.preventDefault();
|
|
257
|
+
e.stopPropagation();
|
|
258
|
+
this.requestRemove();
|
|
259
|
+
};
|
|
234
260
|
/** Clicks the inner row, so a link item navigates like a real link. */
|
|
235
261
|
click() {
|
|
236
262
|
const c = this.control;
|
|
@@ -239,7 +265,7 @@ class BkMenuItem extends LitElement {
|
|
|
239
265
|
else
|
|
240
266
|
super.click();
|
|
241
267
|
}
|
|
242
|
-
static styles = [base, popupSurface, popupMotion, css`
|
|
268
|
+
static styles = [base, srOnly, popupSurface, popupMotion, css`
|
|
243
269
|
:host {
|
|
244
270
|
display: block;
|
|
245
271
|
--_bk-menu-item-fg: var(--bk-menu-item-fg, var(--bk-text));
|
|
@@ -251,8 +277,9 @@ class BkMenuItem extends LitElement {
|
|
|
251
277
|
--_bk-menu-item-icon: var(--bk-menu-item-danger-fg, var(--bk-danger-text));
|
|
252
278
|
--_bk-menu-item-highlight: var(--bk-menu-item-danger-hover-bg, var(--bk-danger-soft));
|
|
253
279
|
}
|
|
280
|
+
/* A containing block: the text for a screen reader (sr-only) does not escape it and scroll the menu. */
|
|
254
281
|
.item {
|
|
255
|
-
display: flex; align-items: center; gap: var(--bk-menu-item-gap, var(--bk-row-gap));
|
|
282
|
+
position: relative; display: flex; align-items: center; gap: var(--bk-menu-item-gap, var(--bk-row-gap));
|
|
256
283
|
min-height: var(--bk-menu-item-height, var(--bk-row-height)); padding: var(--bk-menu-item-padding, var(--_bk-menu-row-pad, var(--bk-row-pad)) var(--bk-row-pad-inline));
|
|
257
284
|
padding-inline-end: var(--bk-menu-item-padding-end, var(--bk-row-pad-inline));
|
|
258
285
|
border-radius: var(--bk-menu-item-radius, var(--bk-row-radius));
|
|
@@ -276,6 +303,8 @@ class BkMenuItem extends LitElement {
|
|
|
276
303
|
font-size: var(--bk-menu-item-description-font-size, var(--bk-text-sm)); color: var(--bk-menu-item-description-color, var(--bk-text-muted));
|
|
277
304
|
}
|
|
278
305
|
.description[hidden], .preview[hidden] { display: none; }
|
|
306
|
+
.new-tab { flex: none; --bk-icon-size: var(--bk-menu-item-new-tab-size, var(--bk-icon-xs)); color: var(--_bk-menu-item-icon); }
|
|
307
|
+
:host(:dir(rtl)) .new-tab { scale: -1 1; }
|
|
279
308
|
/* Tile: the preview above the label as its caption. */
|
|
280
309
|
:host([tile]) .item {
|
|
281
310
|
flex-direction: column; justify-content: start; gap: var(--bk-space-1); padding: var(--bk-menu-item-tile-padding, var(--bk-space-1-5));
|
|
@@ -308,13 +337,25 @@ class BkMenuItem extends LitElement {
|
|
|
308
337
|
bk-kbd.shortcut { --bk-kbd-fg: var(--bk-menu-item-shortcut-color, var(--bk-text-muted)); margin-block: calc(-1 * var(--bk-space-0)); }
|
|
309
338
|
.chevron { flex: none; margin-inline-start: var(--bk-space-2); color: var(--bk-menu-item-chevron-color, var(--bk-text-muted)); --bk-icon-size: var(--bk-icon-sm); }
|
|
310
339
|
:host(:dir(rtl)) .chevron { scale: -1 1; }
|
|
340
|
+
/* The remove button: a pointer target at the end of the row. The row keeps its height. */
|
|
341
|
+
.remove {
|
|
342
|
+
flex: none; display: inline-grid; place-items: center; position: relative;
|
|
343
|
+
inline-size: var(--bk-menu-item-remove-size, var(--bk-space-6)); block-size: var(--bk-menu-item-remove-size, var(--bk-space-6));
|
|
344
|
+
margin-block: calc(-1 * var(--bk-space-1)); border-radius: var(--bk-radius-sm);
|
|
345
|
+
color: var(--bk-menu-item-remove-fg, var(--bk-text-muted)); cursor: pointer;
|
|
346
|
+
transition: background-color var(--bk-duration-fast), color var(--bk-duration-fast);
|
|
347
|
+
}
|
|
348
|
+
.remove bk-icon { color: inherit; --bk-icon-size: var(--bk-icon-xs); }
|
|
349
|
+
.remove::before { content: ""; position: absolute; inset-inline: 0; inset-block: min(0px, calc((100% - var(--bk-target-min)) / 2)); }
|
|
350
|
+
@media (hover: hover) { .remove:hover { background: var(--bk-menu-item-remove-hover-bg, var(--bk-hover)); color: var(--bk-text); } }
|
|
351
|
+
.remove:active { background: var(--bk-menu-item-pressed-bg, var(--bk-pressed)); }
|
|
311
352
|
/* The parent of an open submenu keeps its highlight while focus is in the submenu. */
|
|
312
353
|
.item.open { background: var(--_bk-menu-item-highlight); }
|
|
313
354
|
.submenu {
|
|
314
355
|
--_bk-popup-bg: var(--bk-menu-submenu-bg, var(--bk-menu-bg));
|
|
315
356
|
--_bk-popup-fg: var(--bk-menu-fg);
|
|
316
357
|
--_bk-popup-border: var(--bk-menu-submenu-border, var(--bk-menu-border));
|
|
317
|
-
--_bk-popup-radius: var(--bk-menu-submenu-radius, var(--bk-menu-radius));
|
|
358
|
+
--_bk-popup-radius: var(--bk-menu-submenu-radius, var(--bk-menu-radius, var(--_bk-popup-row-radius)));
|
|
318
359
|
--_bk-popup-shadow: var(--bk-menu-submenu-shadow, var(--bk-menu-shadow));
|
|
319
360
|
--_bk-popup-padding: var(--bk-menu-submenu-padding, var(--bk-menu-padding));
|
|
320
361
|
--_bk-popup-offset: var(--bk-menu-submenu-offset);
|
|
@@ -342,12 +383,18 @@ class BkMenuItem extends LitElement {
|
|
|
342
383
|
const checkable = this.type === "checkbox" || this.type === "radio";
|
|
343
384
|
const role = this.type === "checkbox" ? "menuitemcheckbox" : this.type === "radio" ? "menuitemradio" : "menuitem";
|
|
344
385
|
const combo = isKeys(this.shortcut);
|
|
345
|
-
const
|
|
386
|
+
const removable = this.removable && !this.disabled;
|
|
387
|
+
const keys = [combo ? ariaKeyShortcuts(this.shortcut) : "", removable ? "Delete" : ""].filter(Boolean).join(" ");
|
|
388
|
+
const keyshortcuts = keys || nothing;
|
|
389
|
+
const hint = removable ? this.i18n.t("menuItemRemoveHint") : nothing;
|
|
390
|
+
const remove = removable ? html`<span class="remove" part="remove" aria-hidden="true" title=${this.removeLabel || this.i18n.t("menuItemRemove", { item: this.text })}
|
|
391
|
+
@click=${this.onRemoveClick}><bk-icon name="close"></bk-icon></span>` : nothing;
|
|
346
392
|
const inner = html`
|
|
347
393
|
${checkable ? html`<bk-icon class="check" part="check" name="check"></bk-icon>` : nothing}
|
|
348
394
|
<span class="preview" part="preview" ?hidden=${!this.tile}><slot name="preview"></slot></span>
|
|
349
395
|
<span class="start" ?hidden=${!this.icon && !this.hasStart}><slot name="start" @slotchange=${() => this.requestUpdate()}>${this.icon ? html`<bk-icon name=${this.icon}></bk-icon>` : nothing}</slot></span>
|
|
350
396
|
<span class="text"><span class="label"><slot></slot></span><span class="description" part="description" ?hidden=${!this.hasDescription}><slot name="description" @slotchange=${() => this.requestUpdate()}>${this.description}</slot></span></span>
|
|
397
|
+
${this.href && this.target === "_blank" && !this.disabled ? html`<bk-icon class="new-tab" part="new-tab" name="external"></bk-icon><span class="sr-only">${this.i18n.t("opensInNewTab")}</span>` : nothing}
|
|
351
398
|
<slot name="end">${!this.shortcut ? nothing : combo ? html`<bk-kbd class="shortcut" part="shortcut" size="sm" keys=${this.shortcut} aria-hidden="true"></bk-kbd>` : html`<span class="shortcut" part="shortcut">${this.shortcut}</span>`}</slot>`;
|
|
352
399
|
const tabindex = this.tabStop && !this.disabled ? "0" : "-1";
|
|
353
400
|
const sub = this.hasSubmenu;
|
|
@@ -359,13 +406,14 @@ class BkMenuItem extends LitElement {
|
|
|
359
406
|
if (this.href && !this.disabled) {
|
|
360
407
|
return html`<a class=${cls} part="item" role=${role} tabindex=${tabindex} href=${this.links.href(this.href)} @click=${this.links.click} target=${ifDefined(this.target)}
|
|
361
408
|
rel=${ifDefined(this.rel ?? (this.target === "_blank" ? "noopener noreferrer" : void 0))} download=${ifDefined(this.download)}
|
|
362
|
-
aria-checked=${checkable ? String(this.checked) : nothing} aria-current=${this.current ? "true" : nothing} aria-keyshortcuts=${keyshortcuts}
|
|
409
|
+
aria-checked=${checkable ? String(this.checked) : nothing} aria-current=${this.current ? "true" : nothing} aria-keyshortcuts=${keyshortcuts}
|
|
410
|
+
aria-description=${hint}>${inner}${remove}</a>${panel}`;
|
|
363
411
|
}
|
|
364
412
|
return html`<div class=${cls} part="item" role=${role} tabindex=${tabindex}
|
|
365
413
|
aria-checked=${checkable ? String(this.checked) : nothing} aria-disabled=${this.disabled ? "true" : nothing}
|
|
366
414
|
aria-haspopup=${popup} aria-expanded=${expanded}
|
|
367
|
-
aria-current=${this.current ? "true" : nothing} aria-keyshortcuts=${keyshortcuts}
|
|
368
|
-
@pointerenter=${this.onRowPointerEnter} @pointerleave=${this.onRowPointerLeave}>${inner}${chevron}</div>${panel}`;
|
|
415
|
+
aria-current=${this.current ? "true" : nothing} aria-keyshortcuts=${keyshortcuts} aria-description=${hint}
|
|
416
|
+
@pointerenter=${this.onRowPointerEnter} @pointerleave=${this.onRowPointerLeave}>${inner}${remove}${chevron}</div>${panel}`;
|
|
369
417
|
}
|
|
370
418
|
}
|
|
371
419
|
define("bk-menu-item", BkMenuItem);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
3
|
import { base, groupLabel } from "../internal/styles.js";
|
|
4
|
+
import { ownText } from "../internal/own-text.js";
|
|
4
5
|
class BkMenuLabel extends LitElement {
|
|
5
6
|
constructor() {
|
|
6
7
|
super();
|
|
@@ -9,7 +10,7 @@ class BkMenuLabel extends LitElement {
|
|
|
9
10
|
}
|
|
10
11
|
/** The heading text, without the content of the named slots (what a filtering menu searches). */
|
|
11
12
|
get text() {
|
|
12
|
-
return
|
|
13
|
+
return ownText(this).replace(/\s+/g, " ").trim();
|
|
13
14
|
}
|
|
14
15
|
static styles = [base, groupLabel, css`
|
|
15
16
|
/* In a grid of tiles a heading spans the whole row; in a list it is a row anyway. */
|
|
@@ -71,6 +71,7 @@ export declare class BkMenuList extends LitElement {
|
|
|
71
71
|
/** The item that is the Tab stop. */
|
|
72
72
|
private current;
|
|
73
73
|
constructor();
|
|
74
|
+
private onRemove;
|
|
74
75
|
static styles: import("lit").CSSResult[];
|
|
75
76
|
/** The items of this list (not of nested menus), in order; works for slotted (re-slotted) children too. */
|
|
76
77
|
get items(): BkMenuItem[];
|
|
@@ -41,6 +41,16 @@ class BkMenuList extends LitElement {
|
|
|
41
41
|
if (item)
|
|
42
42
|
this.setTabStop(item);
|
|
43
43
|
});
|
|
44
|
+
this.addEventListener("remove", (e) => this.onRemove(e), true);
|
|
45
|
+
}
|
|
46
|
+
onRemove(e) {
|
|
47
|
+
const item = this.itemFromEvent(e);
|
|
48
|
+
if (!item || !item.matches(":focus-within"))
|
|
49
|
+
return;
|
|
50
|
+
const items = this.enabledItems;
|
|
51
|
+
const i = items.indexOf(item);
|
|
52
|
+
const next = items[i + 1] ?? items[i - 1];
|
|
53
|
+
next?.focus();
|
|
44
54
|
}
|
|
45
55
|
static styles = [base, css`
|
|
46
56
|
:host {
|
|
@@ -50,6 +50,8 @@ export type { MenuSelectDetail } from "./bk-menu-list.js";
|
|
|
50
50
|
* Enter in the field chooses the first match. Closing the menu clears the field.
|
|
51
51
|
*
|
|
52
52
|
* The `footer` slot stays in view below the items while a long list scrolls, for example for further options or a note.
|
|
53
|
+
* The `header` slot stays in view above them, for example for the name and the email address of the signed-in user.
|
|
54
|
+
* Its content is plain text, not an item: the keyboard skips it. It starts where the labels of the items start.
|
|
53
55
|
* Its content starts where the items start. The label of a field in it (a `<bk-segmented label>`)
|
|
54
56
|
* looks like a `<bk-menu-label>`.
|
|
55
57
|
*
|
|
@@ -58,16 +60,18 @@ export type { MenuSelectDetail } from "./bk-menu-list.js";
|
|
|
58
60
|
*
|
|
59
61
|
* @slot trigger - The button that opens the menu.
|
|
60
62
|
* @slot - `<bk-menu-item>`, `<bk-menu-divider>` and `<bk-menu-label>` elements (they show in the inner `<bk-menu-list>`).
|
|
63
|
+
* @slot header - Content above the items that stays in view while they scroll (not an item).
|
|
61
64
|
* @slot footer - Content below the items that stays in view while they scroll.
|
|
62
65
|
* @csspart anchor - Wrapper element of the trigger slot.
|
|
63
66
|
* @csspart menu - The floating menu panel (the overlay surface).
|
|
64
67
|
* @csspart list - The `<bk-menu-list>` inside the panel.
|
|
65
68
|
* @csspart filter - The wrapper element of the filter field.
|
|
69
|
+
* @csspart header - The wrapper element of the header slot.
|
|
66
70
|
* @csspart footer - The wrapper element of the footer slot.
|
|
67
71
|
* @cssprop --bk-menu-bg - Background (default --bk-layer-overlay-bg).
|
|
68
72
|
* @cssprop --bk-menu-fg - Text colour (default --bk-text).
|
|
69
73
|
* @cssprop --bk-menu-border - Border colour (default --bk-layer-overlay-border).
|
|
70
|
-
* @cssprop --bk-menu-radius - Corner radius (default --bk-radius
|
|
74
|
+
* @cssprop --bk-menu-radius - Corner radius (default --bk-row-radius + the padding + the border: concentric with the rows).
|
|
71
75
|
* @cssprop --bk-menu-shadow - Shadow (default --bk-layer-overlay-shadow).
|
|
72
76
|
* @cssprop --bk-menu-row-pad - Block padding of the items (default --bk-row-pad).
|
|
73
77
|
* @cssprop --bk-menu-padding - Inner padding (default --bk-space-1).
|
|
@@ -76,6 +80,7 @@ export type { MenuSelectDetail } from "./bk-menu-list.js";
|
|
|
76
80
|
* @cssprop --bk-menu-max-width - Maximum width (default --bk-popup-width-md; --bk-popup-width-xl when an item has a `description`).
|
|
77
81
|
* @cssprop --bk-menu-max-height - Maximum height before the items scroll (default the space in the window on the side that
|
|
78
82
|
* the menu opens to; it opens on the side with more space).
|
|
83
|
+
* @cssprop --bk-menu-header-border - Line below the header (default --bk-line).
|
|
79
84
|
* @cssprop --bk-menu-footer-border - Line above the footer (default --bk-line).
|
|
80
85
|
* @cssprop --bk-menu-item-* - Item tokens. See `<bk-menu-item>`.
|
|
81
86
|
* @fires {CustomEvent<MenuSelectDetail>} select - The user chose an item in the inner list. `detail` is `{ value, item }`. The event bubbles and is cancelable. `preventDefault()` keeps the menu open.
|
|
@@ -135,6 +140,8 @@ export declare class BkMenu extends PopoverBase {
|
|
|
135
140
|
filterLabel: string | undefined;
|
|
136
141
|
private query;
|
|
137
142
|
private slots;
|
|
143
|
+
/** The state `described`: an item has a second line. */
|
|
144
|
+
protected readonly internals: ElementInternals;
|
|
138
145
|
/** Items that the filter hid, so it shows exactly those again. */
|
|
139
146
|
private filtered;
|
|
140
147
|
constructor();
|
|
@@ -23,6 +23,8 @@ class BkMenu extends PopoverBase {
|
|
|
23
23
|
query: { state: true }
|
|
24
24
|
};
|
|
25
25
|
slots = new SlotController(this);
|
|
26
|
+
/** The state `described`: an item has a second line. */
|
|
27
|
+
internals = this.attachInternals();
|
|
26
28
|
/** Items that the filter hid, so it shows exactly those again. */
|
|
27
29
|
filtered = /* @__PURE__ */ new Set();
|
|
28
30
|
constructor() {
|
|
@@ -47,7 +49,7 @@ class BkMenu extends PopoverBase {
|
|
|
47
49
|
--_bk-popup-bg: var(--bk-menu-bg);
|
|
48
50
|
--_bk-popup-fg: var(--bk-menu-fg);
|
|
49
51
|
--_bk-popup-border: var(--bk-menu-border);
|
|
50
|
-
--_bk-popup-radius: var(--bk-menu-radius);
|
|
52
|
+
--_bk-popup-radius: var(--bk-menu-radius, var(--_bk-popup-row-radius));
|
|
51
53
|
--_bk-popup-shadow: var(--bk-menu-shadow);
|
|
52
54
|
--_bk-popup-padding: var(--bk-menu-padding);
|
|
53
55
|
--_bk-popup-offset: var(--bk-menu-offset);
|
|
@@ -61,12 +63,12 @@ class BkMenu extends PopoverBase {
|
|
|
61
63
|
--_bk-menu-bleed: var(--bk-menu-padding, var(--bk-space-1));
|
|
62
64
|
}
|
|
63
65
|
/* Items with a second line can grow wider before they wrap (the panel stays as wide as its content). */
|
|
64
|
-
:host(
|
|
66
|
+
:host(:state(described)) .panel {
|
|
65
67
|
--_bk-popup-max-width: var(--bk-menu-max-width, var(--bk-popup-width-xl));
|
|
66
68
|
}
|
|
67
69
|
/* Tiles take the width their row needs; the viewport still bounds it. */
|
|
68
70
|
:host([variant="tiles"]) .panel { --_bk-popup-max-width: var(--bk-menu-max-width, 100vw); }
|
|
69
|
-
/* The panel is a column: filter, the items (they scroll), footer. */
|
|
71
|
+
/* The panel is a column: header, filter, the items (they scroll), footer. */
|
|
70
72
|
.panel:popover-open { display: flex; flex-direction: column; overflow: hidden; }
|
|
71
73
|
/* The list scrolls from panel edge to panel edge, so a bleeding divider stays inside it and
|
|
72
74
|
never makes it scroll sideways. */
|
|
@@ -92,6 +94,13 @@ class BkMenu extends PopoverBase {
|
|
|
92
94
|
--bk-field-label-color: var(--bk-menu-label-color, var(--bk-group-label-color, var(--bk-text-muted)));
|
|
93
95
|
}
|
|
94
96
|
.footer[hidden] { display: none; }
|
|
97
|
+
.header {
|
|
98
|
+
flex: none; min-width: 0; margin: calc(-1 * var(--_bk-menu-bleed)) calc(-1 * var(--_bk-menu-bleed)) var(--bk-space-1);
|
|
99
|
+
/* The header's content starts where the labels and the items of the list start. */
|
|
100
|
+
padding: var(--bk-space-2) calc(var(--bk-row-pad-inline) + var(--_bk-menu-bleed));
|
|
101
|
+
border-bottom: var(--bk-border-width) solid var(--bk-menu-header-border, var(--bk-line));
|
|
102
|
+
}
|
|
103
|
+
.header[hidden] { display: none; }
|
|
95
104
|
`];
|
|
96
105
|
get panelPart() {
|
|
97
106
|
return "menu";
|
|
@@ -215,7 +224,8 @@ class BkMenu extends PopoverBase {
|
|
|
215
224
|
super.willUpdate(changed);
|
|
216
225
|
if (changed.has("filter"))
|
|
217
226
|
this.popupRole = this.filter ? "dialog" : "menu";
|
|
218
|
-
|
|
227
|
+
const described = this.items.some((i) => !!i.description || !!i.querySelector(':scope > [slot="description"]'));
|
|
228
|
+
described ? this.internals.states.add("described") : this.internals.states.delete("described");
|
|
219
229
|
}
|
|
220
230
|
/** The menu handles Esc and Tab. The list handles every other key (the menu forwards them while the panel itself has the focus). */
|
|
221
231
|
onPanelKeydown(e) {
|
|
@@ -268,7 +278,8 @@ class BkMenu extends PopoverBase {
|
|
|
268
278
|
renderPanel() {
|
|
269
279
|
const label = this.filterLabel || this.i18n.t("menuFilter");
|
|
270
280
|
const empty = this.filter && this.query.trim() && !this.visibleItems().length;
|
|
271
|
-
return html
|
|
281
|
+
return html`<div class="header" part="header" ?hidden=${!this.slots.has("header")}><slot name="header"></slot></div>
|
|
282
|
+
${this.filter ? html`<div class="filter" part="filter">
|
|
272
283
|
<bk-input-text type="search" size="sm" aria-label=${label} placeholder=${label} autocomplete="off"
|
|
273
284
|
@input=${this.onFilterInput} @keydown=${this.onFilterKeydown}><bk-icon slot="start" name="search"></bk-icon></bk-input-text></div>` : nothing}
|
|
274
285
|
<bk-menu-list part="list" role=${ifDefined(this.filter ? void 0 : "none")} label=${ifDefined(this.filter ? this.label || void 0 : void 0)} variant=${ifDefined(this.variant === "tiles" ? "tiles" : void 0)}><slot></slot></bk-menu-list>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import "./bk-icon.js";
|
|
3
3
|
import "./bk-tooltip.js";
|
|
4
4
|
import "../icons/set/group.js";
|
|
@@ -25,7 +25,7 @@ export type MessageFeedbackValue = "up" | "down" | "";
|
|
|
25
25
|
* - The `comment` slot shows after a rating, for example a field or a button that asks for more.
|
|
26
26
|
*
|
|
27
27
|
* Content, no surface. In the `actions` of a `bk-message`, it shows with the other actions on
|
|
28
|
-
* hover or focus. With a rating, it stays visible (the component
|
|
28
|
+
* hover or focus. With a rating, it stays visible (the component has the state `:state(rated)` while it has a value).
|
|
29
29
|
*
|
|
30
30
|
* @slot comment - Shows after a rating, for example a button "Tell us more".
|
|
31
31
|
* @csspart group - The radio group.
|
|
@@ -72,11 +72,12 @@ export declare class BkMessageFeedback extends LitElement {
|
|
|
72
72
|
disabled: boolean;
|
|
73
73
|
private i18n;
|
|
74
74
|
private slots;
|
|
75
|
+
private internals;
|
|
75
76
|
constructor();
|
|
76
77
|
static styles: import("lit").CSSResult[];
|
|
77
78
|
private choose;
|
|
78
79
|
private onKeydown;
|
|
79
|
-
protected
|
|
80
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
80
81
|
private renderButton;
|
|
81
82
|
render(): import("lit-html").TemplateResult<1>;
|
|
82
83
|
}
|
|
@@ -21,6 +21,7 @@ class BkMessageFeedback extends LitElement {
|
|
|
21
21
|
};
|
|
22
22
|
i18n = new LocalizeController(this);
|
|
23
23
|
slots = new SlotController(this);
|
|
24
|
+
internals = this.attachInternals();
|
|
24
25
|
constructor() {
|
|
25
26
|
super();
|
|
26
27
|
this.value = "";
|
|
@@ -28,6 +29,9 @@ class BkMessageFeedback extends LitElement {
|
|
|
28
29
|
}
|
|
29
30
|
static styles = [base, interactive, css`
|
|
30
31
|
:host { display: inline-flex; align-items: center; gap: var(--bk-space-1); min-width: 0; }
|
|
32
|
+
/* A rating stays in view in the actions row of a bk-message, which hides its actions until hover. The important
|
|
33
|
+
declaration of the own shadow root wins over the ::slotted rule of the message. */
|
|
34
|
+
:host(:state(rated)) { opacity: 1 !important; }
|
|
31
35
|
.group { display: inline-flex; gap: var(--bk-space-0); }
|
|
32
36
|
button {
|
|
33
37
|
display: inline-grid; place-items: center; margin: 0; padding: 0; border: 0; background: transparent; font: inherit;
|
|
@@ -61,11 +65,9 @@ class BkMessageFeedback extends LitElement {
|
|
|
61
65
|
this.choose(next, false);
|
|
62
66
|
this.updateComplete.then(() => this.renderRoot.querySelector(`[data-value="${next}"]`)?.focus());
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
else
|
|
68
|
-
delete this.dataset.reveal;
|
|
68
|
+
willUpdate(changed) {
|
|
69
|
+
super.willUpdate(changed);
|
|
70
|
+
this.value ? this.internals.states.add("rated") : this.internals.states.delete("rated");
|
|
69
71
|
}
|
|
70
72
|
renderButton(value) {
|
|
71
73
|
const checked = this.value === value;
|
|
@@ -50,9 +50,10 @@ class BkMessageList extends LitElement {
|
|
|
50
50
|
.messages {
|
|
51
51
|
display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--bk-message-list-gap, var(--bk-space-flow));
|
|
52
52
|
max-inline-size: var(--bk-message-list-max-width, none); margin-inline: auto;
|
|
53
|
+
/* A message with a header starts a turn: bk-message reads this gap (no :state() inside ::slotted()). */
|
|
54
|
+
--_bk-message-turn-gap: var(--bk-message-list-turn-gap, var(--bk-space-3));
|
|
53
55
|
}
|
|
54
56
|
/* A message with a header starts a turn: it gets more room above than the next message of the same author. */
|
|
55
|
-
::slotted(bk-message:state(headed):not(:first-child)) { margin-block-start: var(--bk-message-list-turn-gap, var(--bk-space-3)); }
|
|
56
57
|
.sentinel { block-size: 1px; margin-block-start: -1px; }
|
|
57
58
|
.jump { position: absolute; inset-block-end: var(--bk-space-3); inset-inline-start: 50%; translate: -50% 0; z-index: 1; }
|
|
58
59
|
:host(:dir(rtl)) .jump { translate: 50% 0; }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
export type { NavigateDetail } from "../internal/link.js";
|
|
3
|
-
|
|
4
|
-
export declare function sourceHost(href: string | undefined): string;
|
|
3
|
+
export { sourceHost } from "../internal/link.js";
|
|
5
4
|
/**
|
|
6
5
|
* A source of an answer: a page, a file, a search result. It is a real link.
|
|
7
6
|
*
|
|
@@ -2,18 +2,10 @@ import { LitElement, css, html, nothing } from "lit";
|
|
|
2
2
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
3
|
import { LocalizeController } from "../i18n.js";
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
|
-
import { LinkController } from "../internal/link.js";
|
|
5
|
+
import { LinkController, sourceHost } from "../internal/link.js";
|
|
6
6
|
import { SlotController } from "../internal/slots.js";
|
|
7
7
|
import { base, interactive, srOnly } from "../internal/styles.js";
|
|
8
|
-
|
|
9
|
-
if (!href)
|
|
10
|
-
return "";
|
|
11
|
-
try {
|
|
12
|
-
return new URL(href, globalThis.location?.href).hostname.replace(/^www\./, "");
|
|
13
|
-
} catch {
|
|
14
|
-
return "";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
8
|
+
import { sourceHost as sourceHost2 } from "../internal/link.js";
|
|
17
9
|
class BkMessageSource extends LitElement {
|
|
18
10
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
19
11
|
static properties = {
|
|
@@ -100,6 +92,6 @@ class BkMessageSource extends LitElement {
|
|
|
100
92
|
define("bk-message-source", BkMessageSource);
|
|
101
93
|
export {
|
|
102
94
|
BkMessageSource,
|
|
103
|
-
sourceHost
|
|
95
|
+
sourceHost2 as sourceHost
|
|
104
96
|
};
|
|
105
97
|
//# sourceMappingURL=bk-message-source.js.map
|
|
@@ -32,6 +32,8 @@ class BkMessage extends LitElement {
|
|
|
32
32
|
this.time = "";
|
|
33
33
|
}
|
|
34
34
|
static styles = [base, css`
|
|
35
|
+
/* In a bk-message-list, a message with a header starts a turn: it gets more room above it. */
|
|
36
|
+
:host(:state(headed):not(:first-child)) { margin-block-start: var(--_bk-message-turn-gap, 0px); }
|
|
35
37
|
:host {
|
|
36
38
|
display: block; min-width: 0;
|
|
37
39
|
--_bk-message-bubble-bg: var(--bk-message-bubble-bg, var(--bk-layer-sunken-bg));
|
|
@@ -248,7 +248,7 @@ class BkNavGroup extends LitElement {
|
|
|
248
248
|
--_bk-popup-bg: var(--bk-nav-flyout-bg);
|
|
249
249
|
--_bk-popup-fg: initial;
|
|
250
250
|
--_bk-popup-border: var(--bk-nav-flyout-border);
|
|
251
|
-
--_bk-popup-radius: var(--bk-nav-flyout-radius);
|
|
251
|
+
--_bk-popup-radius: var(--bk-nav-flyout-radius, var(--_bk-popup-row-radius));
|
|
252
252
|
--_bk-popup-shadow: var(--bk-nav-flyout-shadow);
|
|
253
253
|
--_bk-popup-padding: var(--bk-nav-flyout-padding);
|
|
254
254
|
--_bk-popup-offset: var(--bk-nav-flyout-offset, var(--bk-space-2));
|