@bk2k/ui 0.7.0 → 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/CHANGELOG.md +63 -0
- package/USAGE.md +20 -9
- package/custom-elements.json +1 -1
- package/dist/charts/frame.d.ts +2 -0
- package/dist/components/bk-alert.js +1 -1
- package/dist/components/bk-button.d.ts +5 -0
- package/dist/components/bk-button.js +15 -4
- package/dist/components/bk-card.d.ts +6 -3
- package/dist/components/bk-card.js +15 -9
- package/dist/components/bk-chart-area.d.ts +4 -0
- package/dist/components/bk-chart-line.d.ts +15 -0
- package/dist/components/bk-chart-line.js +16 -6
- package/dist/components/bk-chip.d.ts +2 -0
- package/dist/components/bk-chip.js +3 -1
- package/dist/components/bk-combobox.d.ts +2 -2
- package/dist/components/bk-combobox.js +7 -20
- package/dist/components/bk-footnotes-item.d.ts +2 -2
- package/dist/components/bk-image-compare.d.ts +36 -1
- package/dist/components/bk-image-compare.js +47 -11
- package/dist/components/bk-image-viewer.d.ts +74 -3
- package/dist/components/bk-image-viewer.js +115 -28
- 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-tags.d.ts +219 -0
- package/dist/components/bk-input-tags.js +293 -0
- package/dist/components/bk-input-text.d.ts +9 -0
- package/dist/components/bk-input-text.js +18 -2
- package/dist/components/bk-lightbox.d.ts +25 -1
- package/dist/components/bk-lightbox.js +7 -0
- package/dist/components/bk-page-cta.d.ts +2 -0
- package/dist/components/bk-page-cta.js +8 -1
- package/dist/components/bk-split-grid.js +7 -2
- package/dist/components/bk-stat.d.ts +2 -0
- package/dist/components/bk-stat.js +1 -1
- package/dist/components/bk-table.d.ts +2 -0
- package/dist/components/bk-table.js +1 -1
- package/dist/components/bk-tabs.d.ts +2 -1
- package/dist/components/bk-tabs.js +15 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/announcer.d.ts +6 -0
- package/dist/internal/announcer.js +7 -2
- package/dist/internal/cloak.js +1 -0
- package/dist/internal/define.d.ts +9 -0
- package/dist/internal/define.js +47 -1
- package/dist/internal/elements.d.ts +6 -0
- package/dist/internal/elements.js +5 -0
- package/dist/internal/hue.d.ts +8 -0
- package/dist/internal/hue.js +15 -4
- package/dist/internal/late/bk-tabs.d.ts +4 -0
- package/dist/internal/late/bk-tabs.js +8 -0
- package/dist/internal/late.js +3 -3
- 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 +85 -6
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +3 -0
- package/dist/reset.css +1 -1
- package/dist/standalone/all.js +106 -105
- package/dist/standalone/bk-accordion-item.js +3 -3
- package/dist/standalone/bk-accordion.js +1 -1
- package/dist/standalone/bk-action-bar.js +1 -1
- package/dist/standalone/bk-alert-offline.js +1 -1
- package/dist/standalone/bk-alert.js +7 -4
- package/dist/standalone/bk-app-state.js +1 -1
- package/dist/standalone/bk-attachment.js +2 -2
- package/dist/standalone/bk-avatar-group.js +1 -1
- package/dist/standalone/bk-avatar.js +3 -3
- package/dist/standalone/bk-badge.js +1 -1
- package/dist/standalone/bk-bar.js +1 -1
- package/dist/standalone/bk-brand.js +1 -1
- package/dist/standalone/bk-breadcrumbs.js +2 -2
- package/dist/standalone/bk-button-copy.js +4 -4
- package/dist/standalone/bk-button-group.js +2 -2
- package/dist/standalone/bk-button-share.js +4 -4
- package/dist/standalone/bk-button-top.js +1 -1
- package/dist/standalone/bk-button.js +14 -6
- package/dist/standalone/bk-calendar-event.js +1 -1
- package/dist/standalone/bk-calendar-week.js +1 -1
- package/dist/standalone/bk-calendar.js +2 -2
- package/dist/standalone/bk-card.js +17 -11
- package/dist/standalone/bk-carousel-controls.js +2 -2
- package/dist/standalone/bk-carousel-item.js +1 -1
- 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 +2 -2
- package/dist/standalone/bk-chart-bar.js +1 -1
- package/dist/standalone/bk-chart-bridge.js +1 -1
- package/dist/standalone/bk-chart-bullet.js +1 -1
- package/dist/standalone/bk-chart-calendar.js +1 -1
- package/dist/standalone/bk-chart-heatmap.js +1 -1
- package/dist/standalone/bk-chart-histogram.js +1 -1
- package/dist/standalone/bk-chart-legend.js +1 -1
- package/dist/standalone/bk-chart-line.js +16 -8
- package/dist/standalone/bk-chart-mark.js +1 -1
- package/dist/standalone/bk-chart-scatter.js +1 -1
- package/dist/standalone/bk-chart-sparkline.js +1 -1
- package/dist/standalone/bk-chart-stacked-bar.js +1 -1
- package/dist/standalone/bk-chart-tracker.js +1 -1
- package/dist/standalone/bk-chart-waterfall.js +2 -2
- package/dist/standalone/bk-checkbox-group.js +5 -5
- package/dist/standalone/bk-checkbox.js +3 -3
- package/dist/standalone/bk-chip-group.js +4 -4
- package/dist/standalone/bk-chip.js +5 -3
- package/dist/standalone/bk-cluster.js +1 -1
- package/dist/standalone/bk-code-diff.js +2 -2
- package/dist/standalone/bk-code-stack.js +1 -1
- package/dist/standalone/bk-code.js +1 -1
- package/dist/standalone/bk-color-panel.js +2 -2
- package/dist/standalone/bk-columns.js +1 -1
- package/dist/standalone/bk-combobox.js +21 -30
- package/dist/standalone/bk-command-menu.js +3 -3
- package/dist/standalone/bk-command-palette.js +4 -4
- package/dist/standalone/bk-composer.js +4 -4
- package/dist/standalone/bk-delta.js +1 -1
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-disclosure.js +2 -2
- package/dist/standalone/bk-divider.js +4 -4
- package/dist/standalone/bk-drawer.js +2 -2
- package/dist/standalone/bk-drop-target.js +1 -1
- package/dist/standalone/bk-empty-state.js +2 -2
- package/dist/standalone/bk-error-summary.js +1 -1
- package/dist/standalone/bk-facts-item.js +1 -1
- package/dist/standalone/bk-facts.js +1 -1
- package/dist/standalone/bk-feature.js +2 -2
- package/dist/standalone/bk-fieldset.js +1 -1
- package/dist/standalone/bk-filter-bar.js +2 -2
- package/dist/standalone/bk-folder-browser.js +2 -2
- package/dist/standalone/bk-footnote.js +1 -1
- package/dist/standalone/bk-footnotes-item.js +2 -2
- package/dist/standalone/bk-footnotes.js +1 -1
- package/dist/standalone/bk-form-guard.js +1 -1
- package/dist/standalone/bk-form-steps.js +1 -1
- package/dist/standalone/bk-grid.js +1 -1
- package/dist/standalone/bk-icon-tile.js +2 -2
- package/dist/standalone/bk-icon.js +1 -1
- package/dist/standalone/bk-image-compare.js +55 -27
- package/dist/standalone/bk-image-crop.js +3 -3
- package/dist/standalone/bk-image-editor.js +1 -1
- package/dist/standalone/bk-image-viewer.js +127 -57
- package/dist/standalone/bk-input-code.js +2 -2
- package/dist/standalone/bk-input-color.js +3 -13
- 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 +20 -13
- package/dist/standalone/bk-input-group.js +2 -2
- package/dist/standalone/bk-input-inline.js +1 -1
- package/dist/standalone/bk-input-number.js +4 -4
- package/dist/standalone/bk-input-rating.js +4 -4
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +4 -4
- package/dist/standalone/bk-input-slider-range.js +2 -2
- package/dist/standalone/bk-input-slider.js +2 -2
- 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 +4 -4
- package/dist/standalone/bk-item-group.js +2 -2
- package/dist/standalone/bk-item.js +2 -2
- package/dist/standalone/bk-kbd-shortcuts.js +1 -1
- package/dist/standalone/bk-kbd.js +1 -1
- package/dist/standalone/bk-lightbox.js +16 -3
- package/dist/standalone/bk-lines.js +1 -1
- package/dist/standalone/bk-link.js +2 -2
- package/dist/standalone/bk-listbox-columns.js +6 -6
- package/dist/standalone/bk-listbox-item.js +1 -1
- package/dist/standalone/bk-listbox-search.js +5 -5
- package/dist/standalone/bk-listbox-transfer.js +4 -4
- package/dist/standalone/bk-listbox.js +5 -5
- package/dist/standalone/bk-logo-wall.js +1 -1
- package/dist/standalone/bk-logo.js +2 -2
- package/dist/standalone/bk-menu-bar.js +1 -1
- package/dist/standalone/bk-menu-context.js +1 -1
- package/dist/standalone/bk-menu-divider.js +1 -1
- package/dist/standalone/bk-menu-item.js +2 -2
- package/dist/standalone/bk-menu-label.js +1 -1
- package/dist/standalone/bk-menu-list.js +1 -1
- package/dist/standalone/bk-menu.js +4 -4
- package/dist/standalone/bk-message-approval.js +2 -2
- package/dist/standalone/bk-message-branches.js +1 -1
- package/dist/standalone/bk-message-citation.js +1 -1
- package/dist/standalone/bk-message-feedback.js +2 -2
- package/dist/standalone/bk-message-list.js +2 -2
- package/dist/standalone/bk-message-reasoning.js +3 -3
- package/dist/standalone/bk-message-source.js +1 -1
- package/dist/standalone/bk-message-tool-group.js +3 -3
- package/dist/standalone/bk-message-tool.js +3 -3
- package/dist/standalone/bk-message.js +2 -2
- package/dist/standalone/bk-meter.js +1 -1
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-divider.js +1 -1
- package/dist/standalone/bk-nav-group.js +5 -5
- package/dist/standalone/bk-nav-item.js +2 -2
- package/dist/standalone/bk-nav-toc.js +1 -1
- package/dist/standalone/bk-nav.js +1 -1
- package/dist/standalone/bk-overflow.js +1 -1
- package/dist/standalone/bk-page-cta.js +10 -3
- package/dist/standalone/bk-page-footer-column.js +1 -1
- package/dist/standalone/bk-page-footer.js +1 -1
- package/dist/standalone/bk-page-header.js +2 -2
- package/dist/standalone/bk-page-hero.js +2 -2
- package/dist/standalone/bk-page-pager.js +2 -2
- package/dist/standalone/bk-page-section.js +2 -2
- package/dist/standalone/bk-pagination.js +3 -3
- package/dist/standalone/bk-pane.js +2 -2
- package/dist/standalone/bk-panel.js +2 -2
- package/dist/standalone/bk-period-nav.js +2 -2
- package/dist/standalone/bk-picture.js +1 -175
- package/dist/standalone/bk-popover-help.js +1 -1
- package/dist/standalone/bk-popover.js +1 -1
- package/dist/standalone/bk-presence-cursor.js +2 -2
- package/dist/standalone/bk-preview.js +2 -2
- package/dist/standalone/bk-progress.js +1 -1
- package/dist/standalone/bk-prose.js +1 -1
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +5 -5
- package/dist/standalone/bk-radio.js +2 -2
- package/dist/standalone/bk-rating.js +3 -3
- package/dist/standalone/bk-scroll.js +1 -1
- package/dist/standalone/bk-segmented-item.js +2 -2
- package/dist/standalone/bk-segmented.js +4 -4
- package/dist/standalone/bk-select-cascade.js +3 -3
- package/dist/standalone/bk-select-tree.js +4 -4
- package/dist/standalone/bk-select.js +4 -4
- package/dist/standalone/bk-shell-app.js +1 -1
- package/dist/standalone/bk-shell-centered.js +1 -1
- package/dist/standalone/bk-shell-sites.js +1 -1
- package/dist/standalone/bk-skeleton.js +1 -1
- package/dist/standalone/bk-sortable.js +2 -2
- package/dist/standalone/bk-spinner.js +1 -1
- package/dist/standalone/bk-split-grid.js +10 -7
- package/dist/standalone/bk-split.js +6 -6
- package/dist/standalone/bk-stack.js +1 -1
- package/dist/standalone/bk-stat-group.js +1 -1
- package/dist/standalone/bk-stat.js +3 -3
- package/dist/standalone/bk-status-dot.js +2 -2
- package/dist/standalone/bk-steps-item.js +2 -2
- package/dist/standalone/bk-steps.js +1 -1
- package/dist/standalone/bk-surface.js +1 -1
- package/dist/standalone/bk-swatch-group.js +6 -6
- package/dist/standalone/bk-swatch-palette.js +1 -1
- package/dist/standalone/bk-swatch.js +1 -1
- package/dist/standalone/bk-switch.js +2 -2
- package/dist/standalone/bk-table.js +1 -1
- package/dist/standalone/bk-tabs-item.js +2 -2
- package/dist/standalone/bk-tabs-panel.js +1 -1
- package/dist/standalone/bk-tabs.js +3 -414
- package/dist/standalone/bk-tasks-item.js +2 -2
- package/dist/standalone/bk-tasks.js +1 -1
- package/dist/standalone/bk-testimonial.js +2 -2
- package/dist/standalone/bk-text.js +3 -3
- package/dist/standalone/bk-time-countdown.js +2 -2
- package/dist/standalone/bk-time-relative.js +1 -1
- package/dist/standalone/bk-timeline-item.js +2 -2
- package/dist/standalone/bk-timeline.js +1 -1
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +2 -2
- package/dist/standalone/bk-toolbar.js +1 -1
- package/dist/standalone/bk-tooltip.js +1 -1
- package/dist/standalone/bk-tree-item.js +3 -3
- package/dist/standalone/bk-tree.js +4 -4
- package/dist/standalone/bk-video.js +2 -2
- package/dist/standalone/bk-visually-hidden.js +1 -1
- package/dist/standalone/bk-zoom.js +3 -3
- package/dist/standalone/chunks/{announcer-D1zrRWwO.js → announcer-6tMlCOq1.js} +9 -4
- package/dist/standalone/chunks/{bk-alert-offline-Clw0ZSsH.js → bk-alert-offline-hCLuG-RM.js} +1 -1
- package/dist/standalone/chunks/{bk-carousel-Biz7t8sL.js → bk-carousel-_dudBMVq.js} +2 -2
- package/dist/standalone/chunks/{bk-diagram-D_fQf6SF.js → bk-diagram-BB2odomE.js} +2 -2
- package/dist/standalone/chunks/{bk-dialog-DwZyUUHh.js → bk-dialog-DcvwnOtN.js} +2 -2
- package/dist/standalone/chunks/{bk-icon-Bp_flKdv.js → bk-icon-D4kI4F18.js} +1 -1
- package/dist/standalone/chunks/{bk-image-editor-BADsoLRL.js → bk-image-editor-SRVkHI-4.js} +2 -2
- package/dist/standalone/chunks/{bk-input-date-range-DHcJ8-5g.js → bk-input-date-range-C0Vd-p0T.js} +2 -2
- package/dist/standalone/chunks/{bk-input-rich-CFhW6vRa.js → bk-input-rich-AmDv87E5.js} +3 -3
- package/dist/standalone/chunks/{bk-input-text-DviyLBqj.js → bk-input-text-2n89GDIT.js} +15 -5
- package/dist/standalone/chunks/{bk-model-viewer-w_Ah4Tvs.js → bk-model-viewer-BoNYBd6W.js} +2 -2
- package/dist/standalone/chunks/bk-picture-CA5gLxgZ.js +186 -0
- package/dist/standalone/chunks/{bk-qr-code-CYMovNVl.js → bk-qr-code-CSFfc8As.js} +1 -1
- package/dist/standalone/chunks/{bk-shell-app-B2lxHit8.js → bk-shell-app-BlCOG25y.js} +31 -30
- package/dist/standalone/chunks/{bk-surface-D7e0tErs.js → bk-surface-BULRdKam.js} +1 -1
- package/dist/standalone/chunks/{bk-swatch-palette-x13JgJQi.js → bk-swatch-palette-Cqj85tSW.js} +1 -1
- package/dist/standalone/chunks/{bk-table-CP8n_jy7.js → bk-table-DWlD7yoM.js} +72 -71
- package/dist/standalone/chunks/bk-tabs-STkr3-E1.js +422 -0
- package/dist/standalone/chunks/{bk-toast-group-CoL6W7uk.js → bk-toast-group-5nZg7BaJ.js} +2 -2
- package/dist/standalone/chunks/{busy-BUB22mGY.js → busy-eG3uHonz.js} +1 -1
- package/dist/standalone/chunks/{choice-field-poOTerh1.js → choice-field-B0oe_9fI.js} +4 -4
- package/dist/standalone/chunks/{date-field-B-fCXa2D.js → date-field-Dy1_qxNv.js} +2 -2
- package/dist/standalone/chunks/define-6OfuRn5c.js +60 -0
- package/dist/standalone/chunks/{form-control-CHpfKAKa.js → form-control-Bmk0SRDX.js} +1 -1
- package/dist/standalone/chunks/{handle-menu-BgYUbGO2.js → handle-menu-BAe9fPYJ.js} +10 -36
- package/dist/standalone/chunks/{heading-text-CgnCa_q2.js → heading-text-B2kF-b8p.js} +1 -1
- package/dist/standalone/chunks/hue-vLbNdAEl.js +20 -0
- package/dist/standalone/chunks/late-CPQ_RbU-.js +30 -0
- package/dist/standalone/chunks/{options-BdC8-KKM.js → options-ySaDL-dW.js} +1 -1
- package/dist/standalone/chunks/{stars-BgKEjDQx.js → stars-BAUc_LqI.js} +1 -1
- package/dist/standalone/chunks/tags-CMLAGsVw.js +37 -0
- package/dist/standalone/chunks/{text-field-CqhJSAwZ.js → text-field-CufOGdfr.js} +16 -10
- package/dist/standalone/chunks/{toggle-control-lvZbQtGW.js → toggle-control-Cgqp1jhf.js} +4 -2
- package/dist/standalone/chunks/{virtual-C_h6sHnm.js → virtual-D-qgACnE.js} +1 -1
- package/dist/standalone/confirm.js +2 -2
- package/dist/standalone/reset.css +1 -1
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +2 -2
- package/dist/standalone/chunks/define-DkVeu7e9.js +0 -30
- package/dist/standalone/chunks/hue-Jvb-141g.js +0 -14
- package/dist/standalone/chunks/keyed-CZ2AaouM.js +0 -16
|
@@ -61,6 +61,10 @@ import "../icons/set/visibility-off.js";
|
|
|
61
61
|
* @csspart field - Wrapper of label, box and hint.
|
|
62
62
|
* @csspart label - The `<label>`.
|
|
63
63
|
* @csspart box - The bordered box.
|
|
64
|
+
* The native `spellcheck` attribute of the host passes to the inner control: `spellcheck="false"` switches the
|
|
65
|
+
* browser spell checker off. With `mono` the checker is off by default, since code is not prose. `spellcheck="true"`
|
|
66
|
+
* switches it on again.
|
|
67
|
+
*
|
|
64
68
|
* @csspart input - The native `<input>` or `<textarea>`.
|
|
65
69
|
* @csspart prefix - The `prefix` text.
|
|
66
70
|
* @csspart suffix - The `suffix` text.
|
|
@@ -261,6 +265,11 @@ export declare class BkInputText extends TextField {
|
|
|
261
265
|
/** Initial value, restored on form reset. Defaults to the `value` attribute. */
|
|
262
266
|
defaultValue: string;
|
|
263
267
|
constructor();
|
|
268
|
+
/** The host attribute `spellcheck` reaches the inner control. It is not a property: the platform has `HTMLElement.spellcheck`. */
|
|
269
|
+
static get observedAttributes(): string[];
|
|
270
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
271
|
+
/** `spellcheck` of the inner control: the host attribute, else off for `mono`, else the default of the browser. */
|
|
272
|
+
private get spellcheckAttr();
|
|
264
273
|
/** Follows the registry: a shortcut can get other keys, or register after the field. */
|
|
265
274
|
private unsubscribeShortcuts?;
|
|
266
275
|
connectedCallback(): void;
|
|
@@ -72,6 +72,22 @@ class BkInputText extends TextField {
|
|
|
72
72
|
this.autogrow = false;
|
|
73
73
|
this.revealed = false;
|
|
74
74
|
}
|
|
75
|
+
/** The host attribute `spellcheck` reaches the inner control. It is not a property: the platform has `HTMLElement.spellcheck`. */
|
|
76
|
+
static get observedAttributes() {
|
|
77
|
+
return [...super.observedAttributes, "spellcheck"];
|
|
78
|
+
}
|
|
79
|
+
attributeChangedCallback(name, old, value) {
|
|
80
|
+
super.attributeChangedCallback(name, old, value);
|
|
81
|
+
if (name === "spellcheck")
|
|
82
|
+
this.requestUpdate();
|
|
83
|
+
}
|
|
84
|
+
/** `spellcheck` of the inner control: the host attribute, else off for `mono`, else the default of the browser. */
|
|
85
|
+
get spellcheckAttr() {
|
|
86
|
+
const a = this.getAttribute?.("spellcheck");
|
|
87
|
+
if (a != null)
|
|
88
|
+
return a === "false" ? "false" : "true";
|
|
89
|
+
return this.mono ? "false" : void 0;
|
|
90
|
+
}
|
|
75
91
|
/** Follows the registry: a shortcut can get other keys, or register after the field. */
|
|
76
92
|
unsubscribeShortcuts;
|
|
77
93
|
connectedCallback() {
|
|
@@ -298,14 +314,14 @@ class BkInputText extends TextField {
|
|
|
298
314
|
placeholder=${ifDefined(this.placeholder)} rows=${ifDefined(this.rows)} style=${styleMap(rows)} ?disabled=${disabled}
|
|
299
315
|
?readonly=${this.readonly} ?required=${this.required} ?autofocus=${this.autofocus}
|
|
300
316
|
minlength=${ifDefined(this.minlength)} maxlength=${ifDefined(this.maxlength)}
|
|
301
|
-
autocomplete=${ifDefined(this.autocomplete)} aria-invalid=${invalid}
|
|
317
|
+
autocomplete=${ifDefined(this.autocomplete)} aria-invalid=${invalid} spellcheck=${ifDefined(this.spellcheckAttr)}
|
|
302
318
|
aria-describedby=${ifDefined(desc)} aria-label=${ifDefined(ariaLabel)} enterkeyhint=${ifDefined(this.enterKeyHint || void 0)}
|
|
303
319
|
aria-keyshortcuts=${ifDefined(keys)} @input=${this.onInput} @change=${this.onChange}></textarea>` : html`<input part="input" id="control" .value=${live(this.formattedValue)} type=${type}
|
|
304
320
|
placeholder=${ifDefined(this.placeholder)} ?disabled=${disabled} ?readonly=${this.readonly}
|
|
305
321
|
?required=${this.required} ?autofocus=${this.autofocus} minlength=${ifDefined(this.minlength)}
|
|
306
322
|
maxlength=${ifDefined(this.mask ? void 0 : this.maxlength)} pattern=${ifDefined(this.pattern)} autocomplete=${ifDefined(this.autocomplete)}
|
|
307
323
|
inputmode=${ifDefined(this.inputmode ?? this.maskInputmode)} enterkeyhint=${ifDefined(this.enterKeyHint || void 0)} aria-invalid=${invalid}
|
|
308
|
-
aria-describedby=${ifDefined(desc)} aria-label=${ifDefined(ariaLabel)} aria-keyshortcuts=${ifDefined(keys)}
|
|
324
|
+
spellcheck=${ifDefined(this.spellcheckAttr)} aria-describedby=${ifDefined(desc)} aria-label=${ifDefined(ariaLabel)} aria-keyshortcuts=${ifDefined(keys)}
|
|
309
325
|
@input=${this.onInput} @change=${this.onChange} @keydown=${this.onKeydown} />`;
|
|
310
326
|
return this.renderField(html`<div class=${this.boxClass} part="box">
|
|
311
327
|
${this.renderStart()}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
-
import type { BkImageViewer, ImageViewerChangeDetail, ImageViewerItem } from "./bk-image-viewer.js";
|
|
2
|
+
import type { BkImageViewer, ImageViewerChangeDetail, ImageViewerItem, ImageViewerPageDetail } from "./bk-image-viewer.js";
|
|
3
3
|
import "./bk-dialog.js";
|
|
4
4
|
import "./bk-button.js";
|
|
5
5
|
import "./bk-image-viewer.js";
|
|
@@ -8,6 +8,7 @@ import "../icons/set/grid.js";
|
|
|
8
8
|
/** One image of the viewer. */
|
|
9
9
|
export type LightboxItem = ImageViewerItem;
|
|
10
10
|
export type LightboxChangeDetail = ImageViewerChangeDetail;
|
|
11
|
+
export type LightboxPageDetail = ImageViewerPageDetail;
|
|
11
12
|
/**
|
|
12
13
|
* A gallery that opens a full-screen `<bk-image-viewer>` (zoom, pan, swipe, counter, captions,
|
|
13
14
|
* optional filmstrip) in a bare, modal `<bk-dialog>` (top layer, inert background, focus trap, Esc
|
|
@@ -70,6 +71,10 @@ export type LightboxChangeDetail = ImageViewerChangeDetail;
|
|
|
70
71
|
*
|
|
71
72
|
* `openLightbox(items, index, { actions: [open] })` does the same appending in one step.
|
|
72
73
|
*
|
|
74
|
+
* When the app has the list of pictures and shows one at a time, set `pageable` (and `first` or `last` at the ends of
|
|
75
|
+
* the list). The viewer then shows the previous and next buttons and fires `page`. Set `items` to the other picture in
|
|
76
|
+
* the handler. While it loads, the last picture stays in view.
|
|
77
|
+
*
|
|
73
78
|
* @slot - The gallery: images, or links, buttons or figures that contain an image.
|
|
74
79
|
* @slot actions - Extra buttons in the toolbar of the viewer, before the close button. They get the look of the controls of the viewer.
|
|
75
80
|
* @csspart gallery - The grid around the slotted thumbnails.
|
|
@@ -97,6 +102,7 @@ export type LightboxChangeDetail = ImageViewerChangeDetail;
|
|
|
97
102
|
* @fires {Event} open - Fires after the viewer opens. Does not bubble.
|
|
98
103
|
* @fires {Event} close - Fires after the viewer closes (Esc, close button, tap beside the image, `close()`). Does not bubble.
|
|
99
104
|
* @fires {CustomEvent<LightboxChangeDetail>} change - The user moves to another image. `event.detail.index` is the new index. The event bubbles (from the viewer).
|
|
105
|
+
* @fires {CustomEvent<LightboxPageDetail>} page - With `pageable`: the user asks for the previous or the next picture of the list of the app. `event.detail.direction` is `previous` or `next`. The event bubbles, is composed and is cancelable (from the viewer). See `<bk-image-viewer>`.
|
|
100
106
|
*
|
|
101
107
|
* @tag bk-lightbox
|
|
102
108
|
* @keyboard Enter, Space - On an image of the gallery: open the image in the lightbox.
|
|
@@ -122,6 +128,18 @@ export declare class BkLightbox extends LitElement {
|
|
|
122
128
|
type: BooleanConstructor;
|
|
123
129
|
reflect: boolean;
|
|
124
130
|
};
|
|
131
|
+
pageable: {
|
|
132
|
+
type: BooleanConstructor;
|
|
133
|
+
reflect: boolean;
|
|
134
|
+
};
|
|
135
|
+
first: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
reflect: boolean;
|
|
138
|
+
};
|
|
139
|
+
last: {
|
|
140
|
+
type: BooleanConstructor;
|
|
141
|
+
reflect: boolean;
|
|
142
|
+
};
|
|
125
143
|
variant: {
|
|
126
144
|
reflect: boolean;
|
|
127
145
|
useDefault: boolean;
|
|
@@ -165,6 +183,12 @@ export declare class BkLightbox extends LitElement {
|
|
|
165
183
|
filmstrip: boolean;
|
|
166
184
|
/** Previous and next wrap around: after the last image comes the first. Without it, they stop at the ends. */
|
|
167
185
|
loop: boolean;
|
|
186
|
+
/** The app has the list of pictures: the viewer shows previous and next also for one image and fires `page` beyond its own images. */
|
|
187
|
+
pageable: boolean;
|
|
188
|
+
/** With `pageable`: the shown picture is the first of the list of the app. The previous button is off. */
|
|
189
|
+
first: boolean;
|
|
190
|
+
/** With `pageable`: the shown picture is the last of the list of the app. The next button is off. */
|
|
191
|
+
last: boolean;
|
|
168
192
|
/** `grid`: square thumbnails that fill the width. `strip`: a wrapping row of thumbnails at one height. */
|
|
169
193
|
variant: "grid" | "strip";
|
|
170
194
|
/** Accessible name of the viewer (default from i18n). */
|
|
@@ -16,6 +16,9 @@ class BkLightbox extends LitElement {
|
|
|
16
16
|
items: { attribute: false },
|
|
17
17
|
filmstrip: { type: Boolean, reflect: true },
|
|
18
18
|
loop: { type: Boolean, reflect: true },
|
|
19
|
+
pageable: { type: Boolean, reflect: true },
|
|
20
|
+
first: { type: Boolean, reflect: true },
|
|
21
|
+
last: { type: Boolean, reflect: true },
|
|
19
22
|
variant: { reflect: true, useDefault: true },
|
|
20
23
|
label: {},
|
|
21
24
|
closeLabel: { attribute: "close-label" },
|
|
@@ -37,6 +40,9 @@ class BkLightbox extends LitElement {
|
|
|
37
40
|
this.items = [];
|
|
38
41
|
this.filmstrip = false;
|
|
39
42
|
this.loop = false;
|
|
43
|
+
this.pageable = false;
|
|
44
|
+
this.first = false;
|
|
45
|
+
this.last = false;
|
|
40
46
|
this.variant = "grid";
|
|
41
47
|
this.label = "";
|
|
42
48
|
this.closeLabel = "";
|
|
@@ -271,6 +277,7 @@ class BkLightbox extends LitElement {
|
|
|
271
277
|
<bk-dialog bare exportparts="dialog" heading=${this.label || this.i18n.t("imageViewer")} .open=${this.open}
|
|
272
278
|
@open=${this.onDialogOpen} @close=${this.onDialogClose}>
|
|
273
279
|
<bk-image-viewer part="viewer" autofocus immersive .items=${this.view} .index=${this.index} ?filmstrip=${this.filmstrip} ?loop=${this.loop}
|
|
280
|
+
?pageable=${this.pageable} ?first=${this.first} ?last=${this.last}
|
|
274
281
|
label=${this.label || this.i18n.t("imageViewer")} prev-label=${this.prevLabel} next-label=${this.nextLabel}
|
|
275
282
|
zoom-in-label=${this.zoomInLabel} zoom-out-label=${this.zoomOutLabel} fit-label=${this.fitLabel}
|
|
276
283
|
actual-size-label=${this.actualSizeLabel} error-label=${this.errorLabel}
|
|
@@ -29,6 +29,8 @@ import { LitElement } from "lit";
|
|
|
29
29
|
* @cssprop --bk-page-cta-fg - Text colour (default --bk-text; `plain`: the colour of the band).
|
|
30
30
|
* @cssprop --bk-page-cta-border - Border colour (default --bk-layer-raised-border; `plain`: transparent).
|
|
31
31
|
* @cssprop --bk-page-cta-shadow - Shadow (default --bk-layer-raised-shadow; `plain`: none).
|
|
32
|
+
* @cssprop --bk-page-cta-ring - An image (for example a gradient) that the box shows as its ring, over the border, in its radius
|
|
33
|
+
* (default none).
|
|
32
34
|
* @cssprop --bk-page-cta-radius - Corner radius (default --bk-radius-xl).
|
|
33
35
|
* @cssprop --bk-page-cta-padding-block - Space above and below the content (default --bk-space-10).
|
|
34
36
|
* @cssprop --bk-page-cta-padding-inline - Space beside the content (default --bk-space-8).
|
|
@@ -30,6 +30,13 @@ class BkPageCta extends LitElement {
|
|
|
30
30
|
background: var(--bk-page-cta-bg, var(--bk-layer-raised-bg)); color: var(--bk-page-cta-fg, var(--bk-text));
|
|
31
31
|
border: var(--bk-border-width) solid var(--bk-page-cta-border, var(--bk-layer-raised-border));
|
|
32
32
|
border-radius: var(--bk-page-cta-radius, var(--bk-radius-xl)); box-shadow: var(--bk-page-cta-shadow, var(--bk-layer-raised-shadow));
|
|
33
|
+
position: relative;
|
|
34
|
+
}
|
|
35
|
+
/* The ring: an image over the border, cut to a ring in the radius of the box. */
|
|
36
|
+
.box::after {
|
|
37
|
+
content: ""; position: absolute; inset: calc(-1 * var(--bk-border-width)); pointer-events: none; border-radius: inherit;
|
|
38
|
+
padding: var(--bk-border-width); background: var(--bk-page-cta-ring, none);
|
|
39
|
+
mask: linear-gradient(currentColor 0 0) content-box exclude, linear-gradient(currentColor 0 0);
|
|
33
40
|
}
|
|
34
41
|
/* The border stays transparent, so the content keeps its place when the variant changes. */
|
|
35
42
|
:host([variant="plain"]) .box {
|
|
@@ -47,7 +54,7 @@ class BkPageCta extends LitElement {
|
|
|
47
54
|
color: var(--bk-page-cta-body-fg, var(--bk-text-muted)); font-size: var(--bk-type-body); line-height: var(--bk-line-height-body);
|
|
48
55
|
}
|
|
49
56
|
.actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--bk-space-cluster); margin-block-start: var(--bk-space-2); }
|
|
50
|
-
@media (forced-colors: active) { :host(:not([variant="plain"])) .box { border-color: CanvasText; } }
|
|
57
|
+
@media (forced-colors: active) { :host(:not([variant="plain"])) .box { border-color: CanvasText; } .box::after { display: none; } }
|
|
51
58
|
`];
|
|
52
59
|
render() {
|
|
53
60
|
const s = this.slots;
|
|
@@ -431,6 +431,8 @@ class BkSplitGrid extends LitElement {
|
|
|
431
431
|
const g = ghost.getBoundingClientRect();
|
|
432
432
|
d.offX = Math.min(Math.max(d.x0 - h.left, 0), g.width);
|
|
433
433
|
d.offY = Math.min(Math.max(d.y0 - h.top, 0), g.height);
|
|
434
|
+
d.ghostW = g.width;
|
|
435
|
+
d.ghostH = g.height;
|
|
434
436
|
}
|
|
435
437
|
/** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
|
|
436
438
|
measureDrag(d) {
|
|
@@ -463,8 +465,11 @@ class BkSplitGrid extends LitElement {
|
|
|
463
465
|
if (!d.rects)
|
|
464
466
|
this.measureDrag(d);
|
|
465
467
|
const ghost = this.renderRoot.querySelector(".ghost");
|
|
466
|
-
if (ghost)
|
|
467
|
-
|
|
468
|
+
if (ghost) {
|
|
469
|
+
const x = Math.min(Math.max(d.x - d.offX, 0), Math.max(0, window.innerWidth - (d.ghostW ?? 0)));
|
|
470
|
+
const y = Math.min(Math.max(d.y - d.offY, 0), Math.max(0, window.innerHeight - (d.ghostH ?? 0)));
|
|
471
|
+
ghost.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
|
|
472
|
+
}
|
|
468
473
|
const b = d.box;
|
|
469
474
|
const inside = d.x >= b.left && d.x <= b.right && d.y >= b.top && d.y <= b.bottom;
|
|
470
475
|
if (!inside) {
|
|
@@ -56,6 +56,8 @@ import "../icons/set/trending-up.js";
|
|
|
56
56
|
* @cssprop --bk-stat-gap - Space between the rows (default --bk-space-1; xl --bk-space-4).
|
|
57
57
|
* @cssprop --bk-stat-start-gap - Space between the `start` slot and the figures (default --bk-space-3).
|
|
58
58
|
* @cssprop --bk-stat-label-color - Label colour (default --bk-text-muted).
|
|
59
|
+
* @cssprop --bk-stat-label-transform - Label text transform (default none).
|
|
60
|
+
* @cssprop --bk-stat-label-tracking - Label letter spacing (default normal; for uppercase use --bk-tracking-label).
|
|
59
61
|
* @cssprop --bk-stat-label-size - Label size (default --bk-type-small; xl --bk-type-lead).
|
|
60
62
|
* @cssprop --bk-stat-value-color - Value colour (default --bk-text; with `tone` --bk-{tone}-text).
|
|
61
63
|
* @cssprop --bk-stat-value-size - Value size (default sm --bk-type-h3, md --bk-type-h2, lg --bk-chart-hero-size, xl twice --bk-type-display, at most 8/3 of --bk-text-3xl, 80px by default: a fluid display size does not make it larger).
|
|
@@ -51,7 +51,7 @@ class BkStat extends LitElement {
|
|
|
51
51
|
.start { display: flex; flex: none; }
|
|
52
52
|
/* A centred band (\`bk-page-section align="center"\`) centres the rows: the value, the label, the change and the note. */
|
|
53
53
|
.stat { flex: 1; align-self: stretch; display: flex; flex-direction: column; align-items: var(--_bk-page-section-items, stretch); gap: var(--bk-stat-gap, var(--bk-space-1)); min-width: 0; }
|
|
54
|
-
.label { font-size: var(--bk-stat-label-size, var(--bk-type-small)); color: var(--bk-stat-label-color, var(--bk-text-muted)); line-height: var(--bk-line-height-tight); }
|
|
54
|
+
.label { text-transform: var(--bk-stat-label-transform, none); letter-spacing: var(--bk-stat-label-tracking, normal); font-size: var(--bk-stat-label-size, var(--bk-type-small)); color: var(--bk-stat-label-color, var(--bk-text-muted)); line-height: var(--bk-line-height-tight); }
|
|
55
55
|
.figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--bk-space-1); min-width: 0; }
|
|
56
56
|
.value {
|
|
57
57
|
font-size: var(--_bk-stat-size); font-weight: var(--bk-stat-value-weight, var(--bk-weight-semibold));
|
|
@@ -288,6 +288,8 @@ export type TableCSVOptions = {
|
|
|
288
288
|
* @cssprop --bk-table-head-fg - Header text colour (default --bk-text-muted).
|
|
289
289
|
* @cssprop --bk-table-head-weight - Header font weight (default --bk-weight-medium).
|
|
290
290
|
* @cssprop --bk-table-head-size - Header font size (default: --bk-group-label-size, else the table size).
|
|
291
|
+
* @cssprop --bk-table-head-transform - Header text transform (default --bk-group-label-transform, else --bk-label-transform, else none).
|
|
292
|
+
* @cssprop --bk-table-head-tracking - Header letter spacing (default --bk-group-label-tracking, else --bk-label-tracking, else normal; for uppercase use --bk-tracking-label).
|
|
291
293
|
* @cssprop --bk-table-head-leading - Header line height (default --bk-line-height-heading).
|
|
292
294
|
* @cssprop --bk-table-head-bg - Header background (default transparent; --bk-layer-sticky-bg with `sticky-header`).
|
|
293
295
|
* @cssprop --bk-table-foot-bg - Footer background (default transparent; --bk-layer-sticky-bg with `sticky-footer`).
|
|
@@ -78,7 +78,7 @@ const tableStyles = css`
|
|
|
78
78
|
font-weight: var(--bk-table-head-weight, var(--bk-group-label-weight, var(--bk-label-weight, var(--bk-weight-medium)))); color: var(--bk-table-head-fg, var(--bk-group-label-color, var(--bk-text-muted)));
|
|
79
79
|
font-size: var(--bk-table-head-size, var(--bk-group-label-size, 1em));
|
|
80
80
|
line-height: var(--bk-table-head-leading, var(--bk-line-height-heading));
|
|
81
|
-
text-transform: var(--bk-group-label-transform, var(--bk-label-transform, none)); letter-spacing: var(--bk-group-label-tracking, var(--bk-label-tracking, normal)); font-family: var(--bk-font-label, inherit);
|
|
81
|
+
text-transform: var(--bk-table-head-transform, var(--bk-group-label-transform, var(--bk-label-transform, none))); letter-spacing: var(--bk-table-head-tracking, var(--bk-group-label-tracking, var(--bk-label-tracking, normal))); font-family: var(--bk-font-label, inherit);
|
|
82
82
|
background: var(--bk-table-head-bg, transparent); white-space: nowrap;
|
|
83
83
|
}
|
|
84
84
|
bk-table > table > tbody > tr > th { font-weight: var(--bk-table-row-head-weight, var(--bk-weight-medium)); }
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import "./bk-button.js";
|
|
3
3
|
import "./bk-icon.js";
|
|
4
|
-
import "./bk-menu.js";
|
|
5
4
|
import "../icons/set/add.js";
|
|
6
5
|
import "../icons/set/more-horiz.js";
|
|
7
6
|
export type { TabRemoveDetail } from "./bk-tabs-item.js";
|
|
@@ -210,6 +209,8 @@ export declare class BkTabs extends LitElement {
|
|
|
210
209
|
private get linkMode();
|
|
211
210
|
static styles: import("lit").CSSResult[];
|
|
212
211
|
protected willUpdate(changed: PropertyValues): void;
|
|
212
|
+
/** `updateComplete` includes the load of the "More" menu while tabs do not fit. */
|
|
213
|
+
protected getUpdateComplete(): Promise<boolean>;
|
|
213
214
|
protected updated(changed: PropertyValues): void;
|
|
214
215
|
/** Gives each tab its state: selected, Tab stop, its panel, in the "More" menu. */
|
|
215
216
|
private syncTabs;
|
|
@@ -7,16 +7,17 @@ import { emit, emitDetail } from "../internal/events.js";
|
|
|
7
7
|
import { navigateClick } from "../internal/link.js";
|
|
8
8
|
import { LocalizeController } from "../i18n.js";
|
|
9
9
|
import { StateController } from "../internal/state.js";
|
|
10
|
+
import { LateLoad } from "../internal/late.js";
|
|
11
|
+
import { lateParts } from "#bk/internal/late/bk-tabs.js";
|
|
10
12
|
import { base, interactive } from "../internal/styles.js";
|
|
11
13
|
import { BkTabsItem } from "./bk-tabs-item.js";
|
|
12
14
|
import { BkTabsPanel } from "./bk-tabs-panel.js";
|
|
13
|
-
import { BkMenuItem } from "./bk-menu-item.js";
|
|
14
15
|
import "./bk-button.js";
|
|
15
16
|
import "./bk-icon.js";
|
|
16
|
-
import "./bk-menu.js";
|
|
17
17
|
import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
|
|
18
18
|
import "../icons/set/add.js";
|
|
19
19
|
import "../icons/set/more-horiz.js";
|
|
20
|
+
const moreParts = new LateLoad(lateParts, "bk-menu", "bk-menu-item");
|
|
20
21
|
const keyOf = (el, i) => el.value || String(i);
|
|
21
22
|
class BkTabs extends LitElement {
|
|
22
23
|
static shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: "manual" };
|
|
@@ -138,6 +139,8 @@ class BkTabs extends LitElement {
|
|
|
138
139
|
:host([overflow="scroll"]) ::slotted(bk-tabs-item) { scroll-snap-align: start; }
|
|
139
140
|
:host([overflow="scroll"]) .more { display: none; }
|
|
140
141
|
.more { flex: none; display: flex; align-items: center; margin-inline-start: calc(var(--bk-tabs-more-gap, var(--bk-space-cluster)) - var(--bk-space-cluster)); }
|
|
142
|
+
/* Until bk-menu loads, only its trigger shows: the entries are not text in the row. */
|
|
143
|
+
.more:not(:defined) > :not([slot="trigger"]) { display: none; }
|
|
141
144
|
.more.off { position: absolute; inset-block-start: 0; inset-inline-end: 0; visibility: hidden; pointer-events: none; }
|
|
142
145
|
:host([orientation="vertical"]) .more { display: none; }
|
|
143
146
|
.end { display: flex; align-items: center; gap: var(--bk-space-cluster); flex: none; }
|
|
@@ -228,6 +231,15 @@ class BkTabs extends LitElement {
|
|
|
228
231
|
const hidden = this.overflowFor();
|
|
229
232
|
if (hidden.length !== this.overflowed.length || hidden.some((t, i) => t !== this.overflowed[i]))
|
|
230
233
|
this.overflowed = hidden;
|
|
234
|
+
if (this.overflowed.length)
|
|
235
|
+
void moreParts.start();
|
|
236
|
+
}
|
|
237
|
+
/** `updateComplete` includes the load of the "More" menu while tabs do not fit. */
|
|
238
|
+
async getUpdateComplete() {
|
|
239
|
+
const result = await super.getUpdateComplete();
|
|
240
|
+
if (this.overflowed.length)
|
|
241
|
+
await moreParts.start();
|
|
242
|
+
return result;
|
|
231
243
|
}
|
|
232
244
|
updated(changed) {
|
|
233
245
|
super.updated(changed);
|
|
@@ -448,7 +460,7 @@ class BkTabs extends LitElement {
|
|
|
448
460
|
}
|
|
449
461
|
/** The tab of an entry of the "More" menu. */
|
|
450
462
|
tabOfEntry(e) {
|
|
451
|
-
const entry = e.composedPath().find((n) => n instanceof
|
|
463
|
+
const entry = e.composedPath().find((n) => n instanceof Element && n.localName === "bk-menu-item");
|
|
452
464
|
return entry ? this.tabs.find((t, i) => keyOf(t, i) === entry.value) : void 0;
|
|
453
465
|
}
|
|
454
466
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ export * from "./components/bk-segmented-item.js";
|
|
|
144
144
|
export * from "./components/bk-segmented.js";
|
|
145
145
|
export * from "./components/bk-select.js";
|
|
146
146
|
export * from "./components/bk-combobox.js";
|
|
147
|
+
export * from "./components/bk-input-tags.js";
|
|
147
148
|
export * from "./components/bk-kbd-shortcuts.js";
|
|
148
149
|
export * from "./components/bk-input-slider-range.js";
|
|
149
150
|
export * from "./components/bk-input-slider.js";
|
package/dist/index.js
CHANGED
|
@@ -140,6 +140,7 @@ export * from "./components/bk-segmented-item.js";
|
|
|
140
140
|
export * from "./components/bk-segmented.js";
|
|
141
141
|
export * from "./components/bk-select.js";
|
|
142
142
|
export * from "./components/bk-combobox.js";
|
|
143
|
+
export * from "./components/bk-input-tags.js";
|
|
143
144
|
export * from "./components/bk-kbd-shortcuts.js";
|
|
144
145
|
export * from "./components/bk-input-slider-range.js";
|
|
145
146
|
export * from "./components/bk-input-slider.js";
|
|
@@ -23,6 +23,12 @@ export declare function topModal(): HTMLDialogElement | undefined;
|
|
|
23
23
|
export interface AnnounceOptions {
|
|
24
24
|
/** Use the assertive region: the text interrupts the screen reader (errors, danger). */
|
|
25
25
|
assertive?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The sender. In one short window a new message replaces the pending message of the same sender. Messages of
|
|
28
|
+
* different senders are read together (two alerts that connect in one update). Messages without a sender replace
|
|
29
|
+
* each other (a count that changes quickly).
|
|
30
|
+
*/
|
|
31
|
+
source?: object;
|
|
26
32
|
}
|
|
27
33
|
export declare function announce(text: string, options?: AnnounceOptions): void;
|
|
28
34
|
//# sourceMappingURL=announcer.d.ts.map
|
|
@@ -25,7 +25,7 @@ function topModal() {
|
|
|
25
25
|
top = d;
|
|
26
26
|
return top;
|
|
27
27
|
}
|
|
28
|
-
const regions = { polite: {}, assertive: {} };
|
|
28
|
+
const regions = { polite: { pending: [] }, assertive: { pending: [] } };
|
|
29
29
|
function announce(text, options = {}) {
|
|
30
30
|
if (!text || typeof document === "undefined")
|
|
31
31
|
return;
|
|
@@ -42,10 +42,15 @@ function announce(text, options = {}) {
|
|
|
42
42
|
const home = topModal() ?? document.body;
|
|
43
43
|
if (live.parentNode !== home)
|
|
44
44
|
home.append(live);
|
|
45
|
+
const at = slot.pending.findIndex((m) => m.source === options.source);
|
|
46
|
+
if (at >= 0)
|
|
47
|
+
slot.pending.splice(at, 1);
|
|
48
|
+
slot.pending.push({ text, source: options.source });
|
|
45
49
|
live.textContent = "";
|
|
46
50
|
clearTimeout(slot.timer);
|
|
47
51
|
slot.timer = setTimeout(() => {
|
|
48
|
-
live.textContent
|
|
52
|
+
live.replaceChildren(...slot.pending.map((m) => Object.assign(document.createElement("div"), { textContent: m.text })));
|
|
53
|
+
slot.pending = [];
|
|
49
54
|
}, 50);
|
|
50
55
|
}
|
|
51
56
|
export {
|
package/dist/internal/cloak.js
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
* Registers a custom element once. Two copies of the library on one page (or HMR) must not throw,
|
|
3
3
|
* so an existing definition wins. Also makes sure the design tokens are in the document, and that an
|
|
4
4
|
* element renders over the HTML of the server (see `renderOverServerHtml`).
|
|
5
|
+
* In the browser, each call also schedules the check for elements of the library that no code defines.
|
|
5
6
|
*/
|
|
6
7
|
export declare function define(tag: string, ctor: CustomElementConstructor): void;
|
|
8
|
+
/** The tags that showed a warning. Each tag shows one warning (also the warning of internal/late.ts). */
|
|
9
|
+
export declare const warnedTags: Set<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Shows a warning for each element of the library in `root` that no code defines. It also looks into the open
|
|
12
|
+
* shadow root of each defined element of the library: a part that a component renders but that did not load.
|
|
13
|
+
* Internal: define() calls it when the browser is idle. Tests call it directly.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reportUndefinedElements(root?: Document | ShadowRoot): void;
|
|
7
16
|
//# sourceMappingURL=define.d.ts.map
|
package/dist/internal/define.js
CHANGED
|
@@ -1,15 +1,61 @@
|
|
|
1
1
|
import { isServer } from "lit";
|
|
2
2
|
import { adoptTokens } from "../tokens.js";
|
|
3
|
+
import { libraryTags } from "./elements.js";
|
|
3
4
|
import { renderOverServerHtml } from "./server.js";
|
|
4
5
|
function define(tag, ctor) {
|
|
5
6
|
adoptTokens();
|
|
7
|
+
if (!isServer)
|
|
8
|
+
scheduleCheck();
|
|
6
9
|
if (customElements.get(tag))
|
|
7
10
|
return;
|
|
8
11
|
if (!isServer)
|
|
9
12
|
renderOverServerHtml(ctor);
|
|
10
13
|
customElements.define(tag, ctor);
|
|
11
14
|
}
|
|
15
|
+
const CHECK_DELAY = 2e3;
|
|
16
|
+
const warnedTags = /* @__PURE__ */ new Set();
|
|
17
|
+
let known;
|
|
18
|
+
let timer;
|
|
19
|
+
let queued = false;
|
|
20
|
+
function scheduleCheck() {
|
|
21
|
+
if (queued || typeof document === "undefined")
|
|
22
|
+
return;
|
|
23
|
+
clearTimeout(timer);
|
|
24
|
+
timer = setTimeout(queueCheck, CHECK_DELAY);
|
|
25
|
+
}
|
|
26
|
+
function queueCheck() {
|
|
27
|
+
if (document.readyState !== "complete") {
|
|
28
|
+
timer = setTimeout(queueCheck, CHECK_DELAY);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
queued = true;
|
|
32
|
+
const run = () => {
|
|
33
|
+
queued = false;
|
|
34
|
+
reportUndefinedElements();
|
|
35
|
+
};
|
|
36
|
+
if (typeof requestIdleCallback === "function")
|
|
37
|
+
requestIdleCallback(run, { timeout: CHECK_DELAY });
|
|
38
|
+
else
|
|
39
|
+
setTimeout(run, 0);
|
|
40
|
+
}
|
|
41
|
+
function reportUndefinedElements(root = document) {
|
|
42
|
+
known ??= new Set(libraryTags.split(" ").map((name) => `bk-${name}`));
|
|
43
|
+
for (const el of root.querySelectorAll("*")) {
|
|
44
|
+
const tag = el.localName;
|
|
45
|
+
if (!tag.startsWith("bk-") || !known.has(tag))
|
|
46
|
+
continue;
|
|
47
|
+
if (!customElements.get(tag)) {
|
|
48
|
+
if (warnedTags.has(tag))
|
|
49
|
+
continue;
|
|
50
|
+
warnedTags.add(tag);
|
|
51
|
+
console.warn(`@bk2k/ui: <${tag}> is in the page, but no code defines it. Add: import "@bk2k/ui/${tag}.js";`);
|
|
52
|
+
} else if (el.shadowRoot)
|
|
53
|
+
reportUndefinedElements(el.shadowRoot);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
12
56
|
export {
|
|
13
|
-
define
|
|
57
|
+
define,
|
|
58
|
+
reportUndefinedElements,
|
|
59
|
+
warnedTags
|
|
14
60
|
};
|
|
15
61
|
//# sourceMappingURL=define.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tags of all elements of the library, without the prefix `bk-`, separated by a space. One string costs less
|
|
3
|
+
* in each bundle than an array.
|
|
4
|
+
*/
|
|
5
|
+
export declare const libraryTags = "accordion accordion-item action-bar alert alert-offline app-state attachment avatar avatar-group badge bar brand breadcrumbs button button-copy button-group button-share button-top calendar calendar-event calendar-week card carousel carousel-controls carousel-item chart-area chart-bar chart-bar-list chart-bridge chart-bullet chart-calendar chart-heatmap chart-histogram chart-legend chart-line chart-mark chart-scatter chart-sparkline chart-stacked-bar chart-tracker chart-waterfall checkbox checkbox-group chip chip-group cluster code code-diff code-stack color-panel columns combobox command-menu command-palette composer delta diagram dialog disclosure divider drawer drop-target empty-state error-summary facts facts-item feature fieldset filter-bar folder-browser footnote footnotes footnotes-item form-guard form-steps grid icon icon-tile image-compare image-crop image-editor image-viewer input-code input-color input-date input-date-range input-file input-group input-inline input-number input-rating input-rich input-search input-slider input-slider-range input-tags input-text input-time input-time-zone item item-group kbd kbd-shortcuts lightbox lines link listbox listbox-columns listbox-item listbox-search listbox-transfer logo logo-wall menu menu-bar menu-context menu-divider menu-item menu-label menu-list message message-approval message-branches message-citation message-feedback message-list message-reasoning message-source message-tool message-tool-group meter model-viewer nav nav-divider nav-group nav-item nav-toc overflow page-cta page-footer page-footer-column page-header page-hero page-pager page-section pagination pane panel period-nav picture popover popover-help presence-cursor preview progress prose qr-code radio radio-group rating scroll segmented segmented-item select select-cascade select-tree shell-app shell-centered shell-sites skeleton sortable spinner split split-grid stack stat stat-group status-dot steps steps-item surface swatch swatch-group swatch-palette switch table tabs tabs-item tabs-panel tasks tasks-item testimonial text time-countdown time-relative timeline timeline-item toast toast-group toolbar tooltip tree tree-item video visually-hidden zoom";
|
|
6
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const libraryTags = "accordion accordion-item action-bar alert alert-offline app-state attachment avatar avatar-group badge bar brand breadcrumbs button button-copy button-group button-share button-top calendar calendar-event calendar-week card carousel carousel-controls carousel-item chart-area chart-bar chart-bar-list chart-bridge chart-bullet chart-calendar chart-heatmap chart-histogram chart-legend chart-line chart-mark chart-scatter chart-sparkline chart-stacked-bar chart-tracker chart-waterfall checkbox checkbox-group chip chip-group cluster code code-diff code-stack color-panel columns combobox command-menu command-palette composer delta diagram dialog disclosure divider drawer drop-target empty-state error-summary facts facts-item feature fieldset filter-bar folder-browser footnote footnotes footnotes-item form-guard form-steps grid icon icon-tile image-compare image-crop image-editor image-viewer input-code input-color input-date input-date-range input-file input-group input-inline input-number input-rating input-rich input-search input-slider input-slider-range input-tags input-text input-time input-time-zone item item-group kbd kbd-shortcuts lightbox lines link listbox listbox-columns listbox-item listbox-search listbox-transfer logo logo-wall menu menu-bar menu-context menu-divider menu-item menu-label menu-list message message-approval message-branches message-citation message-feedback message-list message-reasoning message-source message-tool message-tool-group meter model-viewer nav nav-divider nav-group nav-item nav-toc overflow page-cta page-footer page-footer-column page-header page-hero page-pager page-section pagination pane panel period-nav picture popover popover-help presence-cursor preview progress prose qr-code radio radio-group rating scroll segmented segmented-item select select-cascade select-tree shell-app shell-centered shell-sites skeleton sortable spinner split split-grid stack stat stat-group status-dot steps steps-item surface swatch swatch-group swatch-palette switch table tabs tabs-item tabs-panel tasks tasks-item testimonial text time-countdown time-relative timeline timeline-item toast toast-group toolbar tooltip tree tree-item video visually-hidden zoom";
|
|
2
|
+
export {
|
|
3
|
+
libraryTags
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=elements.js.map
|
package/dist/internal/hue.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/** Stable hue 0–359 from a string, so the same name always gets the same colour. */
|
|
2
2
|
export declare function hue(text: string): number;
|
|
3
|
+
/**
|
|
4
|
+
* The colours that `bk-avatar` and `bk-logo` give a name: `bg` and `fg` as CSS colours that follow the theme. An app
|
|
5
|
+
* paints other surfaces of the same person or thing with them (a cover without an image).
|
|
6
|
+
*/
|
|
7
|
+
export declare function nameColors(name: string): {
|
|
8
|
+
bg: string;
|
|
9
|
+
fg: string;
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* The tile colours of a name: `--_bk-hue-bg` and `--_bk-hue-fg` from the hue in `--_bk-hue-h`. Set the hue with
|
|
5
13
|
* `setHostVars(this, { "--_bk-hue-h": String(hue(name)) })` in `willUpdate`. Shared by `bk-avatar` and `bk-logo`.
|
package/dist/internal/hue.js
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css, unsafeCSS } from "lit";
|
|
2
2
|
function hue(text) {
|
|
3
3
|
let h = 0;
|
|
4
4
|
for (let i = 0; i < text.length; i++)
|
|
5
5
|
h = h * 31 + text.charCodeAt(i) >>> 0;
|
|
6
6
|
return h % 360;
|
|
7
7
|
}
|
|
8
|
+
function tileColors(h) {
|
|
9
|
+
return {
|
|
10
|
+
bg: `light-dark(oklch(0.9 0.05 ${h}), oklch(0.36 0.06 ${h}))`,
|
|
11
|
+
fg: `light-dark(oklch(0.38 0.09 ${h}), oklch(0.9 0.06 ${h}))`
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function nameColors(name) {
|
|
15
|
+
return tileColors(hue(name));
|
|
16
|
+
}
|
|
17
|
+
const shared = tileColors("var(--_bk-hue-h)");
|
|
8
18
|
const hueColors = css`
|
|
9
19
|
:host {
|
|
10
|
-
--_bk-hue-bg:
|
|
11
|
-
--_bk-hue-fg:
|
|
20
|
+
--_bk-hue-bg: ${unsafeCSS(shared.bg)};
|
|
21
|
+
--_bk-hue-fg: ${unsafeCSS(shared.fg)};
|
|
12
22
|
}
|
|
13
23
|
`;
|
|
14
24
|
export {
|
|
15
25
|
hue,
|
|
16
|
-
hueColors
|
|
26
|
+
hueColors,
|
|
27
|
+
nameColors
|
|
17
28
|
};
|
|
18
29
|
//# sourceMappingURL=hue.js.map
|
package/dist/internal/late.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isServer } from "lit";
|
|
2
|
-
|
|
2
|
+
import { warnedTags } from "./define.js";
|
|
3
3
|
class LateLoad {
|
|
4
4
|
parts;
|
|
5
5
|
/** True when the modules are loaded. The server never loads them: it renders no optional part. */
|
|
@@ -27,8 +27,8 @@ class LateLoad {
|
|
|
27
27
|
const load = this.parts[tag];
|
|
28
28
|
if (load)
|
|
29
29
|
return load();
|
|
30
|
-
if (!
|
|
31
|
-
|
|
30
|
+
if (!warnedTags.has(tag)) {
|
|
31
|
+
warnedTags.add(tag);
|
|
32
32
|
console.warn(`@bk2k/ui: a feature needs <${tag}>, but no code defines it. Add: import "@bk2k/ui/${tag}.js";`);
|
|
33
33
|
}
|
|
34
34
|
return void 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The parts of a list of tags (`SEPARATORS` between them), trimmed, without empty parts. */
|
|
2
|
+
export declare function splitTags(text: string): string[];
|
|
3
|
+
/**
|
|
4
|
+
* A paste into the text of a tag field. A pasted text with a separator is a list: the function cancels the paste and
|
|
5
|
+
* returns the parts of the typed text plus the pasted text. A text without a separator returns undefined: the browser
|
|
6
|
+
* inserts it as text.
|
|
7
|
+
*/
|
|
8
|
+
export declare function pastedTags(e: ClipboardEvent, typed: string): string[] | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Styles of the tags in the box of a text field. The tags and the text input are in `.values`; the box has the class
|
|
11
|
+
* `has-tags` while it shows tags. `prefix` names the public tokens: `--bk-<prefix>-tag-gap`,
|
|
12
|
+
* `--bk-<prefix>-tags-padding` and `--bk-<prefix>-input-min-width`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function tagFieldStyles(prefix: string): import("lit").CSSResult;
|
|
15
|
+
//# sourceMappingURL=tags.d.ts.map
|