@syware/jlib 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/dist/all.js +6 -3
- package/dist/atoms/jl-app-icon.css.js +3 -0
- package/dist/atoms/jl-app-icon.js +1 -1
- package/dist/atoms/jl-avatar.css.js +3 -0
- package/dist/atoms/jl-avatar.js +1 -1
- package/dist/atoms/jl-badge.css.js +3 -0
- package/dist/atoms/jl-badge.js +1 -1
- package/dist/atoms/jl-button.css.js +3 -0
- package/dist/atoms/jl-button.js +1 -1
- package/dist/atoms/jl-checkbox.css.js +3 -0
- package/dist/atoms/jl-checkbox.js +1 -1
- package/dist/atoms/jl-chip.css.js +3 -0
- package/dist/atoms/jl-chip.d.ts +1 -0
- package/dist/atoms/jl-chip.js +5 -3
- package/dist/atoms/jl-divider.css.js +3 -0
- package/dist/atoms/jl-divider.js +1 -1
- package/dist/atoms/jl-icon.css.js +3 -0
- package/dist/atoms/jl-icon.js +1 -1
- package/dist/atoms/jl-input.css.js +3 -0
- package/dist/atoms/jl-input.d.ts +2 -0
- package/dist/atoms/jl-input.js +10 -4
- package/dist/atoms/jl-kbd.css.js +3 -0
- package/dist/atoms/jl-kbd.js +1 -1
- package/dist/atoms/jl-link.css.js +3 -0
- package/dist/atoms/jl-link.js +1 -1
- package/dist/atoms/jl-loading-bar.css.js +3 -0
- package/dist/atoms/jl-loading-bar.d.ts +38 -0
- package/dist/atoms/jl-loading-bar.js +121 -0
- package/dist/atoms/jl-progress-ring.css.js +3 -0
- package/dist/atoms/jl-progress-ring.js +1 -1
- package/dist/atoms/jl-progress.css.js +3 -0
- package/dist/atoms/jl-progress.js +1 -1
- package/dist/atoms/jl-rating.css.js +3 -0
- package/dist/atoms/jl-rating.d.ts +2 -0
- package/dist/atoms/jl-rating.js +14 -6
- package/dist/atoms/jl-select.css.js +3 -0
- package/dist/atoms/jl-select.js +1 -1
- package/dist/atoms/jl-skeleton.css.js +3 -0
- package/dist/atoms/jl-skeleton.js +1 -1
- package/dist/atoms/jl-slider.css.js +3 -0
- package/dist/atoms/jl-slider.js +1 -1
- package/dist/atoms/jl-spinner.css.js +3 -0
- package/dist/atoms/jl-spinner.d.ts +2 -0
- package/dist/atoms/jl-spinner.js +7 -3
- package/dist/atoms/jl-switch.css.js +3 -0
- package/dist/atoms/jl-switch.js +1 -1
- package/dist/atoms/jl-textarea.css.js +3 -0
- package/dist/atoms/jl-textarea.js +1 -1
- package/dist/base/jl-element.d.ts +8 -0
- package/dist/base/jl-element.js +5 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -2
- package/dist/lib/flow.js +23 -6
- package/dist/lib/texts-de.d.ts +111 -0
- package/dist/lib/texts-de.js +114 -0
- package/dist/lib/texts-fr.d.ts +111 -0
- package/dist/lib/texts-fr.js +114 -0
- package/dist/lib/texts.d.ts +180 -91
- package/dist/lib/texts.js +177 -9
- package/dist/molecules/jl-accordion-item.css.js +3 -0
- package/dist/molecules/jl-accordion-item.js +1 -1
- package/dist/molecules/jl-accordion.css.js +3 -0
- package/dist/molecules/jl-accordion.js +1 -1
- package/dist/molecules/jl-account-button.css.js +3 -0
- package/dist/molecules/jl-account-button.js +1 -1
- package/dist/molecules/jl-alert.css.js +3 -0
- package/dist/molecules/jl-alert.d.ts +1 -0
- package/dist/molecules/jl-alert.js +5 -3
- package/dist/molecules/jl-avatar-group.css.js +3 -0
- package/dist/molecules/jl-avatar-group.js +1 -1
- package/dist/molecules/jl-breadcrumb.css.js +3 -0
- package/dist/molecules/jl-breadcrumb.d.ts +2 -0
- package/dist/molecules/jl-breadcrumb.js +13 -7
- package/dist/molecules/jl-calendar.css.js +3 -0
- package/dist/molecules/jl-calendar.d.ts +1 -0
- package/dist/molecules/jl-calendar.js +8 -5
- package/dist/molecules/jl-card.css.js +3 -0
- package/dist/molecules/jl-card.js +1 -1
- package/dist/molecules/jl-chip-group.css.js +3 -0
- package/dist/molecules/jl-chip-group.d.ts +1 -0
- package/dist/molecules/jl-chip-group.js +5 -2
- package/dist/molecules/jl-code-block.css.js +3 -0
- package/dist/molecules/jl-code-block.js +2 -2
- package/dist/molecules/jl-combobox.css.js +3 -0
- package/dist/molecules/jl-combobox.d.ts +3 -1
- package/dist/molecules/jl-combobox.js +13 -8
- package/dist/molecules/jl-copy-button.css.js +3 -0
- package/dist/molecules/jl-copy-button.d.ts +1 -0
- package/dist/molecules/jl-copy-button.js +8 -6
- package/dist/molecules/jl-date-picker.css.js +3 -0
- package/dist/molecules/jl-date-picker.d.ts +1 -0
- package/dist/molecules/jl-date-picker.js +11 -8
- package/dist/molecules/jl-empty.css.js +3 -0
- package/dist/molecules/jl-empty.js +1 -1
- package/dist/molecules/jl-facts.css.js +3 -0
- package/dist/molecules/jl-facts.js +1 -1
- package/dist/molecules/jl-field.css.js +3 -0
- package/dist/molecules/jl-field.js +1 -1
- package/dist/molecules/jl-file-drop.css.js +3 -0
- package/dist/molecules/jl-file-drop.d.ts +1 -0
- package/dist/molecules/jl-file-drop.js +16 -7
- package/dist/molecules/jl-input-list.css.js +3 -0
- package/dist/molecules/jl-input-list.d.ts +3 -2
- package/dist/molecules/jl-input-list.js +11 -8
- package/dist/molecules/jl-list-item.css.js +3 -0
- package/dist/molecules/jl-list-item.js +1 -1
- package/dist/molecules/jl-load-more.css.js +3 -0
- package/dist/molecules/jl-load-more.d.ts +4 -2
- package/dist/molecules/jl-load-more.js +16 -9
- package/dist/molecules/jl-load-state.css.js +3 -0
- package/dist/molecules/jl-load-state.d.ts +13 -0
- package/dist/molecules/jl-load-state.js +63 -12
- package/dist/molecules/jl-menu.css.js +3 -0
- package/dist/molecules/jl-menu.js +1 -1
- package/dist/molecules/jl-number-input.css.js +3 -0
- package/dist/molecules/jl-number-input.d.ts +1 -0
- package/dist/molecules/jl-number-input.js +7 -4
- package/dist/molecules/jl-pagination.css.js +3 -0
- package/dist/molecules/jl-pagination.d.ts +2 -0
- package/dist/molecules/jl-pagination.js +18 -10
- package/dist/molecules/jl-popover.css.js +3 -0
- package/dist/molecules/jl-popover.js +1 -1
- package/dist/molecules/jl-radio-group.css.js +3 -0
- package/dist/molecules/jl-radio-group.d.ts +1 -0
- package/dist/molecules/jl-radio-group.js +5 -2
- package/dist/molecules/jl-search-button.css.js +3 -0
- package/dist/molecules/jl-search-button.d.ts +2 -1
- package/dist/molecules/jl-search-button.js +7 -5
- package/dist/molecules/jl-search.css.js +3 -0
- package/dist/molecules/jl-search.d.ts +2 -0
- package/dist/molecules/jl-search.js +10 -4
- package/dist/molecules/jl-segmented.css.js +3 -0
- package/dist/molecules/jl-segmented.js +1 -1
- package/dist/molecules/jl-stat.css.js +3 -0
- package/dist/molecules/jl-stat.js +1 -1
- package/dist/molecules/jl-steps.css.js +3 -0
- package/dist/molecules/jl-steps.d.ts +2 -0
- package/dist/molecules/jl-steps.js +10 -5
- package/dist/molecules/jl-tab-panel.css.js +3 -0
- package/dist/molecules/jl-tab-panel.js +1 -1
- package/dist/molecules/jl-tabs.css.js +3 -0
- package/dist/molecules/jl-tabs.js +1 -1
- package/dist/molecules/jl-tag-input.css.js +3 -0
- package/dist/molecules/jl-tag-input.d.ts +1 -0
- package/dist/molecules/jl-tag-input.js +9 -5
- package/dist/molecules/jl-timeline.css.js +3 -0
- package/dist/molecules/jl-timeline.js +1 -1
- package/dist/molecules/jl-toast.css.js +3 -0
- package/dist/molecules/jl-toast.d.ts +1 -0
- package/dist/molecules/jl-toast.js +5 -3
- package/dist/molecules/jl-tooltip.css.js +3 -0
- package/dist/molecules/jl-tooltip.js +1 -1
- package/dist/organisms/jl-command-palette.css.js +3 -0
- package/dist/organisms/jl-command-palette.d.ts +3 -1
- package/dist/organisms/jl-command-palette.js +23 -15
- package/dist/organisms/jl-confirm.css.js +3 -0
- package/dist/organisms/jl-confirm.d.ts +3 -0
- package/dist/organisms/jl-confirm.js +13 -12
- package/dist/organisms/jl-dialog.css.js +3 -0
- package/dist/organisms/jl-dialog.d.ts +1 -0
- package/dist/organisms/jl-dialog.js +5 -3
- package/dist/organisms/jl-drawer.css.js +3 -0
- package/dist/organisms/jl-drawer.d.ts +1 -0
- package/dist/organisms/jl-drawer.js +5 -3
- package/dist/organisms/jl-flow.css.js +3 -0
- package/dist/organisms/jl-flow.d.ts +2 -0
- package/dist/organisms/jl-flow.js +26 -17
- package/dist/organisms/jl-navbar.css.js +3 -0
- package/dist/organisms/jl-navbar.d.ts +3 -0
- package/dist/organisms/jl-navbar.js +17 -8
- package/dist/organisms/jl-page-header.css.js +3 -0
- package/dist/organisms/jl-page-header.js +1 -1
- package/dist/organisms/jl-page-outlet.css.js +3 -0
- package/dist/organisms/jl-page-outlet.d.ts +34 -0
- package/dist/organisms/jl-page-outlet.js +107 -0
- package/dist/organisms/jl-side-nav.css.js +3 -0
- package/dist/organisms/jl-side-nav.d.ts +4 -2
- package/dist/organisms/jl-side-nav.js +18 -12
- package/dist/organisms/jl-tab-bar.css.js +3 -0
- package/dist/organisms/jl-tab-bar.d.ts +1 -0
- package/dist/organisms/jl-tab-bar.js +6 -3
- package/dist/organisms/jl-table.css.js +3 -0
- package/dist/organisms/jl-table.d.ts +2 -1
- package/dist/organisms/jl-table.js +10 -7
- package/dist/organisms/jl-toaster.css.js +3 -0
- package/dist/organisms/jl-toaster.d.ts +2 -1
- package/dist/organisms/jl-toaster.js +13 -10
- package/dist/organisms/jl-tree.css.js +3 -0
- package/dist/organisms/jl-tree.d.ts +6 -4
- package/dist/organisms/jl-tree.js +22 -16
- package/dist/styles/base.css.js +3 -0
- package/dist/styles/control.css.js +3 -0
- package/dist/styles/floating.css.js +3 -0
- package/dist/styles/shared.js +4 -4
- package/dist/styles/tokens.css.js +3 -0
- package/dist/templates/jl-app-shell.css.js +3 -0
- package/dist/templates/jl-app-shell.d.ts +1 -0
- package/dist/templates/jl-app-shell.js +5 -3
- package/dist/templates/jl-auth-layout.css.js +3 -0
- package/dist/templates/jl-auth-layout.d.ts +4 -3
- package/dist/templates/jl-auth-layout.js +14 -12
- package/dist/templates/jl-page.css.js +3 -0
- package/dist/templates/jl-page.d.ts +1 -0
- package/dist/templates/jl-page.js +5 -2
- package/dist/templates/jl-split-view.css.js +3 -0
- package/dist/templates/jl-split-view.d.ts +1 -0
- package/dist/templates/jl-split-view.js +6 -5
- package/dist/templates/jl-stack.css.js +3 -0
- package/dist/templates/jl-stack.d.ts +17 -0
- package/dist/templates/jl-stack.js +36 -0
- package/dist/types/jl-stack.types.d.ts +2 -0
- package/dist/types/texts.types.d.ts +29 -4
- package/package.json +5 -4
- package/dist/atoms/jl-app-icon.css_raw.js +0 -3
- package/dist/atoms/jl-avatar.css_raw.js +0 -3
- package/dist/atoms/jl-badge.css_raw.js +0 -3
- package/dist/atoms/jl-button.css_raw.js +0 -3
- package/dist/atoms/jl-checkbox.css_raw.js +0 -3
- package/dist/atoms/jl-chip.css_raw.js +0 -3
- package/dist/atoms/jl-divider.css_raw.js +0 -3
- package/dist/atoms/jl-icon.css_raw.js +0 -3
- package/dist/atoms/jl-input.css_raw.js +0 -3
- package/dist/atoms/jl-kbd.css_raw.js +0 -3
- package/dist/atoms/jl-link.css_raw.js +0 -3
- package/dist/atoms/jl-progress-ring.css_raw.js +0 -3
- package/dist/atoms/jl-progress.css_raw.js +0 -3
- package/dist/atoms/jl-rating.css_raw.js +0 -3
- package/dist/atoms/jl-select.css_raw.js +0 -3
- package/dist/atoms/jl-skeleton.css_raw.js +0 -3
- package/dist/atoms/jl-slider.css_raw.js +0 -3
- package/dist/atoms/jl-spinner.css_raw.js +0 -3
- package/dist/atoms/jl-switch.css_raw.js +0 -3
- package/dist/atoms/jl-textarea.css_raw.js +0 -3
- package/dist/molecules/jl-accordion-item.css_raw.js +0 -3
- package/dist/molecules/jl-accordion.css_raw.js +0 -3
- package/dist/molecules/jl-account-button.css_raw.js +0 -3
- package/dist/molecules/jl-alert.css_raw.js +0 -3
- package/dist/molecules/jl-avatar-group.css_raw.js +0 -3
- package/dist/molecules/jl-breadcrumb.css_raw.js +0 -3
- package/dist/molecules/jl-calendar.css_raw.js +0 -3
- package/dist/molecules/jl-card.css_raw.js +0 -3
- package/dist/molecules/jl-chip-group.css_raw.js +0 -3
- package/dist/molecules/jl-code-block.css_raw.js +0 -3
- package/dist/molecules/jl-combobox.css_raw.js +0 -3
- package/dist/molecules/jl-copy-button.css_raw.js +0 -3
- package/dist/molecules/jl-date-picker.css_raw.js +0 -3
- package/dist/molecules/jl-empty.css_raw.js +0 -3
- package/dist/molecules/jl-facts.css_raw.js +0 -3
- package/dist/molecules/jl-field.css_raw.js +0 -3
- package/dist/molecules/jl-file-drop.css_raw.js +0 -3
- package/dist/molecules/jl-input-list.css_raw.js +0 -3
- package/dist/molecules/jl-list-item.css_raw.js +0 -3
- package/dist/molecules/jl-load-more.css_raw.js +0 -3
- package/dist/molecules/jl-load-state.css_raw.js +0 -3
- package/dist/molecules/jl-menu.css_raw.js +0 -3
- package/dist/molecules/jl-number-input.css_raw.js +0 -3
- package/dist/molecules/jl-pagination.css_raw.js +0 -3
- package/dist/molecules/jl-popover.css_raw.js +0 -3
- package/dist/molecules/jl-radio-group.css_raw.js +0 -3
- package/dist/molecules/jl-search-button.css_raw.js +0 -3
- package/dist/molecules/jl-search.css_raw.js +0 -3
- package/dist/molecules/jl-segmented.css_raw.js +0 -3
- package/dist/molecules/jl-stat.css_raw.js +0 -3
- package/dist/molecules/jl-steps.css_raw.js +0 -3
- package/dist/molecules/jl-tab-panel.css_raw.js +0 -3
- package/dist/molecules/jl-tabs.css_raw.js +0 -3
- package/dist/molecules/jl-tag-input.css_raw.js +0 -3
- package/dist/molecules/jl-timeline.css_raw.js +0 -3
- package/dist/molecules/jl-toast.css_raw.js +0 -3
- package/dist/molecules/jl-tooltip.css_raw.js +0 -3
- package/dist/organisms/jl-command-palette.css_raw.js +0 -3
- package/dist/organisms/jl-confirm.css_raw.js +0 -3
- package/dist/organisms/jl-dialog.css_raw.js +0 -3
- package/dist/organisms/jl-drawer.css_raw.js +0 -3
- package/dist/organisms/jl-flow.css_raw.js +0 -3
- package/dist/organisms/jl-navbar.css_raw.js +0 -3
- package/dist/organisms/jl-page-header.css_raw.js +0 -3
- package/dist/organisms/jl-side-nav.css_raw.js +0 -3
- package/dist/organisms/jl-tab-bar.css_raw.js +0 -3
- package/dist/organisms/jl-table.css_raw.js +0 -3
- package/dist/organisms/jl-toaster.css_raw.js +0 -3
- package/dist/organisms/jl-tree.css_raw.js +0 -3
- package/dist/styles/base.css_raw.js +0 -3
- package/dist/styles/control.css_raw.js +0 -3
- package/dist/styles/floating.css_raw.js +0 -3
- package/dist/styles/tokens.css_raw.js +0 -3
- package/dist/templates/jl-app-shell.css_raw.js +0 -3
- package/dist/templates/jl-auth-layout.css_raw.js +0 -3
- package/dist/templates/jl-page.css_raw.js +0 -3
- package/dist/templates/jl-split-view.css_raw.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-popover.css?inline
|
|
2
|
+
var jl_popover_default = ":host{vertical-align:middle;display:inline-flex}.panel{width:max-content;min-width:200px;max-width:min(360px,100vw - 16px);font-size:var(--jl-font-md);padding:14px 16px;line-height:1.5}.panel:focus-visible{box-shadow:var(--jl-shadow-lg), var(--jl-focus-ring)}header{margin-bottom:10px}h2{font-size:var(--jl-font-md);font-weight:700;line-height:1.4}";
|
|
3
|
+
export { jl_popover_default as default };
|
|
@@ -3,7 +3,7 @@ import { JlElement } from "../base/jl-element.js";
|
|
|
3
3
|
import { oneOf } from "../lib/attributes.js";
|
|
4
4
|
import { PLACEMENTS, followAnchor } from "../lib/floating.js";
|
|
5
5
|
import { firstFocusable, setTriggerAria } from "../lib/trigger.js";
|
|
6
|
-
import jl_popover_default from "./jl-popover.
|
|
6
|
+
import jl_popover_default from "./jl-popover.css.js";
|
|
7
7
|
import { css } from "@jadis/core";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
9
9
|
// src/molecules/jl-popover.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-radio-group.css?inline
|
|
2
|
+
var jl_radio_group_default = ":host{--dot:18px;display:block}.group{gap:10px;display:grid}.legend:not(.sr-only){color:var(--jl-text);font-size:var(--jl-font-sm);font-weight:600;line-height:20px}.options{gap:10px;display:grid}:host([orientation=horizontal]) .options{flex-wrap:wrap;gap:10px 24px;display:flex}.option{color:var(--jl-text);font-size:var(--jl-font-md);cursor:pointer;outline:none;align-items:flex-start;gap:10px;line-height:20px;display:flex}.option[aria-disabled=true]{cursor:not-allowed;opacity:.5}.option:focus-visible{box-shadow:none}.dot{width:var(--dot);height:var(--dot);border:1px solid var(--jl-line-strong);background:var(--jl-surface);transition:border-color var(--jl-fast) var(--jl-ease), box-shadow var(--jl-fast) var(--jl-ease);border-radius:50%;flex:none;justify-content:center;align-items:center;margin-top:1px;display:inline-flex}.dot:after{background:var(--jl-accent);content:\"\";width:8px;height:8px;transition:transform var(--jl-fast) var(--jl-ease);border-radius:50%;transform:scale(0)}.option[aria-checked=true] .dot{border-color:var(--jl-accent)}.option[aria-checked=true] .dot:after{transform:scale(1)}.option:focus-visible .dot{box-shadow:var(--jl-focus-ring)}.option:not([aria-disabled=true],[aria-checked=true]):hover .dot{border-color:color-mix(in srgb, var(--jl-line-strong) 60%, var(--jl-text) 18%)}.text{gap:2px;min-width:0;display:grid}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:18px}:host([variant=cards]) .options{gap:8px}:host([variant=cards][orientation=horizontal]) .options{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));display:grid}:host([variant=cards]) .option{border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface);transition:border-color var(--jl-fast) var(--jl-ease), background var(--jl-fast) var(--jl-ease), box-shadow var(--jl-fast) var(--jl-ease);padding:12px 14px}:host([variant=cards]) .option:not([aria-disabled=true]):hover{border-color:var(--jl-line-strong)}:host([variant=cards]) .option[aria-checked=true]{border-color:var(--jl-accent);background:var(--jl-accent-soft)}:host([variant=cards]) .option:focus-visible{box-shadow:var(--jl-focus-ring)}:host([variant=cards]) .option:focus-visible .dot{box-shadow:none}:host([variant=cards]) .label{font-weight:600}";
|
|
3
|
+
export { jl_radio_group_default as default };
|
|
@@ -68,5 +68,6 @@ export declare class JlRadioGroup<Value extends string = string> extends JlFormC
|
|
|
68
68
|
/** Checks the option with the value, and gives the Tab stop to it, or else to the first option enabled. */
|
|
69
69
|
private renderValue;
|
|
70
70
|
private tabStop;
|
|
71
|
+
protected drawTexts(): void;
|
|
71
72
|
private renderValidity;
|
|
72
73
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlFormControl } from "../base/jl-form-control.js";
|
|
3
4
|
import { jsonOf, oneOf, textOf } from "../lib/attributes.js";
|
|
4
|
-
import { jlText } from "../lib/texts.js";
|
|
5
5
|
import { rovingIndex } from "../lib/roving-index.js";
|
|
6
|
-
import jl_radio_group_default from "./jl-radio-group.
|
|
6
|
+
import jl_radio_group_default from "./jl-radio-group.css.js";
|
|
7
7
|
import { css } from "@jadis/core";
|
|
8
8
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
9
9
|
// src/molecules/jl-radio-group.tsx
|
|
@@ -194,6 +194,9 @@ var JlRadioGroup = class extends JlFormControl {
|
|
|
194
194
|
const enabled = radios.filter((radio) => this.isEnabled(radio));
|
|
195
195
|
return enabled.find((radio) => radio.dataset.value === value) ?? enabled[0];
|
|
196
196
|
}
|
|
197
|
+
drawTexts() {
|
|
198
|
+
this.renderValidity();
|
|
199
|
+
}
|
|
197
200
|
renderValidity() {
|
|
198
201
|
if (!(this.required.get() && this.value.get() === NO_VALUE)) {
|
|
199
202
|
this.internals.setValidity({});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-search-button.css?inline
|
|
2
|
+
var jl_search_button_default = ":host{display:block}.search{width:100%;height:var(--jl-control-sm);border:1px solid var(--jl-line);border-radius:var(--jl-radius-sm);background:var(--jl-surface);color:var(--jl-muted);font-size:var(--jl-font-sm);cursor:pointer;transition:border-color var(--jl-fast) var(--jl-ease);align-items:center;gap:8px;padding:0 6px 0 10px;display:flex}.search:hover{border-color:var(--jl-line-strong);color:var(--jl-text-2)}.text{text-align:left;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}:host([compact]){display:inline-block}:host([compact]) .search{width:var(--jl-control-sm);justify-content:center;padding:0}:host([compact]) .text,:host([compact]) jl-kbd{display:none}@media (pointer:coarse){jl-kbd{display:none}}";
|
|
3
|
+
export { jl_search_button_default as default };
|
|
@@ -9,7 +9,7 @@ export declare class JlSearchButton extends JlElement {
|
|
|
9
9
|
readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
|
|
10
10
|
press: undefined;
|
|
11
11
|
}>>;
|
|
12
|
-
/** The text, and the button's name
|
|
12
|
+
/** The text, and the button's name; jlib's own when empty. */
|
|
13
13
|
readonly label: Readonly<Readonly<{
|
|
14
14
|
get(): string;
|
|
15
15
|
set(setter: string | ((prevState: string) => string)): void;
|
|
@@ -28,6 +28,7 @@ export declare class JlSearchButton extends JlElement {
|
|
|
28
28
|
focus(options?: FocusOptions): void;
|
|
29
29
|
templateHtml(): Node;
|
|
30
30
|
templateCss(): string;
|
|
31
|
+
protected drawTexts(): void;
|
|
31
32
|
onConnect(): void;
|
|
32
33
|
private renderLabel;
|
|
33
34
|
private renderHotkey;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlElement } from "../base/jl-element.js";
|
|
3
4
|
import { registerIcons } from "../lib/icons.js";
|
|
4
|
-
import { jlText } from "../lib/texts.js";
|
|
5
5
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
6
6
|
import { setOrRemove } from "../lib/dom.js";
|
|
7
7
|
import { JlKbd } from "../atoms/jl-kbd.js";
|
|
8
8
|
import { parseShortcut, shortcutAria } from "../lib/key-shortcut.js";
|
|
9
|
-
import jl_search_button_default from "./jl-search-button.
|
|
9
|
+
import jl_search_button_default from "./jl-search-button.css.js";
|
|
10
10
|
import { css } from "@jadis/core";
|
|
11
11
|
import { Search } from "lucide";
|
|
12
12
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -25,8 +25,8 @@ var isMac = () => MAC_PATTERN.test(navigator.userAgent);
|
|
|
25
25
|
var JlSearchButton = class extends JlElement {
|
|
26
26
|
static selector = "jl-search-button";
|
|
27
27
|
events = this.useEvents();
|
|
28
|
-
/** The text, and the button's name
|
|
29
|
-
label = this.useChange(
|
|
28
|
+
/** The text, and the button's name; jlib's own when empty. */
|
|
29
|
+
label = this.useChange("", () => this.renderLabel(), { attribute: "label" });
|
|
30
30
|
/** The keys that open the palette, as `jl-kbd` writes them: `mod+k`; `none` for no keys. */
|
|
31
31
|
hotkey = this.useChange(DEFAULT_HOTKEY, () => this.renderHotkey(), { attribute: "hotkey" });
|
|
32
32
|
/** The icon alone, the label as its tooltip. */
|
|
@@ -57,8 +57,10 @@ var JlSearchButton = class extends JlElement {
|
|
|
57
57
|
templateCss() {
|
|
58
58
|
return css`${BASE_STYLES}${jl_search_button_default}`;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
drawTexts() {
|
|
61
61
|
this.renderLabel();
|
|
62
|
+
}
|
|
63
|
+
onConnect() {
|
|
62
64
|
this.renderHotkey();
|
|
63
65
|
this.on(this._refs.button, "click", () => this.events.emit("press"));
|
|
64
66
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-search.css?inline
|
|
2
|
+
var jl_search_default = ":host{display:block}.lead{justify-content:center;width:16px}:host([loading]) .lead{color:var(--jl-muted)}.native::-webkit-search-cancel-button{appearance:none}.native::-webkit-search-decoration{appearance:none}.keys{flex:none;gap:3px;margin-right:-4px;display:inline-flex}.control:focus-within .keys{display:none}.key{border:1px solid var(--jl-line);border-radius:var(--jl-radius-xs);background:var(--jl-surface-2);min-width:20px;height:20px;color:var(--jl-muted);font-size:var(--jl-font-xs);border-bottom-width:2px;justify-content:center;align-items:center;padding:0 5px;font-weight:500;line-height:1;display:inline-flex}:host([size=sm]) .key{min-width:18px;height:18px;padding:0 4px}";
|
|
3
|
+
export { jl_search_default as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES, CONTROL_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlFormControl } from "../base/jl-form-control.js";
|
|
3
4
|
import { oneOf } from "../lib/attributes.js";
|
|
4
5
|
import { registerIcons } from "../lib/icons.js";
|
|
5
6
|
import { CONTROL_SIZES } from "../lib/options.js";
|
|
6
|
-
import { jlText } from "../lib/texts.js";
|
|
7
7
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
8
8
|
import { setOrRemove } from "../lib/dom.js";
|
|
9
9
|
import { JlSpinner } from "../atoms/jl-spinner.js";
|
|
10
10
|
import { hasCommandModifier, matchesShortcut, parseShortcut, shortcutAria, shortcutLabels } from "../lib/key-shortcut.js";
|
|
11
|
-
import jl_search_default from "./jl-search.
|
|
11
|
+
import jl_search_default from "./jl-search.css.js";
|
|
12
12
|
import { css } from "@jadis/core";
|
|
13
13
|
import { Search, X } from "lucide";
|
|
14
14
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -38,7 +38,7 @@ var JlSearch = class extends JlFormControl {
|
|
|
38
38
|
value = this.useChange("", (value) => this.renderValue(value), { attribute: "value" });
|
|
39
39
|
placeholder = this.useChange("", (value) => setOrRemove(this._refs.native, "placeholder", value), { attribute: "placeholder" });
|
|
40
40
|
/** The field's name for screen readers; "Search" when nothing else names it. */
|
|
41
|
-
label = this.useChange("", (
|
|
41
|
+
label = this.useChange("", () => this.renderLabel(), { attribute: "label" });
|
|
42
42
|
/** How long typing must pause, in milliseconds, before `search` fires. */
|
|
43
43
|
debounce = this.useChange(DEFAULT_DEBOUNCE_MS, () => void 0, { attribute: "debounce" });
|
|
44
44
|
/** Keys that focus the field from anywhere: "/" or "mod+k" (⌘ on a Mac, Ctrl elsewhere). */
|
|
@@ -108,7 +108,6 @@ var JlSearch = class extends JlFormControl {
|
|
|
108
108
|
/* @__PURE__ */ jsx("button", {
|
|
109
109
|
class: "action clear",
|
|
110
110
|
type: "button",
|
|
111
|
-
"aria-label": jlText("clearSearch"),
|
|
112
111
|
tabIndex: -1,
|
|
113
112
|
hidden: true,
|
|
114
113
|
children: /* @__PURE__ */ jsx(JlIcon, {
|
|
@@ -127,6 +126,13 @@ var JlSearch = class extends JlFormControl {
|
|
|
127
126
|
templateCss() {
|
|
128
127
|
return css`${BASE_STYLES}${CONTROL_STYLES}${jl_search_default}`;
|
|
129
128
|
}
|
|
129
|
+
drawTexts() {
|
|
130
|
+
this._refs.clear.setAttribute("aria-label", jlText("clearSearch"));
|
|
131
|
+
this.renderLabel();
|
|
132
|
+
}
|
|
133
|
+
renderLabel() {
|
|
134
|
+
this._refs.native.setAttribute("aria-label", this.label.get() || jlText("search"));
|
|
135
|
+
}
|
|
130
136
|
onConnect() {
|
|
131
137
|
const native = this._refs.native;
|
|
132
138
|
this.on(native, "input", (event) => {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-segmented.css?inline
|
|
2
|
+
var jl_segmented_default = ":host{vertical-align:middle;--height:var(--jl-control-md);--pad:12px;--font-size:var(--jl-font-sm);justify-self:start;max-width:100%;display:inline-flex}:host([size=sm]){--height:var(--jl-control-sm);--pad:10px;--font-size:var(--jl-font-xs)}:host([size=lg]){--height:var(--jl-control-lg);--pad:16px;--font-size:var(--jl-font-md)}:host([block]){justify-self:stretch;display:flex}.group{scrollbar-width:none;min-width:0;height:var(--height);border:1px solid var(--jl-line);border-radius:var(--jl-radius-sm);background:var(--jl-surface-2);flex:1;padding:2px;display:flex;position:relative;overflow-x:auto}.segment{z-index:1;min-width:calc(var(--height) - 6px);padding:0 var(--pad);border-radius:calc(var(--jl-radius-sm) - 3px);color:var(--jl-muted);font-size:var(--font-size);white-space:nowrap;cursor:pointer;transition:color var(--jl-fast) var(--jl-ease);background:0 0;border:none;flex:none;justify-content:center;align-items:center;gap:6px;font-weight:600;display:inline-flex;position:relative}.segment:hover:not(:disabled),.segment[aria-checked=true]{color:var(--jl-text)}.badge{border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);min-width:18px;color:var(--jl-muted);font-size:var(--jl-font-xs);text-align:center;padding:0 6px;font-weight:650;line-height:18px}.segment[aria-checked=true] .badge{background:var(--jl-accent-soft);color:var(--jl-accent)}.segment:disabled{cursor:not-allowed;opacity:.45}:host([block]) .segment{flex:1 1 0}.thumb{width:var(--w);height:var(--h);border:1px solid var(--jl-line-strong);border-radius:calc(var(--jl-radius-sm) - 3px);background:var(--lightningcss-light,var(--jl-surface))var(--lightningcss-dark,var(--jl-surface-3));box-shadow:var(--jl-shadow-sm);transform:translate(var(--x), var(--y));pointer-events:none;position:absolute;top:0;left:0}.thumb[data-placed]{transition:transform var(--jl-slow) var(--jl-ease), width var(--jl-slow) var(--jl-ease)}.group[aria-disabled]{opacity:.55}.group[aria-disabled] .segment{opacity:1}.segment:focus-visible{box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--jl-brand) 60%, transparent)}";
|
|
3
|
+
export { jl_segmented_default as default };
|
|
@@ -7,7 +7,7 @@ import { setOrRemove } from "../lib/dom.js";
|
|
|
7
7
|
import { firstIndex, lastIndex, stepIndex } from "../lib/roving.js";
|
|
8
8
|
import { moveIndicator } from "../lib/indicator.js";
|
|
9
9
|
import { watchSizes } from "../lib/resize.js";
|
|
10
|
-
import jl_segmented_default from "./jl-segmented.
|
|
10
|
+
import jl_segmented_default from "./jl-segmented.css.js";
|
|
11
11
|
import { css } from "@jadis/core";
|
|
12
12
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
13
13
|
// src/molecules/jl-segmented.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-stat.css?inline
|
|
2
|
+
var jl_stat_default = ":host{--mood:var(--jl-muted);display:block}:host([mood=good]){--mood:var(--jl-ok)}:host([mood=bad]){--mood:var(--jl-danger)}.stat{gap:4px;min-width:0;display:grid}.top{align-items:center;gap:8px;display:flex}.label{min-width:0;color:var(--jl-muted);font-size:var(--jl-font-sm);flex:1;font-weight:600;line-height:1.4}.icon{color:var(--jl-faint)}:host([tone=accent]) .icon{color:var(--jl-accent)}:host([tone=ok]) .icon{color:var(--jl-ok)}:host([tone=warn]) .icon{color:var(--jl-warn)}:host([tone=danger]) .icon{color:var(--jl-danger)}:host([tone=info]) .icon{color:var(--jl-info)}.figure{flex-wrap:wrap;align-items:baseline;column-gap:10px;display:flex}.value{color:var(--jl-text);font-size:var(--jl-font-2xl);font-variant-numeric:tabular-nums;letter-spacing:-.02em;font-weight:700;line-height:1.2}.delta{color:var(--mood);font-size:var(--jl-font-sm);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:center;gap:4px;font-weight:650;display:inline-flex}.caption{color:var(--jl-muted);font-size:var(--jl-font-xs);line-height:1.4}.spark{height:36px;margin-top:8px}.spark svg{width:100%;height:100%;display:block;overflow:visible}.line{fill:none;stroke:var(--jl-accent);stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;vector-effect:non-scaling-stroke}.area{fill:color-mix(in srgb, var(--jl-accent) 10%, transparent);stroke:none}";
|
|
3
|
+
export { jl_stat_default as default };
|
|
@@ -6,7 +6,7 @@ import { TONES } from "../lib/options.js";
|
|
|
6
6
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
7
7
|
import { areaAttribute, pointsAttribute, sparklinePoints } from "../lib/sparkline.js";
|
|
8
8
|
import { trendOfDelta } from "../lib/trend.js";
|
|
9
|
-
import jl_stat_default from "./jl-stat.
|
|
9
|
+
import jl_stat_default from "./jl-stat.css.js";
|
|
10
10
|
import { css } from "@jadis/core";
|
|
11
11
|
import { Minus, TrendingDown, TrendingUp } from "lucide";
|
|
12
12
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-steps.css?inline
|
|
2
|
+
var jl_steps_default = ":host{--marker:28px;display:block;container-type:inline-size}ol{padding:0;list-style:none;display:flex}.step{flex:1;min-width:0;display:flex}.step:last-child{flex:none}.head{border-radius:var(--jl-radius-xs);text-align:start;background:0 0;border:none;align-items:flex-start;gap:10px;min-width:0;padding:0;display:flex}button.head{cursor:pointer}.marker{width:var(--marker);height:var(--marker);border:1px solid var(--jl-line-strong);background:var(--jl-surface);color:var(--jl-muted);font-size:var(--jl-font-sm);font-variant-numeric:tabular-nums;border-radius:50%;flex:none;justify-content:center;align-items:center;font-weight:650;display:inline-flex}.text{gap:2px;min-width:0;padding-top:4px;display:grid}.label{color:var(--jl-muted);font-size:var(--jl-font-md);font-weight:600;line-height:20px}.description{color:var(--jl-muted);font-size:var(--jl-font-xs);line-height:1.45}.step[data-status=done] .marker{border-color:var(--jl-accent-line);background:var(--jl-accent-soft);color:var(--jl-accent)}.step[data-status=done] .label{color:var(--jl-text)}.step[data-status=current] .marker{border-color:var(--jl-accent);background:var(--jl-accent);color:var(--jl-on-accent);box-shadow:0 0 0 4px var(--jl-accent-soft)}.step[data-status=current] .label{color:var(--jl-accent);font-weight:700}.step[data-failed] .marker{border-color:color-mix(in srgb, var(--jl-danger) 40%, var(--jl-line));background:var(--jl-danger-soft);color:var(--jl-danger);box-shadow:none}.step[data-failed] .label{color:var(--jl-danger)}button.head:hover .label{text-underline-offset:3px;text-decoration:underline}.line{min-width:24px;height:1px;margin:calc(var(--marker) / 2) 12px 0 20px;background:var(--jl-line-strong);flex:1}.step[data-status=done] .line{background:var(--jl-accent)}.step:last-child .line{display:none}:host([orientation=vertical]) ol{flex-direction:column}:host([orientation=vertical]) .step{flex:none;padding-bottom:24px;position:relative}:host([orientation=vertical]) .step:last-child{padding-bottom:0}:host([orientation=vertical]) .line{top:calc(var(--marker) + 4px);bottom:4px;left:calc(var(--marker) / 2 - .5px);width:1px;min-width:0;height:auto;margin:0;position:absolute}@container (width<560px){:host(:not([orientation=vertical])) .step:not([data-status=current]) .text{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:host(:not([orientation=vertical])) .description{display:none}:host(:not([orientation=vertical])) .line{min-width:8px;margin:calc(var(--marker) / 2) 8px 0}:host(:not([orientation=vertical])) .step:not([data-status=current]){min-width:min-content}:host(:not([orientation=vertical])) .step[data-status=current]{flex:3 1 0}:host(:not([orientation=vertical])) .step[data-status=current] .label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host(:not([orientation=vertical])) .step[data-status=current] .line{min-width:24px;margin-left:16px}}";
|
|
3
|
+
export { jl_steps_default as default };
|
|
@@ -37,6 +37,8 @@ export declare class JlSteps extends JlElement {
|
|
|
37
37
|
templateHtml(): Node;
|
|
38
38
|
templateCss(): string;
|
|
39
39
|
onConnect(): void;
|
|
40
|
+
protected drawTexts(): void;
|
|
41
|
+
private renderLabel;
|
|
40
42
|
private render;
|
|
41
43
|
/** A failed step's ×, a done one's check, or the step's number. */
|
|
42
44
|
private markerOf;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlElement } from "../base/jl-element.js";
|
|
3
4
|
import { clampedNumber, jsonOf, oneOf } from "../lib/attributes.js";
|
|
4
5
|
import { registerIcons } from "../lib/icons.js";
|
|
5
|
-
import { jlText } from "../lib/texts.js";
|
|
6
6
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
7
|
-
import jl_steps_default from "./jl-steps.
|
|
7
|
+
import jl_steps_default from "./jl-steps.css.js";
|
|
8
8
|
import { css } from "@jadis/core";
|
|
9
9
|
import { Check, X } from "lucide";
|
|
10
10
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -52,9 +52,7 @@ var JlSteps = class extends JlElement {
|
|
|
52
52
|
/** Done steps become buttons that go back to them. */
|
|
53
53
|
clickable = this.useChange(false, () => this.render(), { attribute: "clickable" });
|
|
54
54
|
/** The list's name for screen readers. */
|
|
55
|
-
label = this.useChange(
|
|
56
|
-
this._refs.list.setAttribute("aria-label", value || jlText("progress"));
|
|
57
|
-
}, { attribute: "label" });
|
|
55
|
+
label = this.useChange("", () => this.renderLabel(), { attribute: "label" });
|
|
58
56
|
_refs = this.useRefs((ref) => ({ list: ref("ol") }));
|
|
59
57
|
templateHtml() {
|
|
60
58
|
return /* @__PURE__ */ jsx("ol", { attrs: { part: "base" } });
|
|
@@ -68,6 +66,13 @@ var JlSteps = class extends JlElement {
|
|
|
68
66
|
if (target !== null) this.goBackTo(Number(target.dataset.index));
|
|
69
67
|
});
|
|
70
68
|
}
|
|
69
|
+
drawTexts() {
|
|
70
|
+
this.renderLabel();
|
|
71
|
+
this.render();
|
|
72
|
+
}
|
|
73
|
+
renderLabel() {
|
|
74
|
+
this._refs.list.setAttribute("aria-label", this.label.get() || jlText("progress"));
|
|
75
|
+
}
|
|
71
76
|
render() {
|
|
72
77
|
const current = this.current.get();
|
|
73
78
|
this._refs.list.replaceChildren(...this.items.get().map((item, index) => this.step(item, index, statusOf(index, current))));
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-tab-panel.css?inline
|
|
2
|
+
var jl_tab_panel_default = ":host{border-radius:var(--jl-radius-xs);display:block}:host(:not([selected])){display:none}:host(:focus-visible){box-shadow:var(--jl-focus-ring);outline:none}";
|
|
3
|
+
export { jl_tab_panel_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
2
|
import { JlElement } from "../base/jl-element.js";
|
|
3
|
-
import jl_tab_panel_default from "./jl-tab-panel.
|
|
3
|
+
import jl_tab_panel_default from "./jl-tab-panel.css.js";
|
|
4
4
|
import { css } from "@jadis/core";
|
|
5
5
|
import { jsx } from "@jadis/core/jsx-runtime";
|
|
6
6
|
// src/molecules/jl-tab-panel.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-tabs.css?inline
|
|
2
|
+
var jl_tabs_default = ":host{display:block}.scroller{scrollbar-width:none;contain:inline-size;position:relative;overflow-x:auto}.list{gap:4px;width:max-content;min-width:100%;display:flex}.tab{z-index:1;border-radius:var(--jl-radius-xs);height:40px;color:var(--jl-muted);font-size:var(--jl-font-md);white-space:nowrap;cursor:pointer;transition:color var(--jl-fast) var(--jl-ease);background:0 0;border:none;flex:none;justify-content:center;align-items:center;gap:8px;padding:0 12px;font-weight:600;display:inline-flex;position:relative}.tab:hover,.tab[aria-selected=true]{color:var(--jl-text)}.tab[aria-disabled]{color:var(--jl-faint);cursor:not-allowed;opacity:.6}.badge{border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);min-width:20px;color:var(--jl-text-2);font-variant-numeric:tabular-nums;padding:1px 6px;font-size:11px;font-weight:650;line-height:16px}.tab[aria-selected=true] .badge{background:var(--jl-accent-soft);color:var(--jl-accent)}.indicator{pointer-events:none;position:absolute;top:0;left:0}.indicator[data-placed]{transition:transform var(--jl-slow) var(--jl-ease), width var(--jl-slow) var(--jl-ease)}:host(:not([variant=pill])) .scroller{box-shadow:inset 0 -1px 0 var(--jl-line)}:host(:not([variant=pill])) .indicator{width:var(--w);background:var(--jl-accent);height:2px;transform:translateX(var(--x));border-radius:2px 2px 0 0;top:auto;bottom:0}:host([variant=pill]) .tab{border-radius:var(--jl-radius-pill);height:32px;padding:0 14px}:host([variant=pill]) .tab:hover:not([aria-selected=true]){background:var(--jl-surface-2)}:host([variant=pill]) .tab[aria-selected=true]{color:var(--jl-accent)}:host([variant=pill]) .indicator{width:var(--w);height:var(--h);border-radius:var(--jl-radius-pill);background:var(--jl-accent-soft);transform:translate(var(--x), var(--y))}:host([variant=pill]) .tab[aria-selected=true] .badge{background:var(--jl-surface)}:host([block]) .list{width:100%}:host([block]) .tab{flex:1}.panels{padding-top:16px}.tab:focus-visible{box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--jl-brand) 60%, transparent)}";
|
|
3
|
+
export { jl_tabs_default as default };
|
|
@@ -8,7 +8,7 @@ import { firstIndex, lastIndex, stepIndex } from "../lib/roving.js";
|
|
|
8
8
|
import { moveIndicator } from "../lib/indicator.js";
|
|
9
9
|
import { watchSizes } from "../lib/resize.js";
|
|
10
10
|
import { JlTabPanel } from "./jl-tab-panel.js";
|
|
11
|
-
import jl_tabs_default from "./jl-tabs.
|
|
11
|
+
import jl_tabs_default from "./jl-tabs.css.js";
|
|
12
12
|
import { css } from "@jadis/core";
|
|
13
13
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
14
14
|
// src/molecules/jl-tabs.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-tag-input.css?inline
|
|
2
|
+
var jl_tag_input_default = ":host{--chip-height:calc(var(--height,var(--jl-control-md)) - 12px);min-width:0;display:block}.control{cursor:text;flex-wrap:wrap;gap:4px;padding:4px 6px}.tags{margin:0;padding:0;list-style:none;display:contents}.tag{max-width:100%;height:var(--chip-height);border:1px solid var(--jl-line);border-radius:var(--jl-radius-xs);background:var(--jl-surface-2);color:var(--jl-text);font-size:var(--jl-font-sm);cursor:default;align-items:center;gap:2px;padding:0 3px 0 8px;line-height:1;display:inline-flex}:host([size=sm]) .tag{font-size:var(--jl-font-xs);padding-left:6px}.tag.flash{animation:flash .6s var(--jl-ease)}.tag-text{text-overflow:ellipsis;white-space:nowrap;line-height:1.4;overflow:hidden}.tag-remove{width:18px;height:18px;color:var(--jl-faint);cursor:pointer;background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.tag-remove:hover,.tag-remove:focus-visible{background:var(--jl-surface-3);color:var(--jl-text)}.native{height:calc(var(--height,var(--jl-control-md)) - 10px);flex:1 0 80px;padding-left:6px}:host([disabled]) .tag{color:var(--jl-muted);padding-right:8px}.popup{min-width:180px;padding:4px}.listbox{max-height:240px;margin:0;padding:0;list-style:none;position:relative;overflow-y:auto}.option{border-radius:var(--jl-radius-xs);color:var(--jl-text);font-size:var(--jl-font-md);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;padding:6px 10px;line-height:1.4}.option.active,.option:hover{background:var(--jl-surface-3)}mark{color:var(--jl-accent);background:0 0;font-weight:700}@keyframes flash{30%{border-color:var(--jl-accent-line);background:var(--jl-accent-soft);color:var(--jl-accent-strong)}}";
|
|
3
|
+
export { jl_tag_input_default as default };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES, CONTROL_STYLES, FLOATING_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlFormControl } from "../base/jl-form-control.js";
|
|
3
4
|
import { clampedNumber, jsonOf, oneOf } from "../lib/attributes.js";
|
|
4
5
|
import { followAnchor } from "../lib/floating.js";
|
|
5
6
|
import { registerIcons } from "../lib/icons.js";
|
|
6
7
|
import { CONTROL_SIZES } from "../lib/options.js";
|
|
7
|
-
import { jlText } from "../lib/texts.js";
|
|
8
8
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
9
9
|
import { setOrRemove, uniqueId } from "../lib/dom.js";
|
|
10
10
|
import { keepInView } from "../lib/keep-in-view.js";
|
|
11
11
|
import { filterOptions, matchParts, nextEnabledIndex } from "../lib/option-filter.js";
|
|
12
12
|
import { addTags, hasTag, hasTagSeparator, splitTags } from "../lib/tags.js";
|
|
13
|
-
import jl_tag_input_default from "./jl-tag-input.
|
|
13
|
+
import jl_tag_input_default from "./jl-tag-input.css.js";
|
|
14
14
|
import { css } from "@jadis/core";
|
|
15
15
|
import { X } from "lucide";
|
|
16
16
|
import { Fragment, jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -118,6 +118,10 @@ var JlTagInput = class extends JlFormControl {
|
|
|
118
118
|
templateCss() {
|
|
119
119
|
return css`${BASE_STYLES}${CONTROL_STYLES}${FLOATING_STYLES}${jl_tag_input_default}`;
|
|
120
120
|
}
|
|
121
|
+
drawTexts() {
|
|
122
|
+
this.renderTags();
|
|
123
|
+
this.renderValidity();
|
|
124
|
+
}
|
|
121
125
|
onConnect() {
|
|
122
126
|
const native = this._refs.native;
|
|
123
127
|
this._nameWatch.observe(this, {
|
|
@@ -232,7 +236,7 @@ var JlTagInput = class extends JlFormControl {
|
|
|
232
236
|
this.closeList();
|
|
233
237
|
if (added.length > 0) {
|
|
234
238
|
this.value.set(result.tags);
|
|
235
|
-
this.announce(
|
|
239
|
+
this.announce(jlText("addedNamed", { names: added.join(", ") }));
|
|
236
240
|
this.events.emit("change", result.tags);
|
|
237
241
|
}
|
|
238
242
|
this.flash(result.duplicates);
|
|
@@ -243,7 +247,7 @@ var JlTagInput = class extends JlFormControl {
|
|
|
243
247
|
if (removed === void 0 || this.disabled.get()) return;
|
|
244
248
|
const next = tags.filter((_, position) => position !== index);
|
|
245
249
|
this.value.set(next);
|
|
246
|
-
this.announce(
|
|
250
|
+
this.announce(jlText("removedNamed", { name: removed }));
|
|
247
251
|
this.events.emit("change", next);
|
|
248
252
|
}
|
|
249
253
|
removeAndFocus(index) {
|
|
@@ -381,7 +385,7 @@ var JlTagInput = class extends JlFormControl {
|
|
|
381
385
|
class: "tag-remove",
|
|
382
386
|
type: "button",
|
|
383
387
|
tabIndex: -1,
|
|
384
|
-
"aria-label":
|
|
388
|
+
"aria-label": jlText("removeNamed", { name: tag }),
|
|
385
389
|
"data-index": String(index),
|
|
386
390
|
children: /* @__PURE__ */ jsx(JlIcon, {
|
|
387
391
|
name: "x",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-timeline.css?inline
|
|
2
|
+
var jl_timeline_default = ":host{--marker:22px;--gap:20px;--title-size:var(--jl-font-md);display:block}:host([compact]){--marker:18px;--gap:12px;--title-size:var(--jl-font-sm)}.timeline{grid-template-columns:calc(var(--marker) + 12px) auto minmax(0, 1fr);margin:0;padding:0;list-style:none;display:grid}.event{grid-column:1/-1;grid-template-columns:calc(var(--marker) + 12px) auto minmax(0, 1fr);padding-bottom:var(--gap);--tone:var(--jl-muted);--soft:var(--jl-surface-3);display:grid;position:relative}@supports (grid-template-columns:subgrid){.event{grid-template-columns:subgrid}}.event:last-child{padding-bottom:0}.event[data-tone=accent]{--tone:var(--jl-accent);--soft:var(--jl-accent-soft)}.event[data-tone=ok]{--tone:var(--jl-ok);--soft:var(--jl-ok-soft)}.event[data-tone=warn]{--tone:var(--jl-warn);--soft:var(--jl-warn-soft)}.event[data-tone=danger]{--tone:var(--jl-danger);--soft:var(--jl-danger-soft)}.event[data-tone=info]{--tone:var(--jl-info);--soft:var(--jl-info-soft)}.event:not(:last-child):before{top:10px;bottom:-10px;left:calc(var(--marker) / 2 - .5px);background:var(--jl-line-strong);content:\"\";width:1px;position:absolute}.rail{width:var(--marker);z-index:1;grid-column:1;justify-content:center;align-items:center;height:20px;display:flex;position:relative}.marker{border-radius:50%;flex:none;justify-content:center;align-items:center;display:inline-flex}.dot{background:var(--tone);width:10px;height:10px;box-shadow:0 0 0 3px var(--jl-surface)}:host([compact]) .dot{width:8px;height:8px}.circle{width:var(--marker);height:var(--marker);border:1px solid color-mix(in srgb, var(--tone) 30%, var(--soft));background:var(--soft);color:var(--tone);box-shadow:0 0 0 3px var(--jl-surface)}.content{grid-column:3;gap:2px;display:grid}.title{color:var(--jl-text);font-size:var(--title-size);font-weight:600;line-height:20px}.time{color:var(--jl-muted);font-family:var(--jl-font-mono);font-size:var(--jl-font-xs);white-space:nowrap;grid-column:2;padding-right:12px;line-height:20px}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}:host([compact]) .description{font-size:var(--jl-font-xs)}";
|
|
3
|
+
export { jl_timeline_default as default };
|
|
@@ -3,7 +3,7 @@ import { JlElement } from "../base/jl-element.js";
|
|
|
3
3
|
import { jsonOf } from "../lib/attributes.js";
|
|
4
4
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
5
5
|
import { setOrRemove } from "../lib/dom.js";
|
|
6
|
-
import jl_timeline_default from "./jl-timeline.
|
|
6
|
+
import jl_timeline_default from "./jl-timeline.css.js";
|
|
7
7
|
import { css } from "@jadis/core";
|
|
8
8
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
9
9
|
// src/molecules/jl-timeline.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-toast.css?inline
|
|
2
|
+
var jl_toast_default = ":host{--fg:var(--jl-text-2);--bg:var(--jl-surface);--border:var(--jl-line);--bar:var(--jl-brand);display:block}:host([tone=ok]),:host([tone=warn]),:host([tone=danger]),:host([tone=info]){--border:color-mix(in srgb, var(--fg) 24%, var(--bg));--bar:var(--fg)}:host([tone=ok]){--fg:var(--jl-ok);--bg:var(--jl-ok-soft)}:host([tone=warn]){--fg:var(--jl-warn);--bg:var(--jl-warn-soft)}:host([tone=danger]){--fg:var(--jl-danger);--bg:var(--jl-danger-soft)}:host([tone=info]){--fg:var(--jl-info);--bg:var(--jl-info-soft)}.toast{border:1px solid var(--border);border-radius:var(--jl-radius-lg);background:var(--bg);color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);align-items:flex-start;gap:12px;padding:14px 12px 14px 16px;line-height:20px;display:flex;position:relative;overflow:hidden}.icon{color:var(--fg);margin-top:1px}.content{overflow-wrap:anywhere;flex:1;gap:2px;min-width:0;display:grid}.heading{font-weight:650}.text{color:var(--jl-muted);font-size:var(--jl-font-sm)}.heading[hidden]+.text{color:var(--jl-text-2);font-size:var(--jl-font-md)}.buttons{flex:none;align-items:center;gap:2px;margin:-5px -4px -5px 0;display:flex}.buttons:not(:has(jl-button:not([hidden]))){display:none}.close{--jl-accent:var(--fg);--jl-accent-soft:color-mix(in srgb, var(--fg) 12%, transparent)}.work{margin-top:8px}.progress{height:2px;position:absolute;bottom:0;left:0;right:0}.bar{background:var(--bar);transform-origin:0;height:100%}:host([paused]) .bar{opacity:.55}@media (prefers-reduced-motion:reduce){.progress{visibility:hidden}}";
|
|
3
|
+
export { jl_toast_default as default };
|
|
@@ -65,6 +65,7 @@ export declare class JlToast extends JlElement {
|
|
|
65
65
|
show(): void;
|
|
66
66
|
templateHtml(): Node;
|
|
67
67
|
templateCss(): string;
|
|
68
|
+
protected drawTexts(): void;
|
|
68
69
|
onConnect(): void;
|
|
69
70
|
onDisconnect(): void;
|
|
70
71
|
/** The way in, once per showing; WAAPI so that the toaster moving in the top layer does not replay it. */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlElement } from "../base/jl-element.js";
|
|
3
4
|
import { oneOf } from "../lib/attributes.js";
|
|
4
5
|
import { registerIcons } from "../lib/icons.js";
|
|
5
6
|
import { TONE_ICONS, TONE_ICON_FILLED } from "../lib/options.js";
|
|
6
|
-
import { jlText } from "../lib/texts.js";
|
|
7
7
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
8
8
|
import { JlButton } from "../atoms/jl-button.js";
|
|
9
9
|
import { optionalNumber } from "../lib/progress.js";
|
|
10
10
|
import { JlProgress } from "../atoms/jl-progress.js";
|
|
11
|
-
import jl_toast_default from "./jl-toast.
|
|
11
|
+
import jl_toast_default from "./jl-toast.css.js";
|
|
12
12
|
import { css } from "@jadis/core";
|
|
13
13
|
import { CircleCheck, CircleX, Info, Sparkles, TriangleAlert, X } from "lucide";
|
|
14
14
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -181,7 +181,6 @@ var JlToast = class extends JlElement {
|
|
|
181
181
|
variant: "ghost",
|
|
182
182
|
size: "sm",
|
|
183
183
|
icon: "x",
|
|
184
|
-
hint: jlText("close"),
|
|
185
184
|
hidden: true
|
|
186
185
|
})]
|
|
187
186
|
}),
|
|
@@ -197,6 +196,9 @@ var JlToast = class extends JlElement {
|
|
|
197
196
|
templateCss() {
|
|
198
197
|
return css`${BASE_STYLES}${jl_toast_default}`;
|
|
199
198
|
}
|
|
199
|
+
drawTexts() {
|
|
200
|
+
this._refs.close.hint.set(jlText("close"));
|
|
201
|
+
}
|
|
200
202
|
onConnect() {
|
|
201
203
|
this._refs.close.events.register("press", () => this.dismiss());
|
|
202
204
|
this._refs.action.events.register("press", () => {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/molecules/jl-tooltip.css?inline
|
|
2
|
+
var jl_tooltip_default = ":host{vertical-align:middle;-webkit-touch-callout:none;display:inline-flex}@media (pointer:coarse){::slotted(*){-webkit-user-select:none;user-select:none}}.bubble{border-radius:var(--jl-radius-xs);background:var(--jl-text);max-width:min(260px,100vw - 16px);color:var(--jl-bg);font-size:var(--jl-font-xs);box-shadow:var(--jl-shadow);pointer-events:auto;padding:6px 9px;font-weight:550;line-height:1.4}.arrow{background:inherit;border-radius:1px;width:8px;height:8px;position:absolute;rotate:45deg}.bubble[data-placement^=top] .arrow{top:100%;left:var(--arrow,50%);translate:-50% -50%}.bubble[data-placement^=bottom] .arrow{bottom:100%;left:var(--arrow,50%);translate:-50% 50%}.bubble[data-placement^=left] .arrow{top:var(--arrow,50%);left:100%;translate:-50% -50%}.bubble[data-placement^=right] .arrow{top:var(--arrow,50%);right:100%;translate:50% -50%}";
|
|
3
|
+
export { jl_tooltip_default as default };
|
|
@@ -4,7 +4,7 @@ import { clampedNumber, oneOf } from "../lib/attributes.js";
|
|
|
4
4
|
import { PLACEMENTS, followAnchor, placeFloating } from "../lib/floating.js";
|
|
5
5
|
import { accessibleTarget, deepActiveElement } from "../lib/trigger.js";
|
|
6
6
|
import { arrowOffset } from "../lib/arrow.js";
|
|
7
|
-
import jl_tooltip_default from "./jl-tooltip.
|
|
7
|
+
import jl_tooltip_default from "./jl-tooltip.css.js";
|
|
8
8
|
import { css } from "@jadis/core";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
10
10
|
// src/molecules/jl-tooltip.tsx
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// src/organisms/jl-command-palette.css?inline
|
|
2
|
+
var jl_command_palette_default = ":host{display:contents}dialog{border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background:var(--jl-surface);width:min(620px,100vw - 24px);max-width:none;max-height:min(520px,100dvh - 24vh);color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);flex-direction:column;margin:12vh auto auto;padding:0;overflow:hidden}dialog[open]{animation:drop var(--jl-fast) var(--jl-ease);display:flex}dialog::backdrop{background:var(--jl-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.search{border-bottom:1px solid var(--jl-line);flex:none;align-items:center;gap:10px;height:52px;padding:0 14px 0 16px;display:flex}.search-icon,.search-spinner{color:var(--jl-faint);flex:none}input{min-width:0;height:100%;font-size:max(15px, var(--jl-control-font));background:0 0;border:none;outline:none;flex:1;padding:0}input::placeholder{color:var(--jl-faint)}input:focus-visible{box-shadow:none}kbd{border:1px solid var(--jl-line-strong);border-radius:var(--jl-radius-xs);background:var(--jl-surface);min-width:20px;height:20px;color:var(--jl-muted);border-bottom-width:2px;justify-content:center;align-items:center;padding:0 5px;font-size:11px;font-weight:500;line-height:1;display:inline-flex}.results{overscroll-behavior:contain;flex:1;min-height:0;padding:6px;scroll-padding:6px;overflow-y:auto}[role=group]+[role=group]{border-top:1px solid var(--jl-line-soft);margin-top:4px;padding-top:4px}.group-label{color:var(--jl-muted);font-size:var(--jl-font-xs);padding:8px 10px 4px;font-weight:600}.option{border-radius:var(--jl-radius-sm);min-height:38px;color:var(--jl-text-2);cursor:pointer;align-items:center;gap:10px;padding:0 10px;display:flex}.option[aria-selected=true]{background:var(--jl-accent-soft);color:var(--jl-text)}.option-icon{width:16px;color:var(--jl-muted);flex:none}.option[aria-selected=true] .option-icon{color:var(--jl-accent)}.option-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.option-description{max-width:40%;color:var(--jl-muted);font-size:var(--jl-font-xs);text-overflow:ellipsis;white-space:nowrap;flex:none;overflow:hidden}mark{color:var(--jl-accent);background:0 0;font-weight:700}.keys{flex:none;gap:3px;display:inline-flex}.empty{color:var(--jl-muted);text-align:center;padding:36px 16px}footer{border-top:1px solid var(--jl-line);background:var(--jl-surface-2);color:var(--jl-muted);font-size:var(--jl-font-xs);flex-wrap:wrap;flex:none;align-items:center;gap:6px 16px;padding:8px 16px;display:flex}.hint,.hotkey-keys{align-items:center;gap:4px;display:inline-flex}.hotkey-hint{margin-left:auto}@media (width<520px){dialog{max-height:calc(100dvh - 24px);margin-top:12px}.hotkey-hint{display:none}}@keyframes drop{0%{opacity:0;transform:translateY(-6px)scale(.98)}}";
|
|
3
|
+
export { jl_command_palette_default as default };
|
|
@@ -24,6 +24,7 @@ export declare class JlCommandPalette<Id extends string = string> extends JlElem
|
|
|
24
24
|
get(): boolean;
|
|
25
25
|
set(setter: boolean | ((prevState: boolean) => boolean)): void;
|
|
26
26
|
}>>;
|
|
27
|
+
/** What the field says before anything is typed; jlib's own text when empty. */
|
|
27
28
|
readonly placeholder: Readonly<Readonly<{
|
|
28
29
|
get(): string;
|
|
29
30
|
set(setter: string | ((prevState: string) => string)): void;
|
|
@@ -33,7 +34,7 @@ export declare class JlCommandPalette<Id extends string = string> extends JlElem
|
|
|
33
34
|
get(): string;
|
|
34
35
|
set(setter: string | ((prevState: string) => string)): void;
|
|
35
36
|
}>>;
|
|
36
|
-
/** What it says when nothing matches. */
|
|
37
|
+
/** What it says when nothing matches; jlib's own text when empty. */
|
|
37
38
|
readonly emptyText: Readonly<Readonly<{
|
|
38
39
|
get(): string;
|
|
39
40
|
set(setter: string | ((prevState: string) => string)): void;
|
|
@@ -59,6 +60,7 @@ export declare class JlCommandPalette<Id extends string = string> extends JlElem
|
|
|
59
60
|
close(): void;
|
|
60
61
|
templateHtml(): Node;
|
|
61
62
|
templateCss(): string;
|
|
63
|
+
protected drawTexts(): void;
|
|
62
64
|
onConnect(): void;
|
|
63
65
|
private toggleOnHotkey;
|
|
64
66
|
private navigate;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { jlText } from "../lib/texts.js";
|
|
1
2
|
import { BASE_STYLES } from "../styles/shared.js";
|
|
2
3
|
import { JlElement } from "../base/jl-element.js";
|
|
3
4
|
import { jsonOf } from "../lib/attributes.js";
|
|
4
5
|
import { registerIcons } from "../lib/icons.js";
|
|
5
|
-
import { jlText } from "../lib/texts.js";
|
|
6
6
|
import { JlIcon } from "../atoms/jl-icon.js";
|
|
7
7
|
import { setOrRemove } from "../lib/dom.js";
|
|
8
8
|
import { JlSpinner } from "../atoms/jl-spinner.js";
|
|
9
9
|
import { highlightSegments } from "../lib/fuzzy.js";
|
|
10
10
|
import { hotkeyLabels, isApplePlatform, matchesHotkey, parseHotkey } from "../lib/hotkey.js";
|
|
11
11
|
import { groupMatches, matchCommands } from "../lib/palette.js";
|
|
12
|
-
import jl_command_palette_default from "./jl-command-palette.
|
|
12
|
+
import jl_command_palette_default from "./jl-command-palette.css.js";
|
|
13
13
|
import { css } from "@jadis/core";
|
|
14
14
|
import { Search } from "lucide";
|
|
15
15
|
import { jsx, jsxs } from "@jadis/core/jsx-runtime";
|
|
@@ -46,15 +46,12 @@ var JlCommandPalette = class extends JlElement {
|
|
|
46
46
|
parse: jsonOf([])
|
|
47
47
|
});
|
|
48
48
|
open = this.useChange(false, (value) => this.renderOpen(value), { attribute: "open" });
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, { attribute: "placeholder" });
|
|
49
|
+
/** What the field says before anything is typed; jlib's own text when empty. */
|
|
50
|
+
placeholder = this.useChange("", () => this.drawTexts(), { attribute: "placeholder" });
|
|
52
51
|
/** The keys that open and close it from anywhere on the page; `none` for no keys. `mod` is ⌘ or Ctrl. */
|
|
53
52
|
hotkey = this.useChange(DEFAULT_HOTKEY, () => this.renderHotkey(), { attribute: "hotkey" });
|
|
54
|
-
/** What it says when nothing matches. */
|
|
55
|
-
emptyText = this.useChange(
|
|
56
|
-
this._refs.empty.textContent = value;
|
|
57
|
-
}, { attribute: "empty-text" });
|
|
53
|
+
/** What it says when nothing matches; jlib's own text when empty. */
|
|
54
|
+
emptyText = this.useChange("", () => this.drawTexts(), { attribute: "empty-text" });
|
|
58
55
|
/** How long typing pauses, in milliseconds, before `search` fires. */
|
|
59
56
|
debounce = this.useChange(DEFAULT_DEBOUNCE_MS, () => void 0, { attribute: "debounce" });
|
|
60
57
|
/** Shows a spinner in place of the search icon, while the page looks for what was typed. */
|
|
@@ -63,19 +60,22 @@ var JlCommandPalette = class extends JlElement {
|
|
|
63
60
|
this._refs.spinner.hidden = !value;
|
|
64
61
|
}, { attribute: "loading" });
|
|
65
62
|
/** The dialog's name for screen readers. */
|
|
66
|
-
label = this.useChange(
|
|
63
|
+
label = this.useChange("", () => this.drawTexts(), { attribute: "label" });
|
|
67
64
|
_state = {
|
|
68
65
|
active: 0,
|
|
69
66
|
matches: [],
|
|
70
67
|
timer: 0
|
|
71
68
|
};
|
|
72
69
|
_refs = this.useRefs((ref) => ({
|
|
70
|
+
closeText: ref(".close-text"),
|
|
73
71
|
dialog: ref("dialog"),
|
|
74
72
|
empty: ref(".empty"),
|
|
75
73
|
hotkeyHint: ref(".hotkey-hint"),
|
|
76
74
|
hotkeyKeys: ref(".hotkey-keys"),
|
|
77
75
|
input: ref("input"),
|
|
76
|
+
moveText: ref(".move-text"),
|
|
78
77
|
results: ref(".results"),
|
|
78
|
+
runText: ref(".run-text"),
|
|
79
79
|
searchIcon: ref(".search-icon"),
|
|
80
80
|
spinner: ref(JlSpinner)
|
|
81
81
|
}));
|
|
@@ -120,8 +120,7 @@ var JlCommandPalette = class extends JlElement {
|
|
|
120
120
|
/* @__PURE__ */ jsx("div", {
|
|
121
121
|
class: "results",
|
|
122
122
|
id: "results",
|
|
123
|
-
role: "listbox"
|
|
124
|
-
"aria-label": jlText("commands")
|
|
123
|
+
role: "listbox"
|
|
125
124
|
}),
|
|
126
125
|
/* @__PURE__ */ jsx("p", {
|
|
127
126
|
class: "empty",
|
|
@@ -136,16 +135,16 @@ var JlCommandPalette = class extends JlElement {
|
|
|
136
135
|
children: [
|
|
137
136
|
/* @__PURE__ */ jsx("kbd", { children: "↑" }),
|
|
138
137
|
/* @__PURE__ */ jsx("kbd", { children: "↓" }),
|
|
139
|
-
"
|
|
138
|
+
/* @__PURE__ */ jsx("span", { class: "move-text" })
|
|
140
139
|
]
|
|
141
140
|
}),
|
|
142
141
|
/* @__PURE__ */ jsxs("span", {
|
|
143
142
|
class: "hint",
|
|
144
|
-
children: [/* @__PURE__ */ jsx("kbd", { children: "↵" }), "
|
|
143
|
+
children: [/* @__PURE__ */ jsx("kbd", { children: "↵" }), /* @__PURE__ */ jsx("span", { class: "run-text" })]
|
|
145
144
|
}),
|
|
146
145
|
/* @__PURE__ */ jsxs("span", {
|
|
147
146
|
class: "hint hotkey-hint",
|
|
148
|
-
children: [/* @__PURE__ */ jsx("span", { class: "hotkey-keys" }), "
|
|
147
|
+
children: [/* @__PURE__ */ jsx("span", { class: "hotkey-keys" }), /* @__PURE__ */ jsx("span", { class: "close-text" })]
|
|
149
148
|
})
|
|
150
149
|
]
|
|
151
150
|
})
|
|
@@ -155,6 +154,15 @@ var JlCommandPalette = class extends JlElement {
|
|
|
155
154
|
templateCss() {
|
|
156
155
|
return css`${BASE_STYLES}${jl_command_palette_default}`;
|
|
157
156
|
}
|
|
157
|
+
drawTexts() {
|
|
158
|
+
this._refs.input.placeholder = this.placeholder.get() || jlText("commandPlaceholder");
|
|
159
|
+
this._refs.empty.textContent = this.emptyText.get() || jlText("noCommands");
|
|
160
|
+
this._refs.dialog.setAttribute("aria-label", this.label.get() || jlText("commandPalette"));
|
|
161
|
+
this._refs.results.setAttribute("aria-label", jlText("commands"));
|
|
162
|
+
this._refs.moveText.textContent = jlText("commandMove");
|
|
163
|
+
this._refs.runText.textContent = jlText("commandRun");
|
|
164
|
+
this._refs.closeText.textContent = jlText("commandClose");
|
|
165
|
+
}
|
|
158
166
|
onConnect() {
|
|
159
167
|
const dialog = this._refs.dialog;
|
|
160
168
|
const input = this._refs.input;
|