@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
|
@@ -41,7 +41,7 @@ const chartTokensCss = String.raw`
|
|
|
41
41
|
--bk-chart-hero-size: calc(48px * var(--bk-text-scale));
|
|
42
42
|
--bk-chart-label-size: var(--bk-text-xs);
|
|
43
43
|
}
|
|
44
|
-
:root, [data-theme], [data-bk-scope] {
|
|
44
|
+
:root, [data-theme], [data-bk-scope], :is(:state(bk-scope)) {
|
|
45
45
|
--bk-chart-single: var(--bk-accent-solid);
|
|
46
46
|
${categorical}
|
|
47
47
|
--bk-chart-other: light-dark(oklch(from var(--bk-neutral) 0.72 calc(c * 0.6) h), oklch(from var(--bk-neutral) 0.5 calc(c * 0.6) h));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChartRow } from "./frame.js";
|
|
2
|
+
/** A field of the row that the tooltip lists without drawing it: `key` is the row field. */
|
|
3
|
+
export interface ChartField {
|
|
4
|
+
key: string;
|
|
5
|
+
/** Name in the tooltip, the table and the accessible name (default: the key). */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Intl.NumberFormat options of this field (default: the plain number format of the locale). */
|
|
8
|
+
format?: Intl.NumberFormatOptions;
|
|
9
|
+
}
|
|
10
|
+
/** The attribute lists the keys, separated by spaces. The property takes keys and `ChartField` objects. */
|
|
11
|
+
export declare const tooltipFieldsConverter: {
|
|
12
|
+
fromAttribute(value: string | null): ChartField[];
|
|
13
|
+
};
|
|
14
|
+
/** The fields in effect: keys become `{ key }`, and entries without a key are dropped. */
|
|
15
|
+
export declare function resolveFields(fields: readonly (string | ChartField)[] | undefined): ChartField[];
|
|
16
|
+
/** The name of a field. */
|
|
17
|
+
export declare const fieldLabel: (f: ChartField) => string;
|
|
18
|
+
/** The value of a field in a row as text: numbers with Intl in `locale`, dates as dates, a missing value as a dash. */
|
|
19
|
+
export declare function fieldValue(locale: string, row: ChartRow | undefined, f: ChartField): string;
|
|
20
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { formatTime, formatValue } from "./format.js";
|
|
2
|
+
import { num } from "./frame.js";
|
|
3
|
+
const tooltipFieldsConverter = {
|
|
4
|
+
fromAttribute(value) {
|
|
5
|
+
return (value ?? "").split(/\s+/).filter(Boolean).map((key) => ({ key }));
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
function resolveFields(fields) {
|
|
9
|
+
return (fields ?? []).map((f) => typeof f === "string" ? { key: f } : f).filter((f) => f && f.key);
|
|
10
|
+
}
|
|
11
|
+
const fieldLabel = (f) => f.label || f.key;
|
|
12
|
+
function fieldValue(locale, row, f) {
|
|
13
|
+
const v = row?.[f.key];
|
|
14
|
+
if (v instanceof Date)
|
|
15
|
+
return formatTime(locale, v.getTime());
|
|
16
|
+
const n = num(v);
|
|
17
|
+
if (n !== null)
|
|
18
|
+
return formatValue(locale, n, f.format);
|
|
19
|
+
return v === void 0 || v === null || v === "" ? "\u2013" : String(v);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
fieldLabel,
|
|
23
|
+
fieldValue,
|
|
24
|
+
resolveFields,
|
|
25
|
+
tooltipFieldsConverter
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=fields.js.map
|
package/dist/charts/frame.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface ChartSeries {
|
|
|
21
21
|
slot?: number;
|
|
22
22
|
/** In a `toggleable` `bk-chart-line`: the series starts hidden, and the user shows it through the legend. */
|
|
23
23
|
hidden?: boolean;
|
|
24
|
+
/** In a `bk-chart-line`: `break` or `connect` for this series. It overrides the `gaps` attribute of the chart. */
|
|
25
|
+
gaps?: "break" | "connect";
|
|
24
26
|
}
|
|
25
27
|
export type ChartRow = Record<string, unknown>;
|
|
26
28
|
/** Anything coloured like a series: series, stacked-bar parts, legend items. */
|
package/dist/charts/frame.js
CHANGED
|
@@ -244,11 +244,12 @@ class ChartController {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
function renderTable(model, hidden) {
|
|
247
|
-
|
|
247
|
+
const table = html`<table class=${hidden ? nothing : "data"} part=${hidden ? nothing : "table"}>
|
|
248
248
|
<caption class=${hidden ? nothing : "sr-only"}>${model.caption}</caption>
|
|
249
249
|
<thead><tr>${model.columns.map((c, i) => html`<th scope="col" class=${i ? "num" : ""}>${c}</th>`)}</tr></thead>
|
|
250
250
|
<tbody>${model.rows.map((r) => html`<tr>${r.map((c, i) => i ? html`<td class="num">${c}</td>` : html`<th scope="row">${c}</th>`)}</tr>`)}</tbody>
|
|
251
251
|
</table>`;
|
|
252
|
+
return hidden ? html`<div class="sr-only">${table}</div>` : table;
|
|
252
253
|
}
|
|
253
254
|
function renderEmptyPlot(locale, width, height) {
|
|
254
255
|
return html`<div class="plot" part="plot"><svg width=${width} height=${height} aria-hidden="true">
|
package/dist/clipboard.js
CHANGED
|
@@ -8,6 +8,7 @@ import { StateController } from "../internal/state.js";
|
|
|
8
8
|
import { base, srOnly } from "../internal/styles.js";
|
|
9
9
|
import "./bk-icon.js";
|
|
10
10
|
import "./bk-button.js";
|
|
11
|
+
import { ownText } from "../internal/own-text.js";
|
|
11
12
|
import "../icons/set/close.js";
|
|
12
13
|
const TONE_KEYS = { neutral: "alertInfo", accent: "alertInfo", info: "alertInfo", success: "alertSuccess", warning: "alertWarning", danger: "alertDanger", attention: "alertAttention" };
|
|
13
14
|
class BkAlert extends LitElement {
|
|
@@ -92,7 +93,7 @@ class BkAlert extends LitElement {
|
|
|
92
93
|
return;
|
|
93
94
|
clearTimeout(this.announceTimer);
|
|
94
95
|
this.announceTimer = window.setTimeout(() => {
|
|
95
|
-
const body = (this.querySelector("[slot=heading]")?.textContent ?? "") + " " +
|
|
96
|
+
const body = (this.querySelector("[slot=heading]")?.textContent ?? "") + " " + ownText(this, " ");
|
|
96
97
|
const parts = [this.heading, body.replace(/\s+/g, " ").trim()].filter(Boolean);
|
|
97
98
|
const text = parts.length ? [this.i18n.t(TONE_KEYS[this.tone]), ...parts].join(": ") : "";
|
|
98
99
|
if (!text)
|
|
@@ -100,7 +101,7 @@ class BkAlert extends LitElement {
|
|
|
100
101
|
if (text === this.lastText)
|
|
101
102
|
return;
|
|
102
103
|
this.lastText = text;
|
|
103
|
-
announce(text, { assertive: this.tone === "danger" });
|
|
104
|
+
announce(text, { assertive: this.tone === "danger", source: this });
|
|
104
105
|
}, 100);
|
|
105
106
|
}
|
|
106
107
|
firstUpdated() {
|
|
@@ -3,6 +3,7 @@ import { ifDefined } from "lit/directives/if-defined.js";
|
|
|
3
3
|
import { define } from "../internal/define.js";
|
|
4
4
|
import { LocalizeController } from "../i18n.js";
|
|
5
5
|
import { base } from "../internal/styles.js";
|
|
6
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
6
7
|
import "./bk-avatar.js";
|
|
7
8
|
import "./bk-item.js";
|
|
8
9
|
import "./bk-item-group.js";
|
|
@@ -63,16 +64,13 @@ class BkAvatarGroup extends LitElement {
|
|
|
63
64
|
layout() {
|
|
64
65
|
const { avatars } = this;
|
|
65
66
|
const max = this.max ?? Infinity;
|
|
66
|
-
avatars.forEach((a, i) => {
|
|
67
|
-
a.hidden = i >= max;
|
|
68
|
-
a.style.zIndex = String(avatars.length - i);
|
|
69
|
-
});
|
|
67
|
+
avatars.forEach((a, i) => a.setGroupPlace?.({ hidden: i >= max, layer: avatars.length - i }));
|
|
70
68
|
this.hiddenCount = Math.max(0, avatars.length - max);
|
|
71
|
-
this
|
|
69
|
+
setHostVars(this, { "--_bk-avatar-group-size": `var(--bk-avatar-size-${avatars[0]?.getAttribute("size") || "md"})` });
|
|
72
70
|
this.requestUpdate();
|
|
73
71
|
}
|
|
74
72
|
render() {
|
|
75
|
-
const hidden = this.avatars.filter((a) => a.
|
|
73
|
+
const hidden = this.avatars.filter((a) => a.groupHidden);
|
|
76
74
|
return html`<slot @slotchange=${this.onSlot}></slot>${this.hiddenCount ? html`<bk-popover label=${this.i18n.t("morePeople")}>
|
|
77
75
|
<button slot="trigger" class="more" part="more" type="button"
|
|
78
76
|
aria-label=${this.i18n.t("moreCount", { count: this.hiddenCount })}>+${this.hiddenCount}</button>
|
|
@@ -88,6 +88,16 @@ export declare class BkAvatar extends LitElement {
|
|
|
88
88
|
constructor();
|
|
89
89
|
static styles: import("lit").CSSResult[];
|
|
90
90
|
private i18n;
|
|
91
|
+
/**
|
|
92
|
+
* `<bk-avatar-group>` calls this method: `hidden` hides an avatar beyond `max`, `layer` puts earlier avatars on top.
|
|
93
|
+
* The avatar shows its place through its own states: the group writes no attributes on the avatars of the app.
|
|
94
|
+
*/
|
|
95
|
+
setGroupPlace(o: {
|
|
96
|
+
hidden: boolean;
|
|
97
|
+
layer: number;
|
|
98
|
+
}): void;
|
|
99
|
+
/** True while a `<bk-avatar-group>` hides the avatar beyond its `max`. */
|
|
100
|
+
get groupHidden(): boolean;
|
|
91
101
|
protected willUpdate(changed: PropertyValues): void;
|
|
92
102
|
/** At xs and sm the dot is too small for a symbol. */
|
|
93
103
|
private get small();
|
|
@@ -82,10 +82,27 @@ class BkAvatar extends LitElement {
|
|
|
82
82
|
box-shadow: var(--_bk-avatar-active-shadow);
|
|
83
83
|
}
|
|
84
84
|
:host { transition: box-shadow var(--bk-duration-fast); }
|
|
85
|
+
/* The place in a <bk-avatar-group> (setGroupPlace): above the next avatar, or hidden beyond max. */
|
|
86
|
+
:host(:state(group-layer)) { z-index: var(--_bk-avatar-layer); }
|
|
87
|
+
:host(:state(group-hidden)) { display: none; }
|
|
85
88
|
@media (prefers-reduced-motion: reduce) { :host { transition: none; } }
|
|
86
89
|
@media (forced-colors: active) { :host { border: var(--bk-border-width) solid CanvasText; } :host([active]) { outline: var(--bk-space-0) solid Highlight; outline-offset: var(--bk-space-0); } }
|
|
87
90
|
`];
|
|
88
91
|
i18n = new LocalizeController(this);
|
|
92
|
+
/**
|
|
93
|
+
* `<bk-avatar-group>` calls this method: `hidden` hides an avatar beyond `max`, `layer` puts earlier avatars on top.
|
|
94
|
+
* The avatar shows its place through its own states: the group writes no attributes on the avatars of the app.
|
|
95
|
+
*/
|
|
96
|
+
setGroupPlace(o) {
|
|
97
|
+
const s = this.internals.states;
|
|
98
|
+
o.hidden ? s.add("group-hidden") : s.delete("group-hidden");
|
|
99
|
+
s.add("group-layer");
|
|
100
|
+
setHostVars(this, { "--_bk-avatar-layer": String(o.layer) });
|
|
101
|
+
}
|
|
102
|
+
/** True while a `<bk-avatar-group>` hides the avatar beyond its `max`. */
|
|
103
|
+
get groupHidden() {
|
|
104
|
+
return this.internals.states.has("group-hidden");
|
|
105
|
+
}
|
|
89
106
|
willUpdate(changed) {
|
|
90
107
|
if (changed.has("src"))
|
|
91
108
|
this.failed = false;
|
|
@@ -67,6 +67,8 @@ class BkBar extends LitElement {
|
|
|
67
67
|
:host {
|
|
68
68
|
display: flex; flex-wrap: wrap; align-items: center; flex: 1 1 auto; min-width: 0;
|
|
69
69
|
gap: var(--bk-bar-gap, var(--bk-space-cluster));
|
|
70
|
+
/* In a row the bar takes the rest of the line. In a column it keeps the height of its content. */
|
|
71
|
+
max-block-size: max-content;
|
|
70
72
|
}
|
|
71
73
|
:host([hidden]) { display: none; }
|
|
72
74
|
.start, .end { display: flex; flex-wrap: wrap; align-items: center; gap: inherit; min-width: 0; }
|
|
@@ -60,7 +60,7 @@ class BkButtonGroup extends FormControl {
|
|
|
60
60
|
::slotted(:not(:first-child)) { margin-inline-start: calc(-1 * var(--_bk-button-group-overlap)); }
|
|
61
61
|
:host([orientation="vertical"]) ::slotted(:not(:first-child)) { margin-inline-start: 0; margin-block-start: calc(-1 * var(--_bk-button-group-overlap)); }
|
|
62
62
|
/* The border of the hovered, focused or pressed button lies over its neighbours. */
|
|
63
|
-
::slotted(:hover), ::slotted(:focus-within), ::slotted([pressed]) { z-index: 1; }
|
|
63
|
+
::slotted(:hover), ::slotted(:focus-within), ::slotted([pressed]:not([pressed="false"])) { z-index: 1; }
|
|
64
64
|
:host([disabled]) .group { opacity: var(--bk-disabled-opacity); }
|
|
65
65
|
`];
|
|
66
66
|
get control() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LitElement, css, html } from "lit";
|
|
2
2
|
import { LocalizeController } from "../i18n.js";
|
|
3
3
|
import { define } from "../internal/define.js";
|
|
4
|
+
import { setHostVars } from "../internal/host-vars.js";
|
|
4
5
|
import { base } from "../internal/styles.js";
|
|
5
6
|
import "./bk-button.js";
|
|
6
7
|
import "../icons/set/arrow-up.js";
|
|
@@ -88,7 +89,7 @@ class BkButtonTop extends LitElement {
|
|
|
88
89
|
return;
|
|
89
90
|
this.shown = shown;
|
|
90
91
|
if (shown)
|
|
91
|
-
this
|
|
92
|
+
setHostVars(this, { "--_bk-button-top-bar": `${parseFloat(getComputedStyle(document.documentElement).scrollPaddingBottom) || 0}px` });
|
|
92
93
|
}
|
|
93
94
|
/** Scrolls to the top and moves focus to the start of the page or list. */
|
|
94
95
|
toTop() {
|
|
@@ -3,21 +3,31 @@ import { type AriaForwarding, type TriggerAria } from "../internal/anchor.js";
|
|
|
3
3
|
import "./bk-icon.js";
|
|
4
4
|
import "./bk-spinner.js";
|
|
5
5
|
import "./bk-tooltip.js";
|
|
6
|
+
import { SUBMIT_BUTTON, type CustomSubmitButton } from "../internal/submit.js";
|
|
6
7
|
export type { NavigateDetail } from "../internal/link.js";
|
|
7
8
|
import "../icons/set/label.js";
|
|
8
9
|
export type ButtonVariant = "solid" | "soft" | "outline" | "ghost" | "quiet";
|
|
9
10
|
export type ButtonTone = "neutral" | "accent" | "info" | "success" | "warning" | "danger" | "attention";
|
|
10
11
|
export type ButtonSize = "sm" | "md" | "lg";
|
|
11
12
|
/**
|
|
12
|
-
* A button, or a link styled as one when `href` is set.
|
|
13
|
+
* A button, or a link styled as one when `href` is set. A link with `target="_blank"` has the description "(opens in a
|
|
14
|
+
* new tab)". To show it, give the button `icon-end="external"`.
|
|
13
15
|
*
|
|
14
16
|
* Style and meaning are separate. `variant` is the visual weight (`solid`, `soft`, `outline` (default),
|
|
15
17
|
* `ghost`, `quiet`). `tone` is the colour of meaning (`neutral` (default), `accent`, `info`, `success`,
|
|
16
|
-
* `warning`, `danger`). Every combination works. The main action of a view is
|
|
18
|
+
* `warning`, `danger`, `attention`). Every combination works. The main action of a view is
|
|
17
19
|
* `variant="solid" tone="accent"`. A destructive action is `tone="danger"` (solid to confirm, ghost in rows).
|
|
18
20
|
*
|
|
19
21
|
* Form-associated: `type="submit"` and `type="reset"` act on the surrounding `<form>` like a native
|
|
20
|
-
* button.
|
|
22
|
+
* button. A disabled ancestor `<fieldset>` disables the button, as a native button (a link button stays a link).
|
|
23
|
+
*
|
|
24
|
+
* **Default button**: the first submit button of a form in tree order is its default button, a native one or a
|
|
25
|
+
* `bk-button type="submit"`. Enter in a single-line field of the form (native or of the library) clicks it. A
|
|
26
|
+
* disabled default button (also `loading` or `disabled-reason`) blocks Enter, as natively. The browser does not know
|
|
27
|
+
* a custom default button: a document listener does this for native fields. It writes nothing into the DOM. The
|
|
28
|
+
* native Enter does not fire `change` on the field before the submission then.
|
|
29
|
+
*
|
|
30
|
+
* The default slot contains the content. The `start` and `end` slots contain icons. As a shorthand,
|
|
21
31
|
* use the `icon` and `icon-end` attributes.
|
|
22
32
|
*
|
|
23
33
|
* **Choose files**: `type="file"` opens the file dialog of the system, like a native
|
|
@@ -62,14 +72,17 @@ export type ButtonSize = "sm" | "md" | "lg";
|
|
|
62
72
|
* not open from a trigger that is off.
|
|
63
73
|
*
|
|
64
74
|
* An icon-only button shows its name in a built-in tooltip (hover and keyboard focus, not touch; not
|
|
65
|
-
* on an open popup trigger, not inside a dialog, drawer or popover).
|
|
66
|
-
*
|
|
67
|
-
* the `
|
|
75
|
+
* on an open popup trigger, not inside a dialog, drawer, lightbox or popover). The button finds the overlay also through
|
|
76
|
+
* the shadow roots of other elements. An open tooltip takes the first Esc (WCAG 1.4.13), so without the tooltip one Esc
|
|
77
|
+
* closes the overlay. `hide-tooltip` turns the tooltip off, and the native `title` with it, for a button that is in a
|
|
78
|
+
* tooltip of the app. The name stays the `aria-label`.
|
|
68
79
|
*
|
|
69
80
|
* @slot - Label. Or only an icon or a `<bk-avatar>` (an icon-only button).
|
|
70
81
|
* @slot start - Leading content, usually a `<bk-icon>`.
|
|
71
82
|
* @slot end - Trailing content, for example an icon or a `<bk-chip>` count.
|
|
72
83
|
* @csspart control - The native `<button>` or `<a>`.
|
|
84
|
+
* @csspart icon-start - The icon from `icon`.
|
|
85
|
+
* @csspart icon-end - The icon from `icon-end`. While a popup that the button controls is open the host has `:state(expanded)`: `bk-button:state(expanded)::part(icon-end) { rotate: 180deg; }` turns a chevron.
|
|
73
86
|
* @cssprop --bk-button-radius - Corner radius (default --bk-radius-control, else --bk-radius-md). Inside a `bk-button-group` the group sets the corners.
|
|
74
87
|
* @cssprop --bk-button-font-weight - Label weight (default --bk-weight-medium).
|
|
75
88
|
* @cssprop --bk-button-letter-spacing - Label letter spacing.
|
|
@@ -96,10 +109,13 @@ export type ButtonSize = "sm" | "md" | "lg";
|
|
|
96
109
|
* @cssprop --bk-button-accent-fill-hover - The same on hover.
|
|
97
110
|
* @cssprop --bk-button-gradient - The gradient knob for buttons only (default --bk-gradient).
|
|
98
111
|
* @cssprop --bk-button-solid-shadow - Shadow of `solid` (default a glow in the fill colour, scaled by --bk-glow-strength, 0 = none).
|
|
112
|
+
* @cssprop --bk-button-shadow - Shadow at rest, any `box-shadow` value (default: the shadow of the variant, see `outline-shadow` and `solid-shadow`). `none` removes it.
|
|
113
|
+
* @cssprop --bk-button-shadow-hover - Shadow on hover (default: the value of --bk-button-shadow, so nothing changes).
|
|
114
|
+
* @cssprop --bk-button-lift-hover - How far the button moves up on hover (default 0). Use whole pixels. With reduced motion, and when disabled, it stays in place.
|
|
99
115
|
* @cssprop --bk-button-hover - Hover overlay of `outline`, `soft` and `quiet` (default --bk-hover).
|
|
100
116
|
* @cssprop --bk-button-quiet-fg - Text colour of neutral `quiet` at rest (default --bk-text-muted).
|
|
101
|
-
* @cssprop --bk-button-pressed-bg - Background while `pressed` (default --bk-accent-soft).
|
|
102
|
-
* @cssprop --bk-button-pressed-fg - Text colour while `pressed` (default --bk-accent-text).
|
|
117
|
+
* @cssprop --bk-button-pressed-bg - Background while `pressed` or current (default: the soft background of the tone, --bk-button-{tone}-soft; neutral --bk-accent-soft).
|
|
118
|
+
* @cssprop --bk-button-pressed-fg - Text colour while `pressed` or current (default: the text colour of the tone, --bk-button-{tone}-text; neutral --bk-accent-text).
|
|
103
119
|
* @cssprop --bk-button-pressed-border - Border colour while `pressed` (default transparent).
|
|
104
120
|
* @cssprop --bk-button-floating-bg - Background of `floating` (default --bk-layer-overlay-bg).
|
|
105
121
|
* @cssprop --bk-button-floating-fg - Text colour of `floating` (default: the tone's text colour).
|
|
@@ -129,7 +145,7 @@ export type ButtonSize = "sm" | "md" | "lg";
|
|
|
129
145
|
* @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. Bubbles, composed, cancelable: `preventDefault()` stops the browser, and the router of the app handles the navigation.
|
|
130
146
|
* @tag bk-button
|
|
131
147
|
*/
|
|
132
|
-
export declare class BkButton extends LitElement implements AriaForwarding {
|
|
148
|
+
export declare class BkButton extends LitElement implements AriaForwarding, CustomSubmitButton {
|
|
133
149
|
static formAssociated: boolean;
|
|
134
150
|
static shadowRootOptions: ShadowRootInit;
|
|
135
151
|
static properties: {
|
|
@@ -192,8 +208,11 @@ export declare class BkButton extends LitElement implements AriaForwarding {
|
|
|
192
208
|
reflect: boolean;
|
|
193
209
|
};
|
|
194
210
|
pressed: {
|
|
195
|
-
type: BooleanConstructor;
|
|
196
211
|
reflect: boolean;
|
|
212
|
+
converter: {
|
|
213
|
+
fromAttribute: (value: string | null) => boolean;
|
|
214
|
+
toAttribute: (value: boolean | undefined) => "" | null;
|
|
215
|
+
};
|
|
197
216
|
};
|
|
198
217
|
floating: {
|
|
199
218
|
type: BooleanConstructor;
|
|
@@ -255,7 +274,7 @@ export declare class BkButton extends LitElement implements AriaForwarding {
|
|
|
255
274
|
iconEnd: string | undefined;
|
|
256
275
|
/** Accessible name and tooltip; needed when the button shows only an icon. */
|
|
257
276
|
label: string | undefined;
|
|
258
|
-
/** Disables the button: no focus, no clicks, no form submit. */
|
|
277
|
+
/** Disables the button: no focus, no clicks, no form submit. A disabled ancestor `<fieldset>` disables it too (not a link button). */
|
|
259
278
|
disabled: boolean;
|
|
260
279
|
/** Turns the button off and says why: a tooltip and the accessible description. The button stays focusable. */
|
|
261
280
|
disabledReason: string | undefined;
|
|
@@ -268,8 +287,9 @@ export declare class BkButton extends LitElement implements AriaForwarding {
|
|
|
268
287
|
/** Position of the content of a `block` button: `center` (default), or `start` for a list of answers. A long label of a `block` button wraps, and the button grows with it. */
|
|
269
288
|
align: "center" | "start" | undefined;
|
|
270
289
|
/**
|
|
271
|
-
* Toggle state; sets aria-pressed and the pressed
|
|
272
|
-
*
|
|
290
|
+
* Toggle state; sets `aria-pressed` and the pressed look. When unset (the default), the button is not a toggle.
|
|
291
|
+
* The property `false` makes an unpressed toggle that announces `aria-pressed="false"`. In markup, write
|
|
292
|
+
* `pressed="false"` for it. The attribute `pressed` (or any other value) is a pressed toggle.
|
|
273
293
|
*/
|
|
274
294
|
pressed: boolean | undefined;
|
|
275
295
|
/** Pill on a floating surface with a level-2 shadow, for controls laid over content. */
|
|
@@ -304,8 +324,15 @@ export declare class BkButton extends LitElement implements AriaForwarding {
|
|
|
304
324
|
showPicker(): void;
|
|
305
325
|
private onPicked;
|
|
306
326
|
private onPickCancel;
|
|
307
|
-
/**
|
|
327
|
+
/** A disabled ancestor `<fieldset>` disables the button, as a native button. A link button stays a link. */
|
|
328
|
+
private fieldsetDisabled;
|
|
329
|
+
/** The button is disabled: `disabled`, or a disabled ancestor `<fieldset>` (not a link button). */
|
|
330
|
+
private get isDisabled();
|
|
331
|
+
/** Whether the button takes no action: `disabled` (also from a `<fieldset>`), `disabled-reason` or `loading`. */
|
|
308
332
|
get inactive(): boolean;
|
|
333
|
+
formDisabledCallback(disabled: boolean): void;
|
|
334
|
+
/** For the default button of the form (internal/submit.ts): null when not a submit button, else whether it is off. */
|
|
335
|
+
[SUBMIT_BUTTON](): boolean | null;
|
|
309
336
|
/** Trigger ARIA set by popovers, menus and tooltips; rendered onto the inner control. */
|
|
310
337
|
private forwarded;
|
|
311
338
|
/** The elements of the ids in `aria-controls` on the host, in the root of the button (the inner control cannot refer to them by id). */
|
|
@@ -331,6 +358,7 @@ export declare class BkButton extends LitElement implements AriaForwarding {
|
|
|
331
358
|
/** What count and dot announce to assistive technology ("3 new"), for the description. */
|
|
332
359
|
private get badgeDescription();
|
|
333
360
|
protected willUpdate(changed: PropertyValues): void;
|
|
361
|
+
protected updated(changed: PropertyValues): void;
|
|
334
362
|
protected renderContent(): TemplateResult<1>;
|
|
335
363
|
render(): TemplateResult;
|
|
336
364
|
/**
|
|
@@ -12,9 +12,14 @@ import "./bk-icon.js";
|
|
|
12
12
|
import "./bk-spinner.js";
|
|
13
13
|
import "./bk-tooltip.js";
|
|
14
14
|
import { lightDom } from "../internal/server.js";
|
|
15
|
+
import { SUBMIT_BUTTON, listenForImplicitSubmission } from "../internal/submit.js";
|
|
15
16
|
import "../icons/set/label.js";
|
|
16
17
|
const stopClick = (e) => e.stopPropagation();
|
|
17
18
|
const VISUAL = /* @__PURE__ */ new Set(["bk-icon", "svg", "img", "bk-avatar"]);
|
|
19
|
+
const pressedConverter = {
|
|
20
|
+
fromAttribute: (value) => value !== null && value !== "false",
|
|
21
|
+
toAttribute: (value) => value ? "" : null
|
|
22
|
+
};
|
|
18
23
|
class BkButton extends LitElement {
|
|
19
24
|
static formAssociated = true;
|
|
20
25
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
@@ -42,7 +47,7 @@ class BkButton extends LitElement {
|
|
|
42
47
|
hideTooltip: { attribute: "hide-tooltip", type: Boolean, reflect: true },
|
|
43
48
|
block: { type: Boolean, reflect: true },
|
|
44
49
|
align: { reflect: true },
|
|
45
|
-
pressed: {
|
|
50
|
+
pressed: { reflect: true, converter: pressedConverter },
|
|
46
51
|
floating: { type: Boolean, reflect: true },
|
|
47
52
|
collapse: { reflect: true },
|
|
48
53
|
current: { attribute: "aria-current" },
|
|
@@ -126,9 +131,23 @@ class BkButton extends LitElement {
|
|
|
126
131
|
e.stopPropagation();
|
|
127
132
|
emitLifecycle(this, "cancel");
|
|
128
133
|
};
|
|
129
|
-
/**
|
|
134
|
+
/** A disabled ancestor `<fieldset>` disables the button, as a native button. A link button stays a link. */
|
|
135
|
+
fieldsetDisabled = false;
|
|
136
|
+
/** The button is disabled: `disabled`, or a disabled ancestor `<fieldset>` (not a link button). */
|
|
137
|
+
get isDisabled() {
|
|
138
|
+
return this.disabled || this.fieldsetDisabled && !this.href;
|
|
139
|
+
}
|
|
140
|
+
/** Whether the button takes no action: `disabled` (also from a `<fieldset>`), `disabled-reason` or `loading`. */
|
|
130
141
|
get inactive() {
|
|
131
|
-
return this.
|
|
142
|
+
return this.isDisabled || this.loading || !!this.disabledReason;
|
|
143
|
+
}
|
|
144
|
+
formDisabledCallback(disabled) {
|
|
145
|
+
this.fieldsetDisabled = disabled;
|
|
146
|
+
this.requestUpdate();
|
|
147
|
+
}
|
|
148
|
+
/** For the default button of the form (internal/submit.ts): null when not a submit button, else whether it is off. */
|
|
149
|
+
[SUBMIT_BUTTON]() {
|
|
150
|
+
return this.type === "submit" && !this.href ? this.inactive : null;
|
|
132
151
|
}
|
|
133
152
|
/** Trigger ARIA set by popovers, menus and tooltips; rendered onto the inner control. */
|
|
134
153
|
forwarded = { haspopup: null, expanded: null, controls: null, description: null, hideTitle: false };
|
|
@@ -260,14 +279,14 @@ class BkButton extends LitElement {
|
|
|
260
279
|
--_bk-button-shadow: var(--bk-button-solid-shadow, 0 var(--bk-space-1) var(--bk-space-4) calc(-1 * var(--bk-space-1)) oklch(from var(--_bk-button-solid) l c h / calc(0.5 * var(--bk-glow-strength))));
|
|
261
280
|
}
|
|
262
281
|
@media (hover: hover) {
|
|
263
|
-
:host([variant="solid"]:not([disabled]
|
|
282
|
+
:host([variant="solid"]:not([disabled], :disabled, [pressed]:not([pressed="false"]))) .control:hover:not([aria-disabled="true"]) { background: var(--_bk-button-fill-hover, var(--_bk-button-solid-hover)); }
|
|
264
283
|
}
|
|
265
284
|
:host([variant="soft"]) { --_bk-button-bg: var(--_bk-button-soft); --_bk-button-bd: transparent; --_bk-button-shadow: none; }
|
|
266
285
|
:host([variant="ghost"]) { --_bk-button-bg: var(--bk-button-ghost-bg, transparent); --_bk-button-bd: transparent; --_bk-button-hover: var(--_bk-button-tint); --_bk-button-shadow: none; }
|
|
267
286
|
:host([variant="quiet"]) { --_bk-button-bg: transparent; --_bk-button-bd: transparent; --_bk-button-shadow: none; }
|
|
268
287
|
:host([variant="quiet"]:is([tone="neutral"], :not([tone]))) { --_bk-button-fg: var(--bk-button-quiet-fg, var(--bk-text-muted)); }
|
|
269
288
|
@media (hover: hover) {
|
|
270
|
-
:host([variant="quiet"]:not([disabled])) .control:hover:not([aria-disabled="true"]) { color: var(--_bk-button-text); border-color: var(--_bk-button-frame); }
|
|
289
|
+
:host([variant="quiet"]:not([disabled], :disabled)) .control:hover:not([aria-disabled="true"]) { color: var(--_bk-button-text); border-color: var(--_bk-button-frame); }
|
|
271
290
|
}
|
|
272
291
|
:host([floating]) { --_bk-button-shadow: var(--bk-button-floating-shadow, var(--bk-layer-overlay-shadow)); }
|
|
273
292
|
:host([floating]:not([variant="solid"])) {
|
|
@@ -276,9 +295,12 @@ class BkButton extends LitElement {
|
|
|
276
295
|
--_bk-button-bd: var(--bk-button-floating-border, var(--bk-layer-overlay-border));
|
|
277
296
|
}
|
|
278
297
|
:host([floating]) .control { border-radius: var(--bk-button-floating-radius, var(--bk-radius-full)); }
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
298
|
+
/* The pressed look follows the tone: its soft background and its text. Neutral (the default) uses the accent, the colour of a selection. */
|
|
299
|
+
:host { --_bk-button-pressed-bg: var(--bk-accent-soft); --_bk-button-pressed-fg: var(--bk-accent-text); }
|
|
300
|
+
:host([tone]:not([tone="neutral"])) { --_bk-button-pressed-bg: var(--_bk-button-soft); --_bk-button-pressed-fg: var(--_bk-button-text); }
|
|
301
|
+
:host([pressed]:not([pressed="false"])), :host([aria-current]:not([aria-current="false"])) {
|
|
302
|
+
--_bk-button-bg: var(--bk-button-pressed-bg, var(--_bk-button-pressed-bg));
|
|
303
|
+
--_bk-button-fg: var(--bk-button-pressed-fg, var(--_bk-button-pressed-fg));
|
|
282
304
|
--_bk-button-bd: var(--bk-button-pressed-border, transparent);
|
|
283
305
|
--_bk-button-shadow: none;
|
|
284
306
|
}
|
|
@@ -290,18 +312,25 @@ class BkButton extends LitElement {
|
|
|
290
312
|
letter-spacing: var(--bk-button-letter-spacing, normal); text-transform: var(--bk-button-text-transform, none);
|
|
291
313
|
line-height: 1; white-space: nowrap;
|
|
292
314
|
color: var(--_bk-button-fg); background: var(--_bk-button-bg); border: var(--bk-button-border-width, var(--bk-border-width)) solid var(--_bk-button-bd);
|
|
293
|
-
border-radius: var(--_bk-button-group-radius, var(--bk-button-radius, var(--bk-radius-control, var(--bk-radius-md)))); box-shadow: var(--_bk-button-shadow);
|
|
315
|
+
border-radius: var(--_bk-button-group-radius, var(--bk-button-radius, var(--bk-radius-control, var(--bk-radius-md)))); box-shadow: var(--bk-button-shadow, var(--_bk-button-shadow));
|
|
294
316
|
text-decoration: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
|
|
295
|
-
transition: background-color var(--bk-duration-fast), border-color var(--bk-duration-fast), color var(--bk-duration-fast);
|
|
317
|
+
transition: background-color var(--bk-duration-fast), border-color var(--bk-duration-fast), color var(--bk-duration-fast), box-shadow var(--bk-duration-fast), translate var(--bk-duration-fast);
|
|
296
318
|
}
|
|
319
|
+
@media (hover: hover) {
|
|
320
|
+
:host(:not(:is([disabled], :disabled:not([href]), [disabled-reason]:not([disabled-reason=""])))) .control:hover:not([aria-disabled="true"]) {
|
|
321
|
+
translate: 0 calc(-1 * var(--bk-button-lift-hover, 0px)); box-shadow: var(--bk-button-shadow-hover, var(--bk-button-shadow, var(--_bk-button-shadow)));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
@media (prefers-reduced-motion: reduce) { .control:hover { translate: none !important; } }
|
|
297
325
|
.control::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: background-color var(--bk-duration-fast); }
|
|
298
326
|
@media (hover: hover) { .control:hover::after { background: var(--_bk-button-hover); } }
|
|
299
327
|
.control:active::after { background: var(--bk-button-active, var(--bk-pressed)); }
|
|
300
328
|
.control:focus { outline: none; }
|
|
301
329
|
.control:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-button-focus-offset, var(--bk-focus-offset)); }
|
|
302
330
|
|
|
303
|
-
:
|
|
304
|
-
:host([disabled]) .control
|
|
331
|
+
/* :disabled is also a disabled ancestor fieldset. A link button stays a link there. */
|
|
332
|
+
:host(:is([disabled], :disabled:not([href]))) .control, :host([disabled-reason]:not([disabled-reason=""])) .control { opacity: var(--bk-disabled-opacity); cursor: not-allowed; }
|
|
333
|
+
:host(:is([disabled], :disabled:not([href]))) .control::after, :host([disabled-reason]:not([disabled-reason=""])) .control::after { display: none; }
|
|
305
334
|
/* The tooltip that says why the button is off wraps the control and fills the host like it. */
|
|
306
335
|
.reason { display: flex; flex: 1; min-width: 0; }
|
|
307
336
|
.reason::part(anchor) { flex: 1; min-width: 0; }
|
|
@@ -312,7 +341,7 @@ class BkButton extends LitElement {
|
|
|
312
341
|
/* The content has no box of its own (display: contents), so each part hides. Not visibility: the label stays the accessible name. */
|
|
313
342
|
.spinning .label, .spinning .content bk-icon, .spinning .content ::slotted(*) { opacity: 0; }
|
|
314
343
|
.spinner { position: absolute; inset: 0; display: grid; place-items: center; }
|
|
315
|
-
@media (forced-colors: active) { .control { border-color: ButtonText; } :host([pressed]) .control, :host([aria-current]:not([aria-current="false"])) .control { outline: 2px solid Highlight; } }
|
|
344
|
+
@media (forced-colors: active) { .control { border-color: ButtonText; } :host([pressed]:not([pressed="false"])) .control, :host([aria-current]:not([aria-current="false"])) .control { outline: 2px solid Highlight; } }
|
|
316
345
|
|
|
317
346
|
.content { display: contents; }
|
|
318
347
|
/* An icon's glyph carries its own inner space: the padding on its side gives that back. */
|
|
@@ -365,8 +394,15 @@ class BkButton extends LitElement {
|
|
|
365
394
|
inOverlay = false;
|
|
366
395
|
connectedCallback() {
|
|
367
396
|
super.connectedCallback();
|
|
368
|
-
|
|
369
|
-
|
|
397
|
+
this.inOverlay = false;
|
|
398
|
+
for (let node = this; node; ) {
|
|
399
|
+
if (node.closest("dialog, bk-dialog, bk-drawer, bk-lightbox, bk-command-palette, [popover]")) {
|
|
400
|
+
this.inOverlay = true;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
const root = node.getRootNode();
|
|
404
|
+
node = root instanceof ShadowRoot ? root.host : null;
|
|
405
|
+
}
|
|
370
406
|
if (this.collapsible && !this.icon && !this.iconEnd && !this.querySelector(":scope > :is([slot=start], [slot=end])")) {
|
|
371
407
|
console.warn("<bk-button collapse> needs an icon (icon, icon-end, or the start or end slot): it is all that stays visible.", this);
|
|
372
408
|
}
|
|
@@ -418,12 +454,22 @@ class BkButton extends LitElement {
|
|
|
418
454
|
super.willUpdate(changed);
|
|
419
455
|
if (changed.has("loading"))
|
|
420
456
|
this.loader.set(this.loading);
|
|
457
|
+
const f = this.forwarded;
|
|
458
|
+
const open = f.expanded === null ? this.hostExpanded === "true" : f.expanded;
|
|
459
|
+
const states = this.internals.states;
|
|
460
|
+
if (states)
|
|
461
|
+
open ? states.add("expanded") : states.delete("expanded");
|
|
462
|
+
}
|
|
463
|
+
updated(changed) {
|
|
464
|
+
super.updated(changed);
|
|
465
|
+
if (changed.has("type") && this.type === "submit")
|
|
466
|
+
listenForImplicitSubmission();
|
|
421
467
|
}
|
|
422
468
|
renderContent() {
|
|
423
469
|
return html`
|
|
424
|
-
<slot name="start">${this.icon ? html`<bk-icon name=${this.icon}></bk-icon>` : nothing}</slot>
|
|
470
|
+
<slot name="start">${this.icon ? html`<bk-icon part="icon-start" name=${this.icon}></bk-icon>` : nothing}</slot>
|
|
425
471
|
<span class="label"><slot @slotchange=${this.onDefaultSlot}></slot></span>
|
|
426
|
-
<slot name="end">${this.iconEnd ? html`<bk-icon name=${this.iconEnd}></bk-icon>` : nothing}</slot>`;
|
|
472
|
+
<slot name="end">${this.iconEnd ? html`<bk-icon part="icon-end" name=${this.iconEnd}></bk-icon>` : nothing}</slot>`;
|
|
427
473
|
}
|
|
428
474
|
render() {
|
|
429
475
|
const inner = html`<span class="content">${this.renderContent()}</span>
|
|
@@ -441,7 +487,8 @@ class BkButton extends LitElement {
|
|
|
441
487
|
const title = f.hideTitle || this.hideTooltip || reason || labelTip ? void 0 : name;
|
|
442
488
|
const popup = ifDefined(f.haspopup ?? void 0);
|
|
443
489
|
const expanded = ifDefined(f.expanded === null ? this.hostExpanded ?? void 0 : String(f.expanded));
|
|
444
|
-
const
|
|
490
|
+
const newTab = this.href && this.target === "_blank" ? this.i18n.t("opensInNewTab") : void 0;
|
|
491
|
+
const description = ifDefined(reason ? void 0 : [f.description, this.badgeDescription, newTab].filter(Boolean).join(". ") || void 0);
|
|
445
492
|
const current = ifDefined(this.current ?? void 0);
|
|
446
493
|
const controls = controlsList(f.controls ?? this.hostControlled());
|
|
447
494
|
if (this.href) {
|
|
@@ -451,11 +498,11 @@ class BkButton extends LitElement {
|
|
|
451
498
|
download=${ifDefined(this.download)} aria-label=${ifDefined(name)} title=${ifDefined(title)}
|
|
452
499
|
aria-haspopup=${popup} aria-expanded=${expanded} .ariaControlsElements=${controls} aria-description=${description} aria-current=${current}
|
|
453
500
|
aria-disabled=${ifDefined(inactive ? "true" : void 0)} role=${ifDefined(inactive ? "link" : void 0)}
|
|
454
|
-
tabindex=${ifDefined(reason ? "0" : this.
|
|
501
|
+
tabindex=${ifDefined(reason ? "0" : this.isDisabled ? "-1" : void 0)}>${inner}</a>`);
|
|
455
502
|
}
|
|
456
503
|
return this.withReason(reason, name, labelTip, html`<button part="control" class=${cls} type="button"
|
|
457
504
|
command=${ifDefined(this.command)} @click=${this.onControlClick}
|
|
458
|
-
?disabled=${this.
|
|
505
|
+
?disabled=${this.isDisabled && !reason} aria-disabled=${ifDefined(off ? "true" : void 0)}
|
|
459
506
|
aria-busy=${ifDefined(this.loading ? "true" : void 0)}
|
|
460
507
|
aria-pressed=${ifDefined(this.pressed === void 0 ? void 0 : String(this.pressed))}
|
|
461
508
|
aria-label=${ifDefined(name)} title=${ifDefined(title)}
|
|
@@ -89,6 +89,12 @@ export type { NavigateDetail } from "../internal/link.js";
|
|
|
89
89
|
* @cssprop --bk-card-shadow - Shadow (default --bk-layer-raised-shadow; `elevated`: --bk-layer-overlay-shadow).
|
|
90
90
|
* @cssprop --bk-card-shadow-hover - Shadow of a card with `href` on hover (default --bk-layer-overlay-shadow).
|
|
91
91
|
* @cssprop --bk-card-border-hover - Border colour of a card with `href` on hover (default --bk-line-mid).
|
|
92
|
+
* @cssprop --bk-card-lift-hover - How far a card with `href` moves up on hover (default --bk-space-0, 2px, in whole pixels). Use whole pixels. `0`
|
|
93
|
+
* switches it off. With reduced motion the card stays in place.
|
|
94
|
+
* @cssprop --bk-card-ring - An image (for example a gradient) that the card shows as its ring at rest, over the border, in its radius
|
|
95
|
+
* (default none). A `selected` card shows its own ring.
|
|
96
|
+
* @cssprop --bk-card-ring-hover - An image that a card with `href` shows as its ring on hover, over the border, in its radius (default a
|
|
97
|
+
* gradient from --bk-accent-solid to --bk-info-solid). `none` switches it off. A `selected` card shows its own ring.
|
|
92
98
|
* @cssprop --bk-card-padding - Inner padding of `padding="md"`, the default (default --bk-space-5).
|
|
93
99
|
* @cssprop --bk-card-padding-sm - Inner padding of `padding="sm"` (default --bk-space-3).
|
|
94
100
|
* @cssprop --bk-card-media-ratio - Aspect ratio of the media region (default auto; `media-ratio` sets it per card).
|
|
@@ -206,6 +212,7 @@ export declare class BkCard extends LitElement {
|
|
|
206
212
|
private startSize;
|
|
207
213
|
private slots;
|
|
208
214
|
private i18n;
|
|
215
|
+
private internals;
|
|
209
216
|
private busyState;
|
|
210
217
|
private links;
|
|
211
218
|
private sizes;
|