@f-ewald/components 1.40.3 → 1.42.2
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 +14 -4
- package/custom-elements.json +2017 -131
- package/dist/app-shell.js +1 -1
- package/dist/app-shell.js.map +1 -1
- package/dist/blink-cursor.d.ts +27 -0
- package/dist/blink-cursor.d.ts.map +1 -0
- package/dist/blink-cursor.js +78 -0
- package/dist/blink-cursor.js.map +1 -0
- package/dist/code-diff.d.ts +41 -0
- package/dist/code-diff.d.ts.map +1 -0
- package/dist/code-diff.js +161 -0
- package/dist/code-diff.js.map +1 -0
- package/dist/comment-label.d.ts +26 -0
- package/dist/comment-label.d.ts.map +1 -0
- package/dist/comment-label.js +81 -0
- package/dist/comment-label.js.map +1 -0
- package/dist/confirm-dialog.d.ts +12 -6
- package/dist/confirm-dialog.d.ts.map +1 -1
- package/dist/confirm-dialog.js +50 -88
- package/dist/confirm-dialog.js.map +1 -1
- package/dist/dag-graph.d.ts +161 -0
- package/dist/dag-graph.d.ts.map +1 -0
- package/dist/dag-graph.js +724 -0
- package/dist/dag-graph.js.map +1 -0
- package/dist/icons.d.ts +16 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +16 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/mcp-server.js.map +1 -1
- package/dist/modal-dialog.d.ts +16 -13
- package/dist/modal-dialog.d.ts.map +1 -1
- package/dist/modal-dialog.js +69 -104
- package/dist/modal-dialog.js.map +1 -1
- package/dist/photo-gallery.js +1 -1
- package/dist/photo-gallery.js.map +1 -1
- package/dist/price-history-chart.js +1 -1
- package/dist/price-history-chart.js.map +1 -1
- package/dist/progress-bar.d.ts.map +1 -1
- package/dist/progress-bar.js +23 -17
- package/dist/progress-bar.js.map +1 -1
- package/dist/slide-panel.d.ts +3 -3
- package/dist/slide-panel.d.ts.map +1 -1
- package/dist/slide-panel.js +38 -22
- package/dist/slide-panel.js.map +1 -1
- package/dist/stat-strip.d.ts +30 -0
- package/dist/stat-strip.d.ts.map +1 -0
- package/dist/stat-strip.js +111 -0
- package/dist/stat-strip.js.map +1 -0
- package/dist/step-ladder.d.ts +46 -0
- package/dist/step-ladder.d.ts.map +1 -0
- package/dist/step-ladder.js +175 -0
- package/dist/step-ladder.js.map +1 -0
- package/dist/terminal-block.d.ts +45 -0
- package/dist/terminal-block.d.ts.map +1 -0
- package/dist/terminal-block.js +113 -0
- package/dist/terminal-block.js.map +1 -0
- package/dist/toast-notification.d.ts +7 -0
- package/dist/toast-notification.d.ts.map +1 -1
- package/dist/toast-notification.js +34 -0
- package/dist/toast-notification.js.map +1 -1
- package/dist/tokens.css +64 -1
- package/dist/tokens.d.ts +58 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +145 -0
- package/dist/tokens.js.map +1 -1
- package/dist/ui-button.js +2 -2
- package/dist/ui-button.js.map +1 -1
- package/dist/utils/dag-layout.d.ts +60 -0
- package/dist/utils/dag-layout.d.ts.map +1 -0
- package/dist/utils/dag-layout.js +80 -0
- package/dist/utils/dag-layout.js.map +1 -0
- package/dist/window-chrome.d.ts +34 -0
- package/dist/window-chrome.d.ts.map +1 -0
- package/dist/window-chrome.js +141 -0
- package/dist/window-chrome.js.map +1 -0
- package/docs/app-shell.md +1 -1
- package/docs/blink-cursor.md +45 -0
- package/docs/code-diff.md +64 -0
- package/docs/comment-label.md +49 -0
- package/docs/confirm-dialog.md +4 -3
- package/docs/dag-graph.md +101 -0
- package/docs/design-language.md +43 -21
- package/docs/icons.md +8 -0
- package/docs/layouts/marketing-landing.md +102 -0
- package/docs/modal-dialog.md +9 -9
- package/docs/photo-gallery.md +1 -1
- package/docs/price-history-chart.md +1 -0
- package/docs/slide-panel.md +2 -2
- package/docs/stat-strip.md +57 -0
- package/docs/step-ladder.md +63 -0
- package/docs/terminal-block.md +69 -0
- package/docs/ui-button.md +2 -0
- package/docs/window-chrome.md +64 -0
- package/llms.txt +282 -18
- package/package.json +2 -1
package/dist/slide-panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":"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","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport { activateLayer, claimEscape, deactivateLayer } from \"./utils/layer-stack.js\";\n\n/**\n * Generic sliding panel shell: a non-modal native `<dialog>` (`show()`). Handles\n * positioning, open/close animation, header chrome, and a close button. Body content is provided via the\n * default slot; the consumer controls its own padding and overflow.\n *\n * Desktop: fixed right-side panel that slides from the right.\n * Mobile (≤48rem): bottom-sheet drawer (60vh) — reserved for future use.\n *\n * @element slide-panel\n * @fires panel-close - User clicked the close (✕) button.\n */\n@customElement(\"slide-panel\")\nexport class SlidePanel extends LitElement {\n /** Whether the panel is currently visible. */\n @property({ type: Boolean }) open = false;\n /** Title text shown in the panel header (overridable via slot=\"title\"). */\n @property() heading = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n /* Non-modal native <dialog> (show()): stays in normal stacking, so --component-layer-z still orders panels. */\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: auto;\n width: 20rem;\n height: auto;\n margin: 0;\n padding: 0;\n border: 0;\n color: inherit;\n z-index: var(--component-layer-z, 20);\n background: var(--ui-surface, #ffffff);\n box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));\n transform: translateX(110%);\n /* display is animated discretely so the closing slide stays visible until it finishes. */\n transition:\n transform 250ms ease,\n display 250ms allow-discrete;\n flex-direction: column;\n overflow: hidden;\n }\n /* Scoped to [open]: an author display value would otherwise defeat the UA's display:none. */\n .panel[open] {\n display: flex;\n transform: translateX(0);\n }\n @starting-style {\n .panel[open] {\n transform: translateX(110%);\n }\n }\n .panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n flex: 0 0 auto;\n }\n .panel-title {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size-lg, 1rem);\n line-height: var(--ui-line-height-tight, 1.25);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: 0.5rem;\n }\n .close-btn {\n background: none;\n border: none;\n cursor: pointer;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n .close-btn:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .close-btn:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .handle {\n display: none;\n }\n @media (prefers-reduced-motion: reduce) {\n .panel {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .close-btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (max-width: 48rem) {\n .panel {\n top: auto;\n right: 0;\n bottom: 0;\n left: 0;\n width: auto;\n height: 60vh;\n border-radius: var(--ui-radius, 0.5rem) var(--ui-radius, 0.5rem) 0 0;\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n transform: translateY(110%);\n }\n .panel[open] {\n transform: translateY(0);\n }\n @starting-style {\n .panel[open] {\n transform: translateY(110%);\n }\n }\n .handle {\n display: block;\n width: 2.25rem;\n height: 0.25rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n margin: 0.5rem auto 0;\n flex: 0 0 auto;\n }\n .panel-header {\n padding: 0.25rem 0.5rem 0.5rem;\n }\n }\n `,\n ];\n\n @query(\"dialog\") private _dialog!: HTMLDialogElement;\n\n private _close() {\n this.dispatchEvent(new CustomEvent(\"panel-close\", { bubbles: true, composed: true }));\n }\n\n private _onWindowKeydown = (event: KeyboardEvent): void => {\n if (!this.open || !claimEscape(this, event)) return;\n this._close();\n };\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"open\")) return;\n if (this.open) {\n activateLayer(this);\n window.addEventListener(\"keydown\", this._onWindowKeydown);\n if (!this._dialog.open) this._dialog.show();\n this.shadowRoot?.querySelector<HTMLElement>(\".close-btn\")?.focus();\n return;\n }\n deactivateLayer(this);\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n if (this._dialog.open) this._dialog.close();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n deactivateLayer(this);\n this.open = false;\n }\n\n override render() {\n const explicitLabel = this.getAttribute(\"aria-label\");\n return html`\n <dialog\n class=\"panel\"\n aria-label=${explicitLabel ?? nothing}\n aria-labelledby=${explicitLabel ? nothing : \"panel-title\"}\n >\n <div class=\"handle\" aria-hidden=\"true\"></div>\n <div class=\"panel-header\">\n <span id=\"panel-title\" class=\"panel-title\">\n <slot name=\"title\">${this.heading || \"Panel\"}</slot>\n </span>\n <button class=\"close-btn\" aria-label=\"Close panel\" @click=${this._close}>\n <span aria-hidden=\"true\">${iconX(18)}</span>\n </button>\n </div>\n <slot></slot>\n </dialog>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"slide-panel\": SlidePanel;\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, nothing } from "lit";
|
|
2
|
+
/** One stat highlight in a strip. */
|
|
3
|
+
export interface StatStripItem {
|
|
4
|
+
/** Large figure rendered verbatim, e.g. `"54%"` or `"1.2M"`. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Short caption rendered beneath the figure, e.g. `"less code"`. */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A headless, presentational strip of headline stats — one large figure plus
|
|
11
|
+
* one muted caption per `items` entry, wrapping across lines on narrow
|
|
12
|
+
* viewports. Unlike `stat-meter`, this component does not compute percentages
|
|
13
|
+
* or render a fill bar: callers pass preformatted figure strings as-is and
|
|
14
|
+
* `stat-strip` only lays them out for marketing, benchmark, or dashboard
|
|
15
|
+
* summary rows.
|
|
16
|
+
*
|
|
17
|
+
* @element stat-strip
|
|
18
|
+
*/
|
|
19
|
+
export declare class StatStrip extends LitElement {
|
|
20
|
+
static styles: import("lit").CSSResult[];
|
|
21
|
+
/** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */
|
|
22
|
+
items: StatStripItem[];
|
|
23
|
+
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
"stat-strip": StatStrip;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=stat-strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../src/stat-strip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAKrD,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA0DpB;IAEF,uGAAuG;IAC5E,KAAK,EAAE,aAAa,EAAE,CAAM;IAE9C,MAAM,0DAmBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
+
import { tokens } from "./tokens.js";
|
|
11
|
+
/**
|
|
12
|
+
* A headless, presentational strip of headline stats — one large figure plus
|
|
13
|
+
* one muted caption per `items` entry, wrapping across lines on narrow
|
|
14
|
+
* viewports. Unlike `stat-meter`, this component does not compute percentages
|
|
15
|
+
* or render a fill bar: callers pass preformatted figure strings as-is and
|
|
16
|
+
* `stat-strip` only lays them out for marketing, benchmark, or dashboard
|
|
17
|
+
* summary rows.
|
|
18
|
+
*
|
|
19
|
+
* @element stat-strip
|
|
20
|
+
*/
|
|
21
|
+
let StatStrip = class StatStrip extends LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */
|
|
25
|
+
this.items = [];
|
|
26
|
+
}
|
|
27
|
+
static { this.styles = [
|
|
28
|
+
tokens,
|
|
29
|
+
css `
|
|
30
|
+
:host {
|
|
31
|
+
display: block;
|
|
32
|
+
font-family: var(
|
|
33
|
+
--ui-font,
|
|
34
|
+
ui-sans-serif,
|
|
35
|
+
system-ui,
|
|
36
|
+
sans-serif,
|
|
37
|
+
"Apple Color Emoji",
|
|
38
|
+
"Segoe UI Emoji",
|
|
39
|
+
"Segoe UI Symbol",
|
|
40
|
+
"Noto Color Emoji"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.strip {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
gap: 1rem 1.5rem;
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.item {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex: 1 1 8rem;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 0.25rem;
|
|
58
|
+
min-width: 8rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.value {
|
|
62
|
+
order: -1;
|
|
63
|
+
margin: 0;
|
|
64
|
+
color: var(--ui-primary, #4f46e5);
|
|
65
|
+
/* The lg title tier, same as calendar-month/popover-panel/slide-panel's
|
|
66
|
+
most prominent text — the shared scale is never themed for size, so
|
|
67
|
+
this stays the largest available step rather than a literal. */
|
|
68
|
+
font-size: var(--ui-font-size-lg, 1rem);
|
|
69
|
+
font-weight: var(--ui-font-weight-bold, 700);
|
|
70
|
+
line-height: var(--ui-line-height-tight, 1.25);
|
|
71
|
+
font-variant-numeric: var(--ui-numeric, normal);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.label {
|
|
76
|
+
margin: 0;
|
|
77
|
+
color: var(--ui-text-muted, #64748b);
|
|
78
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
79
|
+
font-weight: var(--ui-font-weight-medium, 500);
|
|
80
|
+
letter-spacing: var(--ui-tracking-wide, 0.04em);
|
|
81
|
+
line-height: var(--ui-line-height-tight, 1.25);
|
|
82
|
+
text-transform: var(--ui-label-transform, none);
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
]; }
|
|
86
|
+
render() {
|
|
87
|
+
if (this.items.length === 0)
|
|
88
|
+
return nothing;
|
|
89
|
+
return html `
|
|
90
|
+
<dl class="strip">
|
|
91
|
+
${repeat(this.items,
|
|
92
|
+
// Stat strips are short presentational rows with no intrinsic item IDs;
|
|
93
|
+
// keying by index deliberately preserves caller-supplied display order.
|
|
94
|
+
(_item, index) => index, (item) => html `
|
|
95
|
+
<div class="item">
|
|
96
|
+
<dt class="label">${item.label}</dt>
|
|
97
|
+
<dd class="value">${item.value}</dd>
|
|
98
|
+
</div>
|
|
99
|
+
`)}
|
|
100
|
+
</dl>
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
__decorate([
|
|
105
|
+
property({ type: Array })
|
|
106
|
+
], StatStrip.prototype, "items", void 0);
|
|
107
|
+
StatStrip = __decorate([
|
|
108
|
+
customElement("stat-strip")
|
|
109
|
+
], StatStrip);
|
|
110
|
+
export { StatStrip };
|
|
111
|
+
//# sourceMappingURL=stat-strip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-strip.js","sourceRoot":"","sources":["../src/stat-strip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;;;;GASG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QA6DL,uGAAuG;QAC5E,UAAK,GAAoB,EAAE,CAAC;IAsBzD,CAAC;aAnFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDF;KACF,AA1DqB,CA0DpB;IAKO,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC;QAE5C,OAAO,IAAI,CAAA;;UAEL,MAAM,CACN,IAAI,CAAC,KAAK;QACV,wEAAwE;QACxE,wEAAwE;QACxE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EACvB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;kCAEU,IAAI,CAAC,KAAK;kCACV,IAAI,CAAC,KAAK;;WAEjC,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AAtB4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCAA6B;AA9D5C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAoFrB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One stat highlight in a strip. */\nexport interface StatStripItem {\n /** Large figure rendered verbatim, e.g. `\"54%\"` or `\"1.2M\"`. */\n value: string;\n /** Short caption rendered beneath the figure, e.g. `\"less code\"`. */\n label: string;\n}\n\n/**\n * A headless, presentational strip of headline stats — one large figure plus\n * one muted caption per `items` entry, wrapping across lines on narrow\n * viewports. Unlike `stat-meter`, this component does not compute percentages\n * or render a fill bar: callers pass preformatted figure strings as-is and\n * `stat-strip` only lays them out for marketing, benchmark, or dashboard\n * summary rows.\n *\n * @element stat-strip\n */\n@customElement(\"stat-strip\")\nexport class StatStrip extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n\n .strip {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: 1rem 1.5rem;\n margin: 0;\n padding: 0;\n }\n\n .item {\n display: flex;\n flex: 1 1 8rem;\n flex-direction: column;\n gap: 0.25rem;\n min-width: 8rem;\n }\n\n .value {\n order: -1;\n margin: 0;\n color: var(--ui-primary, #4f46e5);\n /* The lg title tier, same as calendar-month/popover-panel/slide-panel's\n most prominent text — the shared scale is never themed for size, so\n this stays the largest available step rather than a literal. */\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-tight, 1.25);\n font-variant-numeric: var(--ui-numeric, normal);\n white-space: nowrap;\n }\n\n .label {\n margin: 0;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n line-height: var(--ui-line-height-tight, 1.25);\n text-transform: var(--ui-label-transform, none);\n }\n `,\n ];\n\n /** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */\n @property({ type: Array }) items: StatStripItem[] = [];\n\n override render() {\n if (this.items.length === 0) return nothing;\n\n return html`\n <dl class=\"strip\">\n ${repeat(\n this.items,\n // Stat strips are short presentational rows with no intrinsic item IDs;\n // keying by index deliberately preserves caller-supplied display order.\n (_item, index) => index,\n (item) => html`\n <div class=\"item\">\n <dt class=\"label\">${item.label}</dt>\n <dd class=\"value\">${item.value}</dd>\n </div>\n `,\n )}\n </dl>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"stat-strip\": StatStrip;\n }\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/** One rung of a {@link StepLadder} in the data-driven `items` path. */
|
|
3
|
+
export interface StepLadderItem {
|
|
4
|
+
/** The bold step title, shown immediately after the ordinal. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** The muted supporting line that explains the rung's fallback guidance. */
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A flat ordered ladder of fallback steps — an escalating "try this first,
|
|
11
|
+
* then move to the next rung only if it does not solve it" list. Each rung
|
|
12
|
+
* shows a zero-padded ordinal, a bold title, and a muted description, with a
|
|
13
|
+
* hairline rule between rows.
|
|
14
|
+
*
|
|
15
|
+
* Feed it the `items` array for the plain data path, where each
|
|
16
|
+
* {@link StepLadderItem} supplies a `title` and `description`, or slot bare
|
|
17
|
+
* `<li>` steps when a rung needs links, emphasis, or other richer markup.
|
|
18
|
+
* Slotted content takes precedence over `items`; with neither, nothing is
|
|
19
|
+
* rendered. As with `spec-list`, richer wrapper elements are accepted too, but
|
|
20
|
+
* those own their own inner markup.
|
|
21
|
+
*
|
|
22
|
+
* @element step-ladder
|
|
23
|
+
* @slot - Optional `<li>` rungs or richer step markup; when present, they
|
|
24
|
+
* replace the `items` path.
|
|
25
|
+
*/
|
|
26
|
+
export declare class StepLadder extends LitElement {
|
|
27
|
+
/** The rungs for the data-driven path. Ignored when the default slot has content. */
|
|
28
|
+
items: StepLadderItem[];
|
|
29
|
+
/** Whether the default slot currently has assigned content. */
|
|
30
|
+
private _hasSlotted;
|
|
31
|
+
static styles: import("lit").CSSResult[];
|
|
32
|
+
/** Whether a slot node is real content, ignoring the whitespace ordinary indented markup leaves between children. */
|
|
33
|
+
private static _isContent;
|
|
34
|
+
/** Tracks whether the default slot has content so slotted markup can take precedence over `items`. */
|
|
35
|
+
private _onSlotChange;
|
|
36
|
+
connectedCallback(): void;
|
|
37
|
+
/** The rungs, defended against a non-array value assigned at runtime by a JS or HTML consumer. */
|
|
38
|
+
private _rows;
|
|
39
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
40
|
+
}
|
|
41
|
+
declare global {
|
|
42
|
+
interface HTMLElementTagNameMap {
|
|
43
|
+
"step-ladder": StepLadder;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=step-ladder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-ladder.d.ts","sourceRoot":"","sources":["../src/step-ladder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,qFAAqF;IAC1D,KAAK,EAAE,cAAc,EAAE,CAAM;IAExD,+DAA+D;IACtD,OAAO,CAAC,WAAW,CAAS;IAErC,OAAgB,MAAM,4BA+EpB;IAEF,qHAAqH;IACrH,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,sGAAsG;IACtG,OAAO,CAAC,aAAa;IAKZ,iBAAiB,IAAI,IAAI,CAOjC;IAED,kGAAkG;IAClG,OAAO,CAAC,KAAK;IAIJ,MAAM,yCA4Bd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var StepLadder_1;
|
|
8
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
9
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
10
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
11
|
+
import { tokens } from "./tokens.js";
|
|
12
|
+
/**
|
|
13
|
+
* A flat ordered ladder of fallback steps — an escalating "try this first,
|
|
14
|
+
* then move to the next rung only if it does not solve it" list. Each rung
|
|
15
|
+
* shows a zero-padded ordinal, a bold title, and a muted description, with a
|
|
16
|
+
* hairline rule between rows.
|
|
17
|
+
*
|
|
18
|
+
* Feed it the `items` array for the plain data path, where each
|
|
19
|
+
* {@link StepLadderItem} supplies a `title` and `description`, or slot bare
|
|
20
|
+
* `<li>` steps when a rung needs links, emphasis, or other richer markup.
|
|
21
|
+
* Slotted content takes precedence over `items`; with neither, nothing is
|
|
22
|
+
* rendered. As with `spec-list`, richer wrapper elements are accepted too, but
|
|
23
|
+
* those own their own inner markup.
|
|
24
|
+
*
|
|
25
|
+
* @element step-ladder
|
|
26
|
+
* @slot - Optional `<li>` rungs or richer step markup; when present, they
|
|
27
|
+
* replace the `items` path.
|
|
28
|
+
*/
|
|
29
|
+
let StepLadder = class StepLadder extends LitElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
/** The rungs for the data-driven path. Ignored when the default slot has content. */
|
|
33
|
+
this.items = [];
|
|
34
|
+
/** Whether the default slot currently has assigned content. */
|
|
35
|
+
this._hasSlotted = false;
|
|
36
|
+
}
|
|
37
|
+
static { StepLadder_1 = this; }
|
|
38
|
+
static { this.styles = [
|
|
39
|
+
tokens,
|
|
40
|
+
css `
|
|
41
|
+
:host {
|
|
42
|
+
display: block;
|
|
43
|
+
color: var(--ui-text, #0f172a);
|
|
44
|
+
font-family: var(
|
|
45
|
+
--ui-font,
|
|
46
|
+
ui-sans-serif,
|
|
47
|
+
system-ui,
|
|
48
|
+
sans-serif,
|
|
49
|
+
"Apple Color Emoji",
|
|
50
|
+
"Segoe UI Emoji",
|
|
51
|
+
"Segoe UI Symbol",
|
|
52
|
+
"Noto Color Emoji"
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
.ladder {
|
|
56
|
+
margin: 0;
|
|
57
|
+
padding: 0;
|
|
58
|
+
list-style: none;
|
|
59
|
+
counter-reset: rung;
|
|
60
|
+
}
|
|
61
|
+
.ladder.empty {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
.rung {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
gap: 0.75rem;
|
|
68
|
+
padding: 0.75rem 0;
|
|
69
|
+
counter-increment: rung;
|
|
70
|
+
}
|
|
71
|
+
.rung + .rung {
|
|
72
|
+
border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
|
|
73
|
+
}
|
|
74
|
+
.rung::before {
|
|
75
|
+
content: counter(rung, decimal-leading-zero);
|
|
76
|
+
flex: 0 0 auto;
|
|
77
|
+
min-width: 2ch;
|
|
78
|
+
color: var(--ui-primary, #4f46e5);
|
|
79
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
80
|
+
font-weight: var(--ui-font-weight-bold, 700);
|
|
81
|
+
line-height: var(--ui-line-height-normal, 1.5);
|
|
82
|
+
font-variant-numeric: var(--ui-numeric, normal);
|
|
83
|
+
}
|
|
84
|
+
.content {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex: 1 1 auto;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
align-items: baseline;
|
|
89
|
+
gap: 0.25rem 0.5rem;
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
.title {
|
|
93
|
+
color: var(--ui-text, #0f172a);
|
|
94
|
+
font-size: var(--ui-font-size, 0.875rem);
|
|
95
|
+
font-weight: var(--ui-font-weight-bold, 700);
|
|
96
|
+
line-height: var(--ui-line-height-normal, 1.5);
|
|
97
|
+
}
|
|
98
|
+
.description {
|
|
99
|
+
flex: 1 1 12rem;
|
|
100
|
+
min-width: 0;
|
|
101
|
+
color: var(--ui-text-muted, #64748b);
|
|
102
|
+
font-size: var(--ui-font-size, 0.875rem);
|
|
103
|
+
font-weight: var(--ui-font-weight-regular, 400);
|
|
104
|
+
line-height: var(--ui-line-height-normal, 1.5);
|
|
105
|
+
word-break: break-word;
|
|
106
|
+
}
|
|
107
|
+
::slotted(li) {
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 0.75rem 0;
|
|
110
|
+
list-style: none;
|
|
111
|
+
border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
|
|
112
|
+
}
|
|
113
|
+
::slotted(li:last-of-type) {
|
|
114
|
+
border-bottom: none;
|
|
115
|
+
}
|
|
116
|
+
`,
|
|
117
|
+
]; }
|
|
118
|
+
/** Whether a slot node is real content, ignoring the whitespace ordinary indented markup leaves between children. */
|
|
119
|
+
static _isContent(node) {
|
|
120
|
+
return node.nodeType === Node.ELEMENT_NODE || (node.textContent ?? "").trim().length > 0;
|
|
121
|
+
}
|
|
122
|
+
/** Tracks whether the default slot has content so slotted markup can take precedence over `items`. */
|
|
123
|
+
_onSlotChange(event) {
|
|
124
|
+
const slot = event.target;
|
|
125
|
+
this._hasSlotted = slot.assignedNodes({ flatten: true }).some(StepLadder_1._isContent);
|
|
126
|
+
}
|
|
127
|
+
connectedCallback() {
|
|
128
|
+
super.connectedCallback();
|
|
129
|
+
// slotchange only fires after the first render, so without seeding from the
|
|
130
|
+
// light DOM here an element given both items and slotted markup renders
|
|
131
|
+
// both paths for its first update — visible to anything awaiting
|
|
132
|
+
// updateComplete, and contrary to the documented "slot wins" contract.
|
|
133
|
+
this._hasSlotted = Array.from(this.childNodes).some(StepLadder_1._isContent);
|
|
134
|
+
}
|
|
135
|
+
/** The rungs, defended against a non-array value assigned at runtime by a JS or HTML consumer. */
|
|
136
|
+
_rows() {
|
|
137
|
+
return Array.isArray(this.items) ? this.items.filter((item) => item != null) : [];
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
const rows = this._rows();
|
|
141
|
+
const showItems = !this._hasSlotted && rows.length > 0;
|
|
142
|
+
const empty = !this._hasSlotted && rows.length === 0;
|
|
143
|
+
return html `
|
|
144
|
+
<ol class="ladder ${empty ? "empty" : ""}">
|
|
145
|
+
${showItems
|
|
146
|
+
? repeat(rows,
|
|
147
|
+
// Ordered ladders are display-order driven and have no intrinsic
|
|
148
|
+
// item IDs, so the index is the deliberate stable key.
|
|
149
|
+
(_item, index) => index, (item) => html `
|
|
150
|
+
<li class="rung">
|
|
151
|
+
<span class="content">
|
|
152
|
+
<span class="title">${item.title}</span>
|
|
153
|
+
${item.description
|
|
154
|
+
? html `<span class="description">${item.description}</span>`
|
|
155
|
+
: nothing}
|
|
156
|
+
</span>
|
|
157
|
+
</li>
|
|
158
|
+
`)
|
|
159
|
+
: nothing}
|
|
160
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
161
|
+
</ol>
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ type: Array })
|
|
167
|
+
], StepLadder.prototype, "items", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
state()
|
|
170
|
+
], StepLadder.prototype, "_hasSlotted", void 0);
|
|
171
|
+
StepLadder = StepLadder_1 = __decorate([
|
|
172
|
+
customElement("step-ladder")
|
|
173
|
+
], StepLadder);
|
|
174
|
+
export { StepLadder };
|
|
175
|
+
//# sourceMappingURL=step-ladder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-ladder.js","sourceRoot":"","sources":["../src/step-ladder.ts"],"names":[],"mappings":"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","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One rung of a {@link StepLadder} in the data-driven `items` path. */\nexport interface StepLadderItem {\n /** The bold step title, shown immediately after the ordinal. */\n title: string;\n /** The muted supporting line that explains the rung's fallback guidance. */\n description: string;\n}\n\n/**\n * A flat ordered ladder of fallback steps — an escalating \"try this first,\n * then move to the next rung only if it does not solve it\" list. Each rung\n * shows a zero-padded ordinal, a bold title, and a muted description, with a\n * hairline rule between rows.\n *\n * Feed it the `items` array for the plain data path, where each\n * {@link StepLadderItem} supplies a `title` and `description`, or slot bare\n * `<li>` steps when a rung needs links, emphasis, or other richer markup.\n * Slotted content takes precedence over `items`; with neither, nothing is\n * rendered. As with `spec-list`, richer wrapper elements are accepted too, but\n * those own their own inner markup.\n *\n * @element step-ladder\n * @slot - Optional `<li>` rungs or richer step markup; when present, they\n * replace the `items` path.\n */\n@customElement(\"step-ladder\")\nexport class StepLadder extends LitElement {\n /** The rungs for the data-driven path. Ignored when the default slot has content. */\n @property({ type: Array }) items: StepLadderItem[] = [];\n\n /** Whether the default slot currently has assigned content. */\n @state() private _hasSlotted = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .ladder {\n margin: 0;\n padding: 0;\n list-style: none;\n counter-reset: rung;\n }\n .ladder.empty {\n display: none;\n }\n .rung {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n padding: 0.75rem 0;\n counter-increment: rung;\n }\n .rung + .rung {\n border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n }\n .rung::before {\n content: counter(rung, decimal-leading-zero);\n flex: 0 0 auto;\n min-width: 2ch;\n color: var(--ui-primary, #4f46e5);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-normal, 1.5);\n font-variant-numeric: var(--ui-numeric, normal);\n }\n .content {\n display: flex;\n flex: 1 1 auto;\n flex-wrap: wrap;\n align-items: baseline;\n gap: 0.25rem 0.5rem;\n min-width: 0;\n }\n .title {\n color: var(--ui-text, #0f172a);\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-normal, 1.5);\n }\n .description {\n flex: 1 1 12rem;\n min-width: 0;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size, 0.875rem);\n font-weight: var(--ui-font-weight-regular, 400);\n line-height: var(--ui-line-height-normal, 1.5);\n word-break: break-word;\n }\n ::slotted(li) {\n margin: 0;\n padding: 0.75rem 0;\n list-style: none;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n }\n ::slotted(li:last-of-type) {\n border-bottom: none;\n }\n `,\n ];\n\n /** Whether a slot node is real content, ignoring the whitespace ordinary indented markup leaves between children. */\n private static _isContent(node: Node): boolean {\n return node.nodeType === Node.ELEMENT_NODE || (node.textContent ?? \"\").trim().length > 0;\n }\n\n /** Tracks whether the default slot has content so slotted markup can take precedence over `items`. */\n private _onSlotChange(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n this._hasSlotted = slot.assignedNodes({ flatten: true }).some(StepLadder._isContent);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // slotchange only fires after the first render, so without seeding from the\n // light DOM here an element given both items and slotted markup renders\n // both paths for its first update — visible to anything awaiting\n // updateComplete, and contrary to the documented \"slot wins\" contract.\n this._hasSlotted = Array.from(this.childNodes).some(StepLadder._isContent);\n }\n\n /** The rungs, defended against a non-array value assigned at runtime by a JS or HTML consumer. */\n private _rows(): StepLadderItem[] {\n return Array.isArray(this.items) ? this.items.filter((item): item is StepLadderItem => item != null) : [];\n }\n\n override render() {\n const rows = this._rows();\n const showItems = !this._hasSlotted && rows.length > 0;\n const empty = !this._hasSlotted && rows.length === 0;\n\n return html`\n <ol class=\"ladder ${empty ? \"empty\" : \"\"}\">\n ${showItems\n ? repeat(\n rows,\n // Ordered ladders are display-order driven and have no intrinsic\n // item IDs, so the index is the deliberate stable key.\n (_item, index) => index,\n (item) => html`\n <li class=\"rung\">\n <span class=\"content\">\n <span class=\"title\">${item.title}</span>\n ${item.description\n ? html`<span class=\"description\">${item.description}</span>`\n : nothing}\n </span>\n </li>\n `,\n )\n : nothing}\n <slot @slotchange=${this._onSlotChange}></slot>\n </ol>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"step-ladder\": StepLadder;\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/** The visual treatment applied to one terminal transcript line. */
|
|
3
|
+
export type TerminalLineType = "prompt" | "comment" | "output";
|
|
4
|
+
/** One ordered line in the terminal transcript. */
|
|
5
|
+
export interface TerminalLine {
|
|
6
|
+
type: TerminalLineType;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A headless, data-driven terminal transcript shell for short install or usage
|
|
11
|
+
* instructions. Callers provide a flat ordered `lines` array of
|
|
12
|
+
* `TerminalLine` objects, and the component renders each line exactly in that
|
|
13
|
+
* order with a type-driven visual treatment: `"prompt"` lines get a fixed
|
|
14
|
+
* leading `❯` marker in `--ui-primary`, `"comment"` lines render as dim italic
|
|
15
|
+
* guidance, and `"output"` lines render as plain terminal text.
|
|
16
|
+
*
|
|
17
|
+
* The panel deliberately stays dark regardless of the surrounding page theme:
|
|
18
|
+
* it reuses `--ui-tooltip` for the surface and `--ui-tooltip-text` for the
|
|
19
|
+
* main foreground (not `--ui-on-accent` — that token means "text on a solid
|
|
20
|
+
* *semantic* fill" and a theme is free to darken it for a light accent color,
|
|
21
|
+
* whereas `--ui-tooltip`'s own fill stays dark unconditionally), because this
|
|
22
|
+
* is meant to read as "the terminal" rather than as a normal page card that
|
|
23
|
+
* follows the ambient surface palette.
|
|
24
|
+
*
|
|
25
|
+
* An empty `lines` array still renders the bordered, padded shell so consumers
|
|
26
|
+
* can see that an instruction block is present but currently has no transcript
|
|
27
|
+
* content, rather than having the component silently disappear.
|
|
28
|
+
*
|
|
29
|
+
* @element terminal-block
|
|
30
|
+
*/
|
|
31
|
+
export declare class TerminalBlock extends LitElement {
|
|
32
|
+
static styles: import("lit").CSSResult[];
|
|
33
|
+
/**
|
|
34
|
+
* Ordered terminal transcript lines. Each entry is a `{ type, text }`
|
|
35
|
+
* object, and an empty array still renders the visible terminal shell.
|
|
36
|
+
*/
|
|
37
|
+
lines: TerminalLine[];
|
|
38
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
"terminal-block": TerminalBlock;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=terminal-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-block.d.ts","sourceRoot":"","sources":["../src/terminal-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAK5C,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE/D,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,OAAgB,MAAM,4BA2DpB;IAEF;;;OAGG;IACwB,KAAK,EAAE,YAAY,EAAE,CAAM;IAE7C,MAAM,yCAMd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
+
import { tokens } from "./tokens.js";
|
|
11
|
+
/**
|
|
12
|
+
* A headless, data-driven terminal transcript shell for short install or usage
|
|
13
|
+
* instructions. Callers provide a flat ordered `lines` array of
|
|
14
|
+
* `TerminalLine` objects, and the component renders each line exactly in that
|
|
15
|
+
* order with a type-driven visual treatment: `"prompt"` lines get a fixed
|
|
16
|
+
* leading `❯` marker in `--ui-primary`, `"comment"` lines render as dim italic
|
|
17
|
+
* guidance, and `"output"` lines render as plain terminal text.
|
|
18
|
+
*
|
|
19
|
+
* The panel deliberately stays dark regardless of the surrounding page theme:
|
|
20
|
+
* it reuses `--ui-tooltip` for the surface and `--ui-tooltip-text` for the
|
|
21
|
+
* main foreground (not `--ui-on-accent` — that token means "text on a solid
|
|
22
|
+
* *semantic* fill" and a theme is free to darken it for a light accent color,
|
|
23
|
+
* whereas `--ui-tooltip`'s own fill stays dark unconditionally), because this
|
|
24
|
+
* is meant to read as "the terminal" rather than as a normal page card that
|
|
25
|
+
* follows the ambient surface palette.
|
|
26
|
+
*
|
|
27
|
+
* An empty `lines` array still renders the bordered, padded shell so consumers
|
|
28
|
+
* can see that an instruction block is present but currently has no transcript
|
|
29
|
+
* content, rather than having the component silently disappear.
|
|
30
|
+
*
|
|
31
|
+
* @element terminal-block
|
|
32
|
+
*/
|
|
33
|
+
let TerminalBlock = class TerminalBlock extends LitElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
/**
|
|
37
|
+
* Ordered terminal transcript lines. Each entry is a `{ type, text }`
|
|
38
|
+
* object, and an empty array still renders the visible terminal shell.
|
|
39
|
+
*/
|
|
40
|
+
this.lines = [];
|
|
41
|
+
}
|
|
42
|
+
static { this.styles = [
|
|
43
|
+
tokens,
|
|
44
|
+
css `
|
|
45
|
+
:host {
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
.panel {
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
margin: 0;
|
|
51
|
+
display: grid;
|
|
52
|
+
gap: 0.25rem;
|
|
53
|
+
overflow-x: auto;
|
|
54
|
+
padding: 0.75rem 1rem;
|
|
55
|
+
border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
|
|
56
|
+
border-radius: var(--ui-radius, 0.5rem);
|
|
57
|
+
background: var(--ui-tooltip, #0f172a);
|
|
58
|
+
color: var(--ui-tooltip-text, #ffffff);
|
|
59
|
+
font-family: var(
|
|
60
|
+
--ui-font-mono,
|
|
61
|
+
ui-monospace,
|
|
62
|
+
SFMono-Regular,
|
|
63
|
+
Menlo,
|
|
64
|
+
Monaco,
|
|
65
|
+
Consolas,
|
|
66
|
+
monospace
|
|
67
|
+
);
|
|
68
|
+
font-size: var(--ui-font-size, 0.875rem);
|
|
69
|
+
line-height: var(--ui-line-height-normal, 1.5);
|
|
70
|
+
white-space: normal;
|
|
71
|
+
}
|
|
72
|
+
.line {
|
|
73
|
+
display: block;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
white-space: pre-wrap;
|
|
76
|
+
}
|
|
77
|
+
.prompt::before {
|
|
78
|
+
content: "❯";
|
|
79
|
+
margin-right: 0.5rem;
|
|
80
|
+
color: var(--ui-primary, #4f46e5);
|
|
81
|
+
font-weight: var(--ui-font-weight-semibold, 600);
|
|
82
|
+
}
|
|
83
|
+
.comment {
|
|
84
|
+
color: rgb(255 255 255 / 0.55);
|
|
85
|
+
font-style: italic;
|
|
86
|
+
}
|
|
87
|
+
@media (forced-colors: active) {
|
|
88
|
+
.panel {
|
|
89
|
+
border: 1px solid CanvasText;
|
|
90
|
+
background: Canvas;
|
|
91
|
+
color: CanvasText;
|
|
92
|
+
}
|
|
93
|
+
.prompt::before {
|
|
94
|
+
color: LinkText;
|
|
95
|
+
}
|
|
96
|
+
.comment {
|
|
97
|
+
color: GrayText;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`,
|
|
101
|
+
]; }
|
|
102
|
+
render() {
|
|
103
|
+
return html `<pre class="panel">${repeat(this.lines, (_line, index) => index, (line) => html `<span class=${`line ${line.type}`}>${line.text}</span>`)}</pre>`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
__decorate([
|
|
107
|
+
property({ type: Array })
|
|
108
|
+
], TerminalBlock.prototype, "lines", void 0);
|
|
109
|
+
TerminalBlock = __decorate([
|
|
110
|
+
customElement("terminal-block")
|
|
111
|
+
], TerminalBlock);
|
|
112
|
+
export { TerminalBlock };
|
|
113
|
+
//# sourceMappingURL=terminal-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-block.js","sourceRoot":"","sources":["../src/terminal-block.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWrC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QA8DL;;;WAGG;QACwB,UAAK,GAAmB,EAAE,CAAC;IASxD,CAAC;aA1EiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;KACF,AA3DqB,CA2DpB;IAQO,MAAM;QACb,OAAO,IAAI,CAAA,sBAAsB,MAAM,CACrC,IAAI,CAAC,KAAK,EACV,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EACvB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA,eAAe,QAAQ,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,SAAS,CACvE,QAAQ,CAAC;IACZ,CAAC;CACF,CAAA;AAT4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAA4B;AAlE3C,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA2EzB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** The visual treatment applied to one terminal transcript line. */\nexport type TerminalLineType = \"prompt\" | \"comment\" | \"output\";\n\n/** One ordered line in the terminal transcript. */\nexport interface TerminalLine {\n type: TerminalLineType;\n text: string;\n}\n\n/**\n * A headless, data-driven terminal transcript shell for short install or usage\n * instructions. Callers provide a flat ordered `lines` array of\n * `TerminalLine` objects, and the component renders each line exactly in that\n * order with a type-driven visual treatment: `\"prompt\"` lines get a fixed\n * leading `❯` marker in `--ui-primary`, `\"comment\"` lines render as dim italic\n * guidance, and `\"output\"` lines render as plain terminal text.\n *\n * The panel deliberately stays dark regardless of the surrounding page theme:\n * it reuses `--ui-tooltip` for the surface and `--ui-tooltip-text` for the\n * main foreground (not `--ui-on-accent` — that token means \"text on a solid\n * *semantic* fill\" and a theme is free to darken it for a light accent color,\n * whereas `--ui-tooltip`'s own fill stays dark unconditionally), because this\n * is meant to read as \"the terminal\" rather than as a normal page card that\n * follows the ambient surface palette.\n *\n * An empty `lines` array still renders the bordered, padded shell so consumers\n * can see that an instruction block is present but currently has no transcript\n * content, rather than having the component silently disappear.\n *\n * @element terminal-block\n */\n@customElement(\"terminal-block\")\nexport class TerminalBlock extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n box-sizing: border-box;\n margin: 0;\n display: grid;\n gap: 0.25rem;\n overflow-x: auto;\n padding: 0.75rem 1rem;\n border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-tooltip, #0f172a);\n color: var(--ui-tooltip-text, #ffffff);\n font-family: var(\n --ui-font-mono,\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace\n );\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n white-space: normal;\n }\n .line {\n display: block;\n min-width: 0;\n white-space: pre-wrap;\n }\n .prompt::before {\n content: \"❯\";\n margin-right: 0.5rem;\n color: var(--ui-primary, #4f46e5);\n font-weight: var(--ui-font-weight-semibold, 600);\n }\n .comment {\n color: rgb(255 255 255 / 0.55);\n font-style: italic;\n }\n @media (forced-colors: active) {\n .panel {\n border: 1px solid CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n .prompt::before {\n color: LinkText;\n }\n .comment {\n color: GrayText;\n }\n }\n `,\n ];\n\n /**\n * Ordered terminal transcript lines. Each entry is a `{ type, text }`\n * object, and an empty array still renders the visible terminal shell.\n */\n @property({ type: Array }) lines: TerminalLine[] = [];\n\n override render() {\n return html`<pre class=\"panel\">${repeat(\n this.lines,\n (_line, index) => index,\n (line) => html`<span class=${`line ${line.type}`}>${line.text}</span>`,\n )}</pre>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"terminal-block\": TerminalBlock;\n }\n}\n"]}
|
|
@@ -67,11 +67,18 @@ export declare class ToastNotification extends LitElement {
|
|
|
67
67
|
* @returns The toast's id — pass to `dismiss()` to remove it early.
|
|
68
68
|
*/
|
|
69
69
|
show(message: string, options?: ToastOptions): number;
|
|
70
|
+
/**
|
|
71
|
+
* Moves the stack to the top of the browser's top layer, so it renders above any native
|
|
72
|
+
* modal `<dialog>` opened earlier (a `position: fixed; z-index` stack can't). Re-showing
|
|
73
|
+
* puts it above layers added since the last toast. No-op without Popover API support.
|
|
74
|
+
*/
|
|
75
|
+
private _promote;
|
|
70
76
|
/**
|
|
71
77
|
* Removes a toast immediately, cancelling its pending auto-dismiss timer if any.
|
|
72
78
|
* @param id The id returned by `show()`.
|
|
73
79
|
*/
|
|
74
80
|
dismiss(id: number): void;
|
|
81
|
+
connectedCallback(): void;
|
|
75
82
|
disconnectedCallback(): void;
|
|
76
83
|
/** Schedules (or reschedules) the real auto-dismiss timeout for a toast. */
|
|
77
84
|
private _scheduleTimer;
|