@f-ewald/components 0.5.0 → 0.7.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 +61 -0
- package/custom-elements.json +3808 -930
- package/dist/chat-message.d.ts +39 -0
- package/dist/chat-message.d.ts.map +1 -0
- package/dist/chat-message.js +155 -0
- package/dist/chat-message.js.map +1 -0
- package/dist/data-table.d.ts +39 -0
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +119 -0
- package/dist/data-table.js.map +1 -0
- package/dist/dropdown-button.d.ts +37 -0
- package/dist/dropdown-button.d.ts.map +1 -0
- package/dist/dropdown-button.js +219 -0
- package/dist/dropdown-button.js.map +1 -0
- package/dist/editable-text.d.ts +52 -0
- package/dist/editable-text.d.ts.map +1 -0
- package/dist/editable-text.js +224 -0
- package/dist/editable-text.js.map +1 -0
- package/dist/form-select.d.ts +46 -0
- package/dist/form-select.d.ts.map +1 -0
- package/dist/form-select.js +245 -0
- package/dist/form-select.js.map +1 -0
- package/dist/frame-box.d.ts +22 -0
- package/dist/frame-box.d.ts.map +1 -0
- package/dist/frame-box.js +68 -0
- package/dist/frame-box.js.map +1 -0
- package/dist/gallery-item-variant.d.ts +21 -0
- package/dist/gallery-item-variant.d.ts.map +1 -0
- package/dist/gallery-item-variant.js +44 -0
- package/dist/gallery-item-variant.js.map +1 -0
- package/dist/gallery-item.d.ts +28 -0
- package/dist/gallery-item.d.ts.map +1 -0
- package/dist/gallery-item.js +54 -0
- package/dist/gallery-item.js.map +1 -0
- package/dist/icon-button.d.ts +27 -0
- package/dist/icon-button.d.ts.map +1 -0
- package/dist/icon-button.js +83 -0
- package/dist/icon-button.js.map +1 -0
- package/dist/icons.d.ts +8 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +8 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/live-timer.d.ts +31 -0
- package/dist/live-timer.d.ts.map +1 -0
- package/dist/live-timer.js +78 -0
- package/dist/live-timer.js.map +1 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +82 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/photo-gallery.d.ts +117 -0
- package/dist/photo-gallery.d.ts.map +1 -0
- package/dist/photo-gallery.js +620 -0
- package/dist/photo-gallery.js.map +1 -0
- package/dist/popover-panel.d.ts +37 -0
- package/dist/popover-panel.d.ts.map +1 -0
- package/dist/popover-panel.js +184 -0
- package/dist/popover-panel.js.map +1 -0
- package/dist/status-pill.d.ts +24 -0
- package/dist/status-pill.d.ts.map +1 -0
- package/dist/status-pill.js +101 -0
- package/dist/status-pill.js.map +1 -0
- package/dist/tile-grid.d.ts +32 -0
- package/dist/tile-grid.d.ts.map +1 -0
- package/dist/tile-grid.js +102 -0
- package/dist/tile-grid.js.map +1 -0
- package/dist/tokens.css +39 -0
- package/dist/tokens.d.ts +28 -3
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +42 -43
- package/dist/tokens.js.map +1 -1
- package/dist/user-avatar.d.ts +5 -2
- package/dist/user-avatar.d.ts.map +1 -1
- package/dist/user-avatar.js +22 -6
- package/dist/user-avatar.js.map +1 -1
- package/dist/utils/duration.d.ts +12 -0
- package/dist/utils/duration.d.ts.map +1 -0
- package/dist/utils/duration.js +27 -0
- package/dist/utils/duration.js.map +1 -0
- package/docs/chat-message.md +59 -0
- package/docs/data-table.md +63 -0
- package/docs/dropdown-button.md +61 -0
- package/docs/editable-text.md +51 -0
- package/docs/form-select.md +70 -0
- package/docs/frame-box.md +43 -0
- package/docs/gallery-item-variant.md +37 -0
- package/docs/gallery-item.md +47 -0
- package/docs/icon-button.md +52 -0
- package/docs/live-timer.md +39 -0
- package/docs/mcp-evaluation.md +18 -11
- package/docs/photo-gallery.md +77 -0
- package/docs/popover-panel.md +70 -0
- package/docs/status-pill.md +43 -0
- package/docs/tile-grid.md +58 -0
- package/docs/user-avatar.md +1 -1
- package/llms.txt +357 -1
- package/package.json +10 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { AnimateConfetti } from "./animate-confetti.js";
|
|
2
|
+
export { GalleryItem } from "./gallery-item.js";
|
|
3
|
+
export { GalleryItemVariant } from "./gallery-item-variant.js";
|
|
4
|
+
export { PhotoGallery, } from "./photo-gallery.js";
|
|
2
5
|
export { RevealButton } from "./reveal-button.js";
|
|
3
6
|
export { RomanNumeral } from "./roman-numeral.js";
|
|
4
7
|
export { ConfirmDialog } from "./confirm-dialog.js";
|
|
@@ -21,6 +24,18 @@ export { RadioCards } from "./radio-cards.js";
|
|
|
21
24
|
export { RadioPills } from "./radio-pills.js";
|
|
22
25
|
export { UiButton } from "./ui-button.js";
|
|
23
26
|
export { StatMeter } from "./stat-meter.js";
|
|
24
|
-
export {
|
|
27
|
+
export { StatusPill } from "./status-pill.js";
|
|
28
|
+
export { EditableText } from "./editable-text.js";
|
|
29
|
+
export { LiveTimer } from "./live-timer.js";
|
|
30
|
+
export { ChatMessage, } from "./chat-message.js";
|
|
31
|
+
export { FormSelect } from "./form-select.js";
|
|
32
|
+
export { DataTable } from "./data-table.js";
|
|
33
|
+
export { TileGrid } from "./tile-grid.js";
|
|
34
|
+
export { PopoverPanel } from "./popover-panel.js";
|
|
35
|
+
export { DropdownButton } from "./dropdown-button.js";
|
|
36
|
+
export { IconButton } from "./icon-button.js";
|
|
37
|
+
export { FrameBox } from "./frame-box.js";
|
|
38
|
+
export { formatDuration } from "./utils/duration.js";
|
|
39
|
+
export { tokens, tokenValues, darkTokenValues } from "./tokens.js";
|
|
25
40
|
export * from "./icons.js";
|
|
26
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"m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AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,WAAW,GAGZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { GalleryItem } from \"./gallery-item.js\";\nexport { GalleryItemVariant } from \"./gallery-item-variant.js\";\nexport {\n PhotoGallery,\n type PhotoGalleryChangeReason,\n type PhotoGalleryObjectFit,\n type PhotoGallerySlideChangeDetail,\n} from \"./photo-gallery.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { MapPoint } from \"./map-point.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { StatMeter } from \"./stat-meter.js\";\nexport { StatusPill, type StatusPillColor } from \"./status-pill.js\";\nexport { EditableText } from \"./editable-text.js\";\nexport { LiveTimer } from \"./live-timer.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { FormSelect, type SelectOption } from \"./form-select.js\";\nexport { DataTable, type DataTableColumn } from \"./data-table.js\";\nexport { TileGrid } from \"./tile-grid.js\";\nexport { PopoverPanel } from \"./popover-panel.js\";\nexport { DropdownButton, type DropdownOption } from \"./dropdown-button.js\";\nexport { IconButton } from \"./icon-button.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { type DurationFormat } from "./utils/duration.js";
|
|
3
|
+
/**
|
|
4
|
+
* Per-second ticking count-up timer, e.g. a live "running for 12s" or
|
|
5
|
+
* "Sleeping for 3 seconds" indicator. Renders nothing while `since` is unset
|
|
6
|
+
* or unparseable.
|
|
7
|
+
*
|
|
8
|
+
* @element live-timer
|
|
9
|
+
*/
|
|
10
|
+
export declare class LiveTimer extends LitElement {
|
|
11
|
+
static styles: import("lit").CSSResult;
|
|
12
|
+
/** ISO-8601 start instant; elapsed time is measured from here. */
|
|
13
|
+
since: string | null;
|
|
14
|
+
/** `"seconds"` -> "1 second", "12 seconds"; `"compact"` -> "12s", "3m 12s", "1h 03m 12s". */
|
|
15
|
+
format: DurationFormat;
|
|
16
|
+
/** Text rendered before the formatted value. */
|
|
17
|
+
prefix: string;
|
|
18
|
+
/** Text rendered after the formatted value. */
|
|
19
|
+
suffix: string;
|
|
20
|
+
private _now;
|
|
21
|
+
private _timer;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
"live-timer": LiveTimer;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=live-timer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-timer.d.ts","sourceRoot":"","sources":["../src/live-timer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1E;;;;;;GAMG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,0BAIpB;IAEF,kEAAkE;IACtD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IACxC,6FAA6F;IACjF,MAAM,EAAE,cAAc,CAAa;IAC/C,gDAAgD;IAC3B,MAAM,SAAM;IACjC,+CAA+C;IACnC,MAAM,SAAM;IAEf,OAAO,CAAC,IAAI,CAAc;IAEnC,OAAO,CAAC,MAAM,CAA+C;IAEpD,iBAAiB,SAKzB;IAEQ,oBAAoB,SAI5B;IAEQ,MAAM,yCAMd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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, state } from "lit/decorators.js";
|
|
9
|
+
import { formatDuration } from "./utils/duration.js";
|
|
10
|
+
const TICK_INTERVAL_MS = 1000;
|
|
11
|
+
/**
|
|
12
|
+
* Per-second ticking count-up timer, e.g. a live "running for 12s" or
|
|
13
|
+
* "Sleeping for 3 seconds" indicator. Renders nothing while `since` is unset
|
|
14
|
+
* or unparseable.
|
|
15
|
+
*
|
|
16
|
+
* @element live-timer
|
|
17
|
+
*/
|
|
18
|
+
let LiveTimer = class LiveTimer extends LitElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/** ISO-8601 start instant; elapsed time is measured from here. */
|
|
22
|
+
this.since = null;
|
|
23
|
+
/** `"seconds"` -> "1 second", "12 seconds"; `"compact"` -> "12s", "3m 12s", "1h 03m 12s". */
|
|
24
|
+
this.format = "seconds";
|
|
25
|
+
/** Text rendered before the formatted value. */
|
|
26
|
+
this.prefix = "";
|
|
27
|
+
/** Text rendered after the formatted value. */
|
|
28
|
+
this.suffix = "";
|
|
29
|
+
this._now = Date.now();
|
|
30
|
+
this._timer = null;
|
|
31
|
+
}
|
|
32
|
+
static { this.styles = css `
|
|
33
|
+
:host {
|
|
34
|
+
display: inline;
|
|
35
|
+
}
|
|
36
|
+
`; }
|
|
37
|
+
connectedCallback() {
|
|
38
|
+
super.connectedCallback();
|
|
39
|
+
this._timer = setInterval(() => {
|
|
40
|
+
this._now = Date.now();
|
|
41
|
+
}, TICK_INTERVAL_MS);
|
|
42
|
+
}
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
super.disconnectedCallback();
|
|
45
|
+
if (this._timer != null)
|
|
46
|
+
clearInterval(this._timer);
|
|
47
|
+
this._timer = null;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
if (!this.since)
|
|
51
|
+
return html ``;
|
|
52
|
+
const start = Date.parse(this.since);
|
|
53
|
+
if (Number.isNaN(start))
|
|
54
|
+
return html ``;
|
|
55
|
+
const elapsed = Math.max(0, this._now - start);
|
|
56
|
+
return html `${this.prefix}${formatDuration(elapsed, this.format)}${this.suffix}`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__decorate([
|
|
60
|
+
property()
|
|
61
|
+
], LiveTimer.prototype, "since", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
property()
|
|
64
|
+
], LiveTimer.prototype, "format", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
property()
|
|
67
|
+
], LiveTimer.prototype, "prefix", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
property()
|
|
70
|
+
], LiveTimer.prototype, "suffix", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
state()
|
|
73
|
+
], LiveTimer.prototype, "_now", void 0);
|
|
74
|
+
LiveTimer = __decorate([
|
|
75
|
+
customElement("live-timer")
|
|
76
|
+
], LiveTimer);
|
|
77
|
+
export { LiveTimer };
|
|
78
|
+
//# sourceMappingURL=live-timer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-timer.js","sourceRoot":"","sources":["../src/live-timer.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAE1E,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;GAMG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAOL,kEAAkE;QACtD,UAAK,GAAkB,IAAI,CAAC;QACxC,6FAA6F;QACjF,WAAM,GAAmB,SAAS,CAAC;QAC/C,gDAAgD;QAC3B,WAAM,GAAG,EAAE,CAAC;QACjC,+CAA+C;QACnC,WAAM,GAAG,EAAE,CAAC;QAEP,SAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE3B,WAAM,GAA0C,IAAI,CAAC;IAsB/D,CAAC;aAvCiB,WAAM,GAAG,GAAG,CAAA;;;;GAI3B,AAJqB,CAIpB;IAeO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACvB,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI;YAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAEQ,MAAM;QACb,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACnF,CAAC;CACF,CAAA;AAhCa;IAAX,QAAQ,EAAE;wCAA6B;AAE5B;IAAX,QAAQ,EAAE;yCAAoC;AAE1B;IAApB,QAAQ,EAAE;yCAAsB;AAErB;IAAX,QAAQ,EAAE;yCAAa;AAEP;IAAhB,KAAK,EAAE;uCAA2B;AAhBxB,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAwCrB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\n\nconst TICK_INTERVAL_MS = 1000;\n\n/**\n * Per-second ticking count-up timer, e.g. a live \"running for 12s\" or\n * \"Sleeping for 3 seconds\" indicator. Renders nothing while `since` is unset\n * or unparseable.\n *\n * @element live-timer\n */\n@customElement(\"live-timer\")\nexport class LiveTimer extends LitElement {\n static override styles = css`\n :host {\n display: inline;\n }\n `;\n\n /** ISO-8601 start instant; elapsed time is measured from here. */\n @property() since: string | null = null;\n /** `\"seconds\"` -> \"1 second\", \"12 seconds\"; `\"compact\"` -> \"12s\", \"3m 12s\", \"1h 03m 12s\". */\n @property() format: DurationFormat = \"seconds\";\n /** Text rendered before the formatted value. */\n @property() override prefix = \"\";\n /** Text rendered after the formatted value. */\n @property() suffix = \"\";\n\n @state() private _now = Date.now();\n\n private _timer: ReturnType<typeof setInterval> | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._timer = setInterval(() => {\n this._now = Date.now();\n }, TICK_INTERVAL_MS);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (this._timer != null) clearInterval(this._timer);\n this._timer = null;\n }\n\n override render() {\n if (!this.since) return html``;\n const start = Date.parse(this.since);\n if (Number.isNaN(start)) return html``;\n const elapsed = Math.max(0, this._now - start);\n return html`${this.prefix}${formatDuration(elapsed, this.format)}${this.suffix}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"live-timer\": LiveTimer;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Stdio MCP server exposing the `@f-ewald/components` catalog to AI coding
|
|
4
|
+
* assistants (Claude Code, etc.) working in a consuming project.
|
|
5
|
+
*
|
|
6
|
+
* Two tools, backed by the same `custom-elements.json` and `docs/*.md` this
|
|
7
|
+
* package already generates and ships via `npm run docs`:
|
|
8
|
+
* - `list_components`: every tag name + one-line description.
|
|
9
|
+
* - `get_component_docs`: the full generated Markdown doc for one tag.
|
|
10
|
+
*
|
|
11
|
+
* No new data source — this is just a different transport over data that
|
|
12
|
+
* already exists. See `docs/mcp-evaluation.md` for the design rationale.
|
|
13
|
+
*/
|
|
14
|
+
import { readFile } from "node:fs/promises";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
18
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
|
+
import { z } from "zod";
|
|
20
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
// This file compiles to dist/mcp-server.js; custom-elements.json and docs/
|
|
22
|
+
// ship alongside dist/ at the package root, whether run from the repo
|
|
23
|
+
// checkout or from an installed node_modules/@f-ewald/components.
|
|
24
|
+
const packageRoot = path.join(__dirname, "..");
|
|
25
|
+
const docsDir = path.join(packageRoot, "docs");
|
|
26
|
+
/** Reads the package's own version out of package.json, for server metadata. */
|
|
27
|
+
async function readPackageVersion() {
|
|
28
|
+
const text = await readFile(path.join(packageRoot, "package.json"), "utf8");
|
|
29
|
+
return JSON.parse(text).version;
|
|
30
|
+
}
|
|
31
|
+
/** Extracts {tag, one-line summary} for every custom element, sorted by tag. */
|
|
32
|
+
async function listComponents() {
|
|
33
|
+
const text = await readFile(path.join(packageRoot, "custom-elements.json"), "utf8");
|
|
34
|
+
const manifest = JSON.parse(text);
|
|
35
|
+
const components = [];
|
|
36
|
+
for (const mod of manifest.modules) {
|
|
37
|
+
for (const decl of mod.declarations ?? []) {
|
|
38
|
+
if (!decl.customElement)
|
|
39
|
+
continue;
|
|
40
|
+
const summary = (decl.description ?? "").split("\n\n")[0].replace(/\n/g, " ").trim();
|
|
41
|
+
components.push({ tag: decl.tagName, summary });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
components.sort((a, b) => a.tag.localeCompare(b.tag));
|
|
45
|
+
return components;
|
|
46
|
+
}
|
|
47
|
+
const server = new McpServer({
|
|
48
|
+
name: "f-ewald-components",
|
|
49
|
+
version: await readPackageVersion(),
|
|
50
|
+
});
|
|
51
|
+
server.registerTool("list_components", {
|
|
52
|
+
title: "List components",
|
|
53
|
+
description: "Lists every web component tag in @f-ewald/components with a one-line " +
|
|
54
|
+
"description. Call get_component_docs(tag) for the full usage example, " +
|
|
55
|
+
"attributes/properties, events, slots, and CSS custom properties of a " +
|
|
56
|
+
"specific tag.",
|
|
57
|
+
}, async () => ({
|
|
58
|
+
content: [{ type: "text", text: JSON.stringify(await listComponents(), null, 2) }],
|
|
59
|
+
}));
|
|
60
|
+
server.registerTool("get_component_docs", {
|
|
61
|
+
title: "Get component docs",
|
|
62
|
+
description: "Returns the full generated Markdown documentation (install snippet, " +
|
|
63
|
+
"usage example, attributes/properties, events, slots, CSS custom " +
|
|
64
|
+
"properties) for one @f-ewald/components tag. Use list_components " +
|
|
65
|
+
"first to find valid tags.",
|
|
66
|
+
inputSchema: { tag: z.string().describe('Component tag name, e.g. "ui-button".') },
|
|
67
|
+
}, async ({ tag }) => {
|
|
68
|
+
try {
|
|
69
|
+
const text = await readFile(path.join(docsDir, `${tag}.md`), "utf8");
|
|
70
|
+
return { content: [{ type: "text", text }] };
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
const validTags = (await listComponents()).map((c) => c.tag).join(", ");
|
|
74
|
+
return {
|
|
75
|
+
content: [{ type: "text", text: `No docs found for tag "${tag}". Valid tags: ${validTags}` }],
|
|
76
|
+
isError: true,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
const transport = new StdioServerTransport();
|
|
81
|
+
await server.connect(transport);
|
|
82
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,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E,GAAG,GAAG,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QACrE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,SAAS,GAAG,CAAC,MAAM,cAAc,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,kBAAkB,SAAS,EAAE,EAAE,CAAC;YAC7F,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n/**\n * Stdio MCP server exposing the `@f-ewald/components` catalog to AI coding\n * assistants (Claude Code, etc.) working in a consuming project.\n *\n * Two tools, backed by the same `custom-elements.json` and `docs/*.md` this\n * package already generates and ships via `npm run docs`:\n * - `list_components`: every tag name + one-line description.\n * - `get_component_docs`: the full generated Markdown doc for one tag.\n *\n * No new data source — this is just a different transport over data that\n * already exists. See `docs/mcp-evaluation.md` for the design rationale.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport path from \"node:path\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { z } from \"zod\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n// This file compiles to dist/mcp-server.js; custom-elements.json and docs/\n// ship alongside dist/ at the package root, whether run from the repo\n// checkout or from an installed node_modules/@f-ewald/components.\nconst packageRoot = path.join(__dirname, \"..\");\nconst docsDir = path.join(packageRoot, \"docs\");\n\n/** One row of the `list_components` result. */\ninterface ComponentSummary {\n tag: string;\n summary: string;\n}\n\n/** Reads the package's own version out of package.json, for server metadata. */\nasync function readPackageVersion(): Promise<string> {\n const text = await readFile(path.join(packageRoot, \"package.json\"), \"utf8\");\n return (JSON.parse(text) as { version: string }).version;\n}\n\n/** Extracts {tag, one-line summary} for every custom element, sorted by tag. */\nasync function listComponents(): Promise<ComponentSummary[]> {\n const text = await readFile(path.join(packageRoot, \"custom-elements.json\"), \"utf8\");\n const manifest = JSON.parse(text) as {\n modules: { declarations?: { customElement?: boolean; tagName: string; description?: string }[] }[];\n };\n const components: ComponentSummary[] = [];\n for (const mod of manifest.modules) {\n for (const decl of mod.declarations ?? []) {\n if (!decl.customElement) continue;\n const summary = (decl.description ?? \"\").split(\"\\n\\n\")[0]!.replace(/\\n/g, \" \").trim();\n components.push({ tag: decl.tagName, summary });\n }\n }\n components.sort((a, b) => a.tag.localeCompare(b.tag));\n return components;\n}\n\nconst server = new McpServer({\n name: \"f-ewald-components\",\n version: await readPackageVersion(),\n});\n\nserver.registerTool(\n \"list_components\",\n {\n title: \"List components\",\n description:\n \"Lists every web component tag in @f-ewald/components with a one-line \" +\n \"description. Call get_component_docs(tag) for the full usage example, \" +\n \"attributes/properties, events, slots, and CSS custom properties of a \" +\n \"specific tag.\",\n },\n async () => ({\n content: [{ type: \"text\", text: JSON.stringify(await listComponents(), null, 2) }],\n }),\n);\n\nserver.registerTool(\n \"get_component_docs\",\n {\n title: \"Get component docs\",\n description:\n \"Returns the full generated Markdown documentation (install snippet, \" +\n \"usage example, attributes/properties, events, slots, CSS custom \" +\n \"properties) for one @f-ewald/components tag. Use list_components \" +\n \"first to find valid tags.\",\n inputSchema: { tag: z.string().describe('Component tag name, e.g. \"ui-button\".') },\n },\n async ({ tag }) => {\n try {\n const text = await readFile(path.join(docsDir, `${tag}.md`), \"utf8\");\n return { content: [{ type: \"text\", text }] };\n } catch {\n const validTags = (await listComponents()).map((c) => c.tag).join(\", \");\n return {\n content: [{ type: \"text\", text: `No docs found for tag \"${tag}\". Valid tags: ${validTags}` }],\n isError: true,\n };\n }\n },\n);\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
+
import { GalleryItem } from "./gallery-item.js";
|
|
3
|
+
export type PhotoGalleryObjectFit = "cover" | "contain";
|
|
4
|
+
export type PhotoGalleryChangeReason = "autoplay" | "indicator" | "items" | "keyboard" | "next" | "previous" | "programmatic" | "swipe";
|
|
5
|
+
export interface PhotoGallerySlideChangeDetail {
|
|
6
|
+
previousIndex: number;
|
|
7
|
+
currentIndex: number;
|
|
8
|
+
item: GalleryItem;
|
|
9
|
+
reason: PhotoGalleryChangeReason;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Responsive, accessible image carousel composed from declarative
|
|
13
|
+
* `gallery-item` children.
|
|
14
|
+
*
|
|
15
|
+
* @element photo-gallery
|
|
16
|
+
* @slot - `gallery-item` elements rendered as slides.
|
|
17
|
+
* @fires slide-change - The active image changed.
|
|
18
|
+
*/
|
|
19
|
+
export declare class PhotoGallery extends LitElement {
|
|
20
|
+
/** Zero-based active image index. */
|
|
21
|
+
currentIndex: number;
|
|
22
|
+
/** Autoplay interval in milliseconds. Set to zero to disable autoplay. */
|
|
23
|
+
delay: number;
|
|
24
|
+
/** Whether previous and next buttons are shown. */
|
|
25
|
+
showControls: boolean;
|
|
26
|
+
/** Whether a current/total counter is shown. */
|
|
27
|
+
showCounter: boolean;
|
|
28
|
+
/** Whether clickable slide indicators are shown. */
|
|
29
|
+
showIndicators: boolean;
|
|
30
|
+
/** Whether autoplay includes a built-in pause/play control. */
|
|
31
|
+
showAutoplayControl: boolean;
|
|
32
|
+
/** Whether autoplay is explicitly paused. */
|
|
33
|
+
paused: boolean;
|
|
34
|
+
/** CSS aspect ratio used by the image viewport. */
|
|
35
|
+
aspectRatio: string;
|
|
36
|
+
/** How images fit within the stable viewport. */
|
|
37
|
+
objectFit: PhotoGalleryObjectFit;
|
|
38
|
+
private readonly _galleryItems;
|
|
39
|
+
private _previousIndex;
|
|
40
|
+
private _itemsVersion;
|
|
41
|
+
private _autoplayTimer?;
|
|
42
|
+
private _transitionTimer?;
|
|
43
|
+
private _metadataObserver?;
|
|
44
|
+
private _hovered;
|
|
45
|
+
private _focusWithin;
|
|
46
|
+
private _nextChangeReason;
|
|
47
|
+
private _pendingChange?;
|
|
48
|
+
private _pointerStart?;
|
|
49
|
+
private _itemsChanged;
|
|
50
|
+
private _activeItem?;
|
|
51
|
+
private _renderedIndex;
|
|
52
|
+
static styles: import("lit").CSSResult[];
|
|
53
|
+
/** Starts observers and autoplay integration when the element connects. */
|
|
54
|
+
connectedCallback(): void;
|
|
55
|
+
/** Releases timers and observers when the element disconnects. */
|
|
56
|
+
disconnectedCallback(): void;
|
|
57
|
+
/** Normalizes external index changes before rendering. */
|
|
58
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
59
|
+
/** Emits completed changes and keeps autoplay synchronized with properties. */
|
|
60
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
61
|
+
/** Wraps any requested index into the current item range. */
|
|
62
|
+
private _normalizeIndex;
|
|
63
|
+
/** Returns responsive variants declared directly under an item. */
|
|
64
|
+
private _variantsFor;
|
|
65
|
+
/** Changes slides through the shared state and event path. */
|
|
66
|
+
private _goTo;
|
|
67
|
+
/** Moves to the previous image. */
|
|
68
|
+
private _showPrevious;
|
|
69
|
+
/** Moves to the next image. */
|
|
70
|
+
private _showNext;
|
|
71
|
+
/** Toggles explicit autoplay pause state. */
|
|
72
|
+
private _togglePaused;
|
|
73
|
+
/** Clears and conditionally schedules the next autoplay advance. */
|
|
74
|
+
private _restartAutoplay;
|
|
75
|
+
/** Reports whether autoplay may currently schedule a transition. */
|
|
76
|
+
private _canAutoplay;
|
|
77
|
+
/** Clears the pending autoplay timeout. */
|
|
78
|
+
private _clearAutoplay;
|
|
79
|
+
/** Removes the outgoing crossfade layer after the animation completes. */
|
|
80
|
+
private _scheduleTransitionCleanup;
|
|
81
|
+
/** Clears pending transition cleanup. */
|
|
82
|
+
private _clearTransition;
|
|
83
|
+
/** Refreshes item metadata and clamps the active index after light-DOM changes. */
|
|
84
|
+
private _handleMetadataChange;
|
|
85
|
+
/** Refreshes item state after the default slot changes. */
|
|
86
|
+
private _handleSlotChange;
|
|
87
|
+
/** Temporarily pauses autoplay while the pointer is over the gallery. */
|
|
88
|
+
private _handleMouseEnter;
|
|
89
|
+
/** Resumes autoplay with a fresh delay after hover ends. */
|
|
90
|
+
private _handleMouseLeave;
|
|
91
|
+
/** Temporarily pauses autoplay while focus is inside the gallery. */
|
|
92
|
+
private _handleFocusIn;
|
|
93
|
+
/** Resumes autoplay with a fresh delay after focus leaves the gallery. */
|
|
94
|
+
private _handleFocusOut;
|
|
95
|
+
/** Pauses or resumes scheduling when page visibility changes. */
|
|
96
|
+
private readonly _handleVisibilityChange;
|
|
97
|
+
/** Handles Left and Right arrow keyboard navigation. */
|
|
98
|
+
private _handleKeyDown;
|
|
99
|
+
/** Records the starting point of a primary pointer gesture. */
|
|
100
|
+
private _handlePointerDown;
|
|
101
|
+
/** Converts a sufficiently horizontal pointer gesture into navigation. */
|
|
102
|
+
private _handlePointerUp;
|
|
103
|
+
/** Cancels an incomplete pointer gesture. */
|
|
104
|
+
private _handlePointerCancel;
|
|
105
|
+
/** Renders one responsive image layer for the crossfade stack. */
|
|
106
|
+
private _renderPicture;
|
|
107
|
+
/** Renders enabled counter, indicator, and autoplay controls. */
|
|
108
|
+
private _renderFooter;
|
|
109
|
+
/** Renders the active image, navigation, caption, and hidden metadata slot. */
|
|
110
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
111
|
+
}
|
|
112
|
+
declare global {
|
|
113
|
+
interface HTMLElementTagNameMap {
|
|
114
|
+
"photo-gallery": PhotoGallery;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=photo-gallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo-gallery.d.ts","sourceRoot":"","sources":["../src/photo-gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,SAAS,CAAC;AACxD,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,MAAM,GACN,UAAU,GACV,cAAc,GACd,OAAO,CAAC;AAEZ,MAAM,WAAW,6BAA6B;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,wBAAwB,CAAC;CAClC;AAUD;;;;;;;GAOG;AACH,qBACa,YAAa,SAAQ,UAAU;IAC1C,qCAAqC;IAErC,YAAY,SAAK;IAEjB,0EAA0E;IAC9C,KAAK,SAAK;IAEtC,mDAAmD;IAEnD,YAAY,UAAQ;IAEpB,gDAAgD;IAEhD,WAAW,UAAS;IAEpB,oDAAoD;IAEpD,cAAc,UAAS;IAEvB,+DAA+D;IAE/D,mBAAmB,UAAQ;IAE3B,6CAA6C;IAE7C,MAAM,UAAS;IAEf,mDAAmD;IAEnD,WAAW,SAAY;IAEvB,iDAAiD;IAEjD,SAAS,EAAE,qBAAqB,CAAW;IAG3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAG/C,OAAO,CAAC,cAAc,CAAuB;IAG7C,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,C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