@f-ewald/components 1.7.0 → 1.9.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 +2 -0
- package/custom-elements.json +285 -1
- package/dist/card-grid.d.ts +19 -0
- package/dist/card-grid.d.ts.map +1 -0
- package/dist/card-grid.js +44 -0
- package/dist/card-grid.js.map +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +2 -0
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/link-card.d.ts +34 -0
- package/dist/link-card.d.ts.map +1 -0
- package/dist/link-card.js +197 -0
- package/dist/link-card.js.map +1 -0
- package/dist/stat-meter.d.ts +2 -0
- package/dist/stat-meter.d.ts.map +1 -1
- package/dist/stat-meter.js +8 -2
- package/dist/stat-meter.js.map +1 -1
- package/dist/text-area.d.ts.map +1 -1
- package/dist/text-area.js +7 -0
- package/dist/text-area.js.map +1 -1
- package/dist/timeline-entry.d.ts +9 -0
- package/dist/timeline-entry.d.ts.map +1 -1
- package/dist/timeline-entry.js +23 -0
- package/dist/timeline-entry.js.map +1 -1
- package/docs/card-grid.md +44 -0
- package/docs/link-card.md +65 -0
- package/docs/stat-meter.md +1 -0
- package/docs/timeline-entry.md +5 -0
- package/llms.txt +58 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export { KanbanBoard, type KanbanCardData, type KanbanColumnData, type KanbanCar
|
|
|
52
52
|
export { KanbanColumn } from "./kanban-column.js";
|
|
53
53
|
export { KanbanCard } from "./kanban-card.js";
|
|
54
54
|
export { TextArea } from "./text-area.js";
|
|
55
|
+
export { LinkCard, type LinkCardStatus } from "./link-card.js";
|
|
56
|
+
export { CardGrid } from "./card-grid.js";
|
|
55
57
|
export { formatDuration, type DurationFormat } from "./utils/duration.js";
|
|
56
58
|
export { tokens, tokenValues, darkTokenValues } from "./tokens.js";
|
|
57
59
|
export * from "./icons.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,EACZ,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,GACnC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,YAAY,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,E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AAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,8 @@ export { KanbanBoard, } from "./kanban-board.js";
|
|
|
52
52
|
export { KanbanColumn } from "./kanban-column.js";
|
|
53
53
|
export { KanbanCard } from "./kanban-card.js";
|
|
54
54
|
export { TextArea } from "./text-area.js";
|
|
55
|
+
export { LinkCard } from "./link-card.js";
|
|
56
|
+
export { CardGrid } from "./card-grid.js";
|
|
55
57
|
export { formatDuration } from "./utils/duration.js";
|
|
56
58
|
export { tokens, tokenValues, darkTokenValues } from "./tokens.js";
|
|
57
59
|
export * from "./icons.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B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B,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAA4B,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAyB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,WAAW,GAKZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,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 { ContentDivider } from \"./content-divider.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 { 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 {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-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 { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,YAAY,GAIb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EAC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AQ,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 { ContentDivider } from \"./content-divider.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 { 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 {\n MultiSelect,\n type MultiSelectOption,\n type MultiSelectVariant,\n} from \"./multi-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 { KbdHint, type KbdPlatform } from \"./kbd-hint.js\";\nexport { FrameBox } from \"./frame-box.js\";\nexport { AppShell, type SidebarToggleDetail } from \"./app-shell.js\";\nexport { AppSidebar } from \"./app-sidebar.js\";\nexport { ActionBar } from \"./action-bar.js\";\nexport { PageHeader } from \"./page-header.js\";\nexport { PaginationNav, type PageChangeDetail } from \"./pagination-nav.js\";\nexport { FormActions } from \"./form-actions.js\";\nexport { TimelineContainer } from \"./timeline-container.js\";\nexport { TimelineEntry } from \"./timeline-entry.js\";\nexport { CalendarEntry } from \"./calendar-entry.js\";\nexport { CalendarMonth } from \"./calendar-month.js\";\nexport { CalendarYear } from \"./calendar-year.js\";\nexport {\n KanbanBoard,\n type KanbanCardData,\n type KanbanColumnData,\n type KanbanCardMoveDetail,\n type KanbanCardOpenDetail,\n} from \"./kanban-board.js\";\nexport { KanbanColumn } from \"./kanban-column.js\";\nexport { KanbanCard } from \"./kanban-card.js\";\nexport { TextArea } from \"./text-area.js\";\nexport { LinkCard, type LinkCardStatus } from \"./link-card.js\";\nexport { CardGrid } from \"./card-grid.js\";\nexport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\nexport { tokens, tokenValues, darkTokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/** Reachability state for the optional corner status dot. `""` renders no dot. */
|
|
3
|
+
export type LinkCardStatus = "up" | "down" | "checking" | "";
|
|
4
|
+
/**
|
|
5
|
+
* A single linked-resource tile — logo (or an initial-letter fallback),
|
|
6
|
+
* heading, optional description, and an optional reachability status dot.
|
|
7
|
+
* Renders as a real `<a>` (opening in a new tab) when `href` is set, or a
|
|
8
|
+
* non-interactive `<div>` otherwise. Meant to be laid out inside
|
|
9
|
+
* `card-grid`, mirroring how `gallery-item` pairs with `photo-gallery`.
|
|
10
|
+
*
|
|
11
|
+
* @element link-card
|
|
12
|
+
*/
|
|
13
|
+
export declare class LinkCard extends LitElement {
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
/** Card title. */
|
|
16
|
+
heading: string;
|
|
17
|
+
/** Optional supporting text shown below the heading. */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Destination URL. When set, the card renders as a link (opened in a new tab); when unset, a non-interactive tile. */
|
|
20
|
+
href: string;
|
|
21
|
+
/** Logo image URL. Falls back to the first letter of `heading` if unset or it fails to load. */
|
|
22
|
+
logo: string;
|
|
23
|
+
/** Reachability state for the corner status dot. `""` (default) renders no dot. */
|
|
24
|
+
status: LinkCardStatus;
|
|
25
|
+
private _imgError;
|
|
26
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
27
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
"link-card": LinkCard;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=link-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-card.d.ts","sourceRoot":"","sources":["../src/link-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,kFAAkF;AAClF,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,EAAE,CAAC;AAQ7D;;;;;;;;GAQG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,OAAgB,MAAM,4BA0GpB;IAEF,kBAAkB;IACN,OAAO,SAAM;IACzB,wDAAwD;IAC5C,WAAW,SAAM;IAC7B,uHAAuH;IAC3G,IAAI,SAAM;IACtB,gGAAgG;IACpF,IAAI,SAAM;IACtB,mFAAmF;IACvE,MAAM,EAAE,cAAc,CAAM;IAE/B,OAAO,CAAC,SAAS,CAAS;IAEnC,UAAmB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,QAE1D;IAEQ,MAAM,yCAuBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,197 @@
|
|
|
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, state } from "lit/decorators.js";
|
|
9
|
+
import { tokens } from "./tokens.js";
|
|
10
|
+
const STATUS_LABEL = {
|
|
11
|
+
up: "Reachable",
|
|
12
|
+
down: "Unreachable",
|
|
13
|
+
checking: "Checking…",
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A single linked-resource tile — logo (or an initial-letter fallback),
|
|
17
|
+
* heading, optional description, and an optional reachability status dot.
|
|
18
|
+
* Renders as a real `<a>` (opening in a new tab) when `href` is set, or a
|
|
19
|
+
* non-interactive `<div>` otherwise. Meant to be laid out inside
|
|
20
|
+
* `card-grid`, mirroring how `gallery-item` pairs with `photo-gallery`.
|
|
21
|
+
*
|
|
22
|
+
* @element link-card
|
|
23
|
+
*/
|
|
24
|
+
let LinkCard = class LinkCard extends LitElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
/** Card title. */
|
|
28
|
+
this.heading = "";
|
|
29
|
+
/** Optional supporting text shown below the heading. */
|
|
30
|
+
this.description = "";
|
|
31
|
+
/** Destination URL. When set, the card renders as a link (opened in a new tab); when unset, a non-interactive tile. */
|
|
32
|
+
this.href = "";
|
|
33
|
+
/** Logo image URL. Falls back to the first letter of `heading` if unset or it fails to load. */
|
|
34
|
+
this.logo = "";
|
|
35
|
+
/** Reachability state for the corner status dot. `""` (default) renders no dot. */
|
|
36
|
+
this.status = "";
|
|
37
|
+
this._imgError = false;
|
|
38
|
+
}
|
|
39
|
+
static { this.styles = [
|
|
40
|
+
tokens,
|
|
41
|
+
css `
|
|
42
|
+
:host {
|
|
43
|
+
display: block;
|
|
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
|
+
.card {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: 0.75rem;
|
|
60
|
+
height: 100%;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
padding: 1.5rem;
|
|
63
|
+
border: 1px solid var(--ui-border, #e2e8f0);
|
|
64
|
+
border-radius: var(--ui-radius, 0.5rem);
|
|
65
|
+
background: var(--ui-surface, #ffffff);
|
|
66
|
+
color: inherit;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
transition:
|
|
69
|
+
border-color 150ms ease,
|
|
70
|
+
box-shadow 150ms ease,
|
|
71
|
+
transform 150ms ease;
|
|
72
|
+
}
|
|
73
|
+
a.card {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
.card:hover {
|
|
77
|
+
border-color: var(--ui-text-muted, #64748b);
|
|
78
|
+
box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));
|
|
79
|
+
transform: translateY(-0.0625rem);
|
|
80
|
+
}
|
|
81
|
+
.card:focus-visible {
|
|
82
|
+
outline: none;
|
|
83
|
+
box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
|
|
84
|
+
}
|
|
85
|
+
.status {
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 1.25rem;
|
|
88
|
+
right: 1.25rem;
|
|
89
|
+
width: 0.5rem;
|
|
90
|
+
height: 0.5rem;
|
|
91
|
+
border-radius: 9999px;
|
|
92
|
+
background: var(--ui-text-muted, #64748b);
|
|
93
|
+
}
|
|
94
|
+
.status--up {
|
|
95
|
+
background: var(--ui-success, #16a34a);
|
|
96
|
+
}
|
|
97
|
+
.status--down {
|
|
98
|
+
background: var(--ui-danger, #dc2626);
|
|
99
|
+
}
|
|
100
|
+
.logo {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex: 0 0 auto;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
width: 2.5rem;
|
|
106
|
+
height: 2.5rem;
|
|
107
|
+
border-radius: var(--ui-radius, 0.5rem);
|
|
108
|
+
background: var(--ui-surface-muted, #f8fafc);
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
.logo img {
|
|
112
|
+
width: 100%;
|
|
113
|
+
height: 100%;
|
|
114
|
+
object-fit: contain;
|
|
115
|
+
}
|
|
116
|
+
.initial {
|
|
117
|
+
font-size: var(--ui-font-size-lg, 1rem);
|
|
118
|
+
font-weight: var(--ui-font-weight-semibold, 600);
|
|
119
|
+
color: var(--ui-text-muted, #64748b);
|
|
120
|
+
}
|
|
121
|
+
.heading {
|
|
122
|
+
font-size: var(--ui-font-size-lg, 1rem);
|
|
123
|
+
font-weight: var(--ui-font-weight-semibold, 600);
|
|
124
|
+
line-height: var(--ui-line-height-tight, 1.25);
|
|
125
|
+
color: var(--ui-text, #0f172a);
|
|
126
|
+
}
|
|
127
|
+
.description {
|
|
128
|
+
font-size: var(--ui-font-size, 0.875rem);
|
|
129
|
+
line-height: var(--ui-line-height-normal, 1.5);
|
|
130
|
+
color: var(--ui-text-muted, #64748b);
|
|
131
|
+
}
|
|
132
|
+
@media (forced-colors: active) {
|
|
133
|
+
.card:focus-visible {
|
|
134
|
+
outline: 2px solid CanvasText;
|
|
135
|
+
outline-offset: 2px;
|
|
136
|
+
box-shadow: none;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
@media (prefers-reduced-motion: reduce) {
|
|
140
|
+
.card {
|
|
141
|
+
transition: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`,
|
|
145
|
+
]; }
|
|
146
|
+
willUpdate(changed) {
|
|
147
|
+
if (changed.has("logo"))
|
|
148
|
+
this._imgError = false;
|
|
149
|
+
}
|
|
150
|
+
render() {
|
|
151
|
+
const showImage = !!this.logo && !this._imgError;
|
|
152
|
+
const initial = this.heading.trim().charAt(0).toUpperCase();
|
|
153
|
+
const body = html `
|
|
154
|
+
${this.status
|
|
155
|
+
? html `<span
|
|
156
|
+
class="status status--${this.status}"
|
|
157
|
+
role="img"
|
|
158
|
+
title=${STATUS_LABEL[this.status]}
|
|
159
|
+
aria-label=${STATUS_LABEL[this.status]}
|
|
160
|
+
></span>`
|
|
161
|
+
: nothing}
|
|
162
|
+
<span class="logo">
|
|
163
|
+
${showImage
|
|
164
|
+
? html `<img src=${this.logo} alt="" @error=${() => (this._imgError = true)} />`
|
|
165
|
+
: html `<span class="initial" aria-hidden="true">${initial}</span>`}
|
|
166
|
+
</span>
|
|
167
|
+
<span class="heading">${this.heading}</span>
|
|
168
|
+
${this.description ? html `<span class="description">${this.description}</span>` : nothing}
|
|
169
|
+
`;
|
|
170
|
+
return this.href
|
|
171
|
+
? html `<a class="card" href=${this.href} target="_blank" rel="noopener noreferrer">${body}</a>`
|
|
172
|
+
: html `<div class="card">${body}</div>`;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
__decorate([
|
|
176
|
+
property()
|
|
177
|
+
], LinkCard.prototype, "heading", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
property()
|
|
180
|
+
], LinkCard.prototype, "description", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
property()
|
|
183
|
+
], LinkCard.prototype, "href", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
property()
|
|
186
|
+
], LinkCard.prototype, "logo", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property()
|
|
189
|
+
], LinkCard.prototype, "status", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
state()
|
|
192
|
+
], LinkCard.prototype, "_imgError", void 0);
|
|
193
|
+
LinkCard = __decorate([
|
|
194
|
+
customElement("link-card")
|
|
195
|
+
], LinkCard);
|
|
196
|
+
export { LinkCard };
|
|
197
|
+
//# sourceMappingURL=link-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-card.js","sourceRoot":"","sources":["../src/link-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,E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AC,MAAM,CAAC;mBAC/B;YACX,CAAC,CAAC,OAAO;;UAEP,SAAS;YACT,CAAC,CAAC,IAAI,CAAA,YAAY,IAAI,CAAC,IAAI,kBAAkB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK;YAC/E,CAAC,CAAC,IAAI,CAAA,4CAA4C,OAAO,SAAS;;8BAE9C,IAAI,CAAC,OAAO;QAClC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA,6BAA6B,IAAI,CAAC,WAAW,SAAS,CAAC,CAAC,CAAC,OAAO;KAC1F,CAAC;QACF,OAAO,IAAI,CAAC,IAAI;YACd,CAAC,CAAC,IAAI,CAAA,wBAAwB,IAAI,CAAC,IAAI,8CAA8C,IAAI,MAAM;YAC/F,CAAC,CAAC,IAAI,CAAA,qBAAqB,IAAI,QAAQ,CAAC;IAC5C,CAAC;CACF,CAAA;AAxCa;IAAX,QAAQ,EAAE;yCAAc;AAEb;IAAX,QAAQ,EAAE;6CAAkB;AAEjB;IAAX,QAAQ,EAAE;sCAAW;AAEV;IAAX,QAAQ,EAAE;sCAAW;AAEV;IAAX,QAAQ,EAAE;wCAA6B;AAEvB;IAAhB,KAAK,EAAE;2CAA2B;AAxHxB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAsJpB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** Reachability state for the optional corner status dot. `\"\"` renders no dot. */\nexport type LinkCardStatus = \"up\" | \"down\" | \"checking\" | \"\";\n\nconst STATUS_LABEL: Record<Exclude<LinkCardStatus, \"\">, string> = {\n up: \"Reachable\",\n down: \"Unreachable\",\n checking: \"Checking…\",\n};\n\n/**\n * A single linked-resource tile — logo (or an initial-letter fallback),\n * heading, optional description, and an optional reachability status dot.\n * Renders as a real `<a>` (opening in a new tab) when `href` is set, or a\n * non-interactive `<div>` otherwise. Meant to be laid out inside\n * `card-grid`, mirroring how `gallery-item` pairs with `photo-gallery`.\n *\n * @element link-card\n */\n@customElement(\"link-card\")\nexport class LinkCard 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 .card {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n height: 100%;\n box-sizing: border-box;\n padding: 1.5rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-surface, #ffffff);\n color: inherit;\n text-decoration: none;\n transition:\n border-color 150ms ease,\n box-shadow 150ms ease,\n transform 150ms ease;\n }\n a.card {\n cursor: pointer;\n }\n .card:hover {\n border-color: var(--ui-text-muted, #64748b);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n transform: translateY(-0.0625rem);\n }\n .card:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .status {\n position: absolute;\n top: 1.25rem;\n right: 1.25rem;\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 9999px;\n background: var(--ui-text-muted, #64748b);\n }\n .status--up {\n background: var(--ui-success, #16a34a);\n }\n .status--down {\n background: var(--ui-danger, #dc2626);\n }\n .logo {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-surface-muted, #f8fafc);\n overflow: hidden;\n }\n .logo img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n .initial {\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n color: var(--ui-text-muted, #64748b);\n }\n .heading {\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .description {\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text-muted, #64748b);\n }\n @media (forced-colors: active) {\n .card:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .card {\n transition: none;\n }\n }\n `,\n ];\n\n /** Card title. */\n @property() heading = \"\";\n /** Optional supporting text shown below the heading. */\n @property() description = \"\";\n /** Destination URL. When set, the card renders as a link (opened in a new tab); when unset, a non-interactive tile. */\n @property() href = \"\";\n /** Logo image URL. Falls back to the first letter of `heading` if unset or it fails to load. */\n @property() logo = \"\";\n /** Reachability state for the corner status dot. `\"\"` (default) renders no dot. */\n @property() status: LinkCardStatus = \"\";\n\n @state() private _imgError = false;\n\n protected override willUpdate(changed: Map<string, unknown>) {\n if (changed.has(\"logo\")) this._imgError = false;\n }\n\n override render() {\n const showImage = !!this.logo && !this._imgError;\n const initial = this.heading.trim().charAt(0).toUpperCase();\n const body = html`\n ${this.status\n ? html`<span\n class=\"status status--${this.status}\"\n role=\"img\"\n title=${STATUS_LABEL[this.status]}\n aria-label=${STATUS_LABEL[this.status]}\n ></span>`\n : nothing}\n <span class=\"logo\">\n ${showImage\n ? html`<img src=${this.logo} alt=\"\" @error=${() => (this._imgError = true)} />`\n : html`<span class=\"initial\" aria-hidden=\"true\">${initial}</span>`}\n </span>\n <span class=\"heading\">${this.heading}</span>\n ${this.description ? html`<span class=\"description\">${this.description}</span>` : nothing}\n `;\n return this.href\n ? html`<a class=\"card\" href=${this.href} target=\"_blank\" rel=\"noopener noreferrer\">${body}</a>`\n : html`<div class=\"card\">${body}</div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"link-card\": LinkCard;\n }\n}\n"]}
|
package/dist/stat-meter.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export declare class StatMeter extends LitElement {
|
|
|
15
15
|
percent: number | null;
|
|
16
16
|
/** Fill color override; falls back to the `--ui-success` token. */
|
|
17
17
|
color: string;
|
|
18
|
+
/** Track (inactive portion) background override; falls back to the `--ui-surface-muted` token. */
|
|
19
|
+
trackColor: string;
|
|
18
20
|
render(): import("lit-html").TemplateResult<1>;
|
|
19
21
|
}
|
|
20
22
|
declare global {
|
package/dist/stat-meter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-meter.d.ts","sourceRoot":"","sources":["../src/stat-meter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;;;;GAOG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA6DpB;IAEF,6DAA6D;IACjD,KAAK,SAAM;IAEvB,qFAAqF;IACzD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1D,mEAAmE;IACvD,KAAK,SAAM;
|
|
1
|
+
{"version":3,"file":"stat-meter.d.ts","sourceRoot":"","sources":["../src/stat-meter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;;;;GAOG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA6DpB;IAEF,6DAA6D;IACjD,KAAK,SAAM;IAEvB,qFAAqF;IACzD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1D,mEAAmE;IACvD,KAAK,SAAM;IAEvB,kGAAkG;IAC1D,UAAU,SAAM;IAE/C,MAAM,yCAYd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
package/dist/stat-meter.js
CHANGED
|
@@ -24,6 +24,8 @@ let StatMeter = class StatMeter extends LitElement {
|
|
|
24
24
|
this.percent = null;
|
|
25
25
|
/** Fill color override; falls back to the `--ui-success` token. */
|
|
26
26
|
this.color = "";
|
|
27
|
+
/** Track (inactive portion) background override; falls back to the `--ui-surface-muted` token. */
|
|
28
|
+
this.trackColor = "";
|
|
27
29
|
}
|
|
28
30
|
static { this.styles = [
|
|
29
31
|
tokens,
|
|
@@ -56,7 +58,7 @@ let StatMeter = class StatMeter extends LitElement {
|
|
|
56
58
|
width: 4rem;
|
|
57
59
|
height: 0.375rem;
|
|
58
60
|
border-radius: 9999px;
|
|
59
|
-
background: var(--ui-surface-muted, #f8fafc);
|
|
61
|
+
background: var(--track-color, var(--ui-surface-muted, #f8fafc));
|
|
60
62
|
overflow: hidden;
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -91,9 +93,10 @@ let StatMeter = class StatMeter extends LitElement {
|
|
|
91
93
|
const pct = this.percent;
|
|
92
94
|
const clamped = pct === null ? 0 : Math.min(100, Math.max(0, pct));
|
|
93
95
|
const fillStyle = this.color ? `width: ${clamped}%; --fill-color: ${this.color}` : `width: ${clamped}%`;
|
|
96
|
+
const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : "";
|
|
94
97
|
return html `
|
|
95
98
|
<span class="label">${this.label}</span>
|
|
96
|
-
<span class="track" role="img" aria-label="${this.label} ${pct === null ? "no reading" : `${pct}%`}">
|
|
99
|
+
<span class="track" role="img" style=${trackStyle} aria-label="${this.label} ${pct === null ? "no reading" : `${pct}%`}">
|
|
97
100
|
<span class="fill" style=${fillStyle}></span>
|
|
98
101
|
</span>
|
|
99
102
|
<span class="value">${pct === null ? "—" : `${pct}%`}</span>
|
|
@@ -109,6 +112,9 @@ __decorate([
|
|
|
109
112
|
__decorate([
|
|
110
113
|
property()
|
|
111
114
|
], StatMeter.prototype, "color", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ attribute: "track-color" })
|
|
117
|
+
], StatMeter.prototype, "trackColor", void 0);
|
|
112
118
|
StatMeter = __decorate([
|
|
113
119
|
customElement("stat-meter")
|
|
114
120
|
], StatMeter);
|
package/dist/stat-meter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-meter.js","sourceRoot":"","sources":["../src/stat-meter.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,aAAa,CAAC;AAErC;;;;;;;GAOG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAgEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QAEvB,qFAAqF;QACzD,YAAO,GAAkB,IAAI,CAAC;QAE1D,mEAAmE;QACvD,UAAK,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"stat-meter.js","sourceRoot":"","sources":["../src/stat-meter.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,aAAa,CAAC;AAErC;;;;;;;GAOG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAgEL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QAEvB,qFAAqF;QACzD,YAAO,GAAkB,IAAI,CAAC;QAE1D,mEAAmE;QACvD,UAAK,GAAG,EAAE,CAAC;QAEvB,kGAAkG;QAC1D,eAAU,GAAG,EAAE,CAAC;IAe1D,CAAC;aAxFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;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\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A compact labeled meter for a single percentage reading — e.g. CPU or\n * memory usage in a dashboard header. `percent` may be `null` when no\n * reading is available yet (e.g. the first tick of a polling metric); the\n * bar then renders empty and the value shows an em dash instead of \"0%\".\n *\n * @element stat-meter\n */\n@customElement(\"stat-meter\")\nexport class StatMeter extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\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 .label {\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n color: var(--ui-text-muted, #64748b);\n }\n\n .track {\n display: block;\n width: 4rem;\n height: 0.375rem;\n border-radius: 9999px;\n background: var(--track-color, var(--ui-surface-muted, #f8fafc));\n overflow: hidden;\n }\n\n .fill {\n display: block;\n height: 100%;\n /* Keep the top highlight while softening the dark edge for compact meters. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--fill-color, var(--ui-success, #16a34a)) 80%, #000000) 100%\n );\n transition: width 200ms ease;\n }\n\n .value {\n min-width: 2rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n color: var(--ui-text, #0f172a);\n font-variant-numeric: tabular-nums;\n text-align: right;\n }\n @media (prefers-reduced-motion: reduce) {\n .fill {\n transition: none;\n }\n }\n `,\n ];\n\n /** Short label shown before the bar, e.g. \"CPU\" or \"MEM\". */\n @property() label = \"\";\n\n /** Percentage 0-100. `null` renders an empty bar and a \"—\" value instead of \"0%\". */\n @property({ type: Number }) percent: number | null = null;\n\n /** Fill color override; falls back to the `--ui-success` token. */\n @property() color = \"\";\n\n /** Track (inactive portion) background override; falls back to the `--ui-surface-muted` token. */\n @property({ attribute: \"track-color\" }) trackColor = \"\";\n\n override render() {\n const pct = this.percent;\n const clamped = pct === null ? 0 : Math.min(100, Math.max(0, pct));\n const fillStyle = this.color ? `width: ${clamped}%; --fill-color: ${this.color}` : `width: ${clamped}%`;\n const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : \"\";\n return html`\n <span class=\"label\">${this.label}</span>\n <span class=\"track\" role=\"img\" style=${trackStyle} aria-label=\"${this.label} ${pct === null ? \"no reading\" : `${pct}%`}\">\n <span class=\"fill\" style=${fillStyle}></span>\n </span>\n <span class=\"value\">${pct === null ? \"—\" : `${pct}%`}</span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"stat-meter\": StatMeter;\n }\n}\n"]}
|
package/dist/text-area.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../src/text-area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;;;;;;;GAUG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,4BAA4B;IAChB,KAAK,SAAM;IACvB,oDAAoD;IACxB,IAAI,SAAK;IACrC,yCAAyC;IAC7B,WAAW,SAAM;IAC7B,kEAAkE;IACrC,QAAQ,UAAS;IAC9C,4DAA4D;IAC/B,QAAQ,UAAS;IAE9C,OAAgB,MAAM,4BAqDpB;IAEF,OAAO,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../src/text-area.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;;;;;;;GAUG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,4BAA4B;IAChB,KAAK,SAAM;IACvB,oDAAoD;IACxB,IAAI,SAAK;IACrC,yCAAyC;IAC7B,WAAW,SAAM;IAC7B,kEAAkE;IACrC,QAAQ,UAAS;IAC9C,4DAA4D;IAC/B,QAAQ,UAAS;IAE9C,OAAgB,MAAM,4BAqDpB;IAEF,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,SAAS;IAQR,MAAM,yCAYd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/text-area.js
CHANGED
|
@@ -87,10 +87,17 @@ let TextArea = class TextArea extends LitElement {
|
|
|
87
87
|
`,
|
|
88
88
|
]; }
|
|
89
89
|
_onInput(e) {
|
|
90
|
+
// The native textarea's own "input" event is composed (crosses the shadow
|
|
91
|
+
// boundary) — stop it so only our re-dispatched CustomEvent (carrying
|
|
92
|
+
// `detail.value`) reaches consumers. Otherwise the native event bubbles
|
|
93
|
+
// out afterwards too, re-invoking the same "input" listener with a plain
|
|
94
|
+
// UIEvent whose `detail` defaults to 0, clobbering consumer state.
|
|
95
|
+
e.stopPropagation();
|
|
90
96
|
this.value = e.target.value;
|
|
91
97
|
this.dispatchEvent(new CustomEvent("input", { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
92
98
|
}
|
|
93
99
|
_onChange(e) {
|
|
100
|
+
e.stopPropagation();
|
|
94
101
|
this.value = e.target.value;
|
|
95
102
|
this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value }, bubbles: true, composed: true }));
|
|
96
103
|
}
|
package/dist/text-area.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.js","sourceRoot":"","sources":["../src/text-area.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,aAAa,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\"./tokens.js\";\n\n/**\n * Plain multi-line text field — a thin, tokenized wrapper around a native\n * `<textarea>`, styled to match the other value-entry form fields\n * (autocomplete-input, form-select, ...). Not a rich editor; use `readonly`\n * to display pre-formatted text (e.g. an error message) that the user can\n * still select and copy, typically paired with `<copy-link-button>`.\n *\n * @element text-area\n * @fires input - Fires on every keystroke; detail: { value: string }.\n * @fires change - Native change semantics (on blur, if the value changed); detail: { value: string }.\n */\n@customElement(\"text-area\")\nexport class TextArea extends LitElement {\n /** Current text content. */\n @property() value = \"\";\n /** Visible row count (native `<textarea rows>`). */\n @property({ type: Number }) rows = 4;\n /** Placeholder text shown when empty. */\n @property() placeholder = \"\";\n /** When true, the value can be selected/copied but not edited. */\n @property({ type: Boolean }) readonly = false;\n /** Disables the field entirely (no interaction, dimmed). */\n @property({ type: Boolean }) disabled = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n textarea {\n display: block;\n box-sizing: border-box;\n width: 100%;\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 font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n background: var(--ui-surface, #ffffff);\n padding: 0.5rem 0.75rem;\n border: 1px solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-sm, 0.25rem);\n resize: vertical;\n }\n textarea:read-only {\n background: var(--ui-surface-muted, #f8fafc);\n }\n textarea:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n textarea:focus-visible {\n outline: none;\n border-color: var(--ui-primary, #4f46e5);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n @media (forced-colors: active) {\n textarea:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n textarea:disabled {\n color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n private _onInput(e: Event): void {\n // The native textarea's own \"input\" event is composed (crosses the shadow\n // boundary) — stop it so only our re-dispatched CustomEvent (carrying\n // `detail.value`) reaches consumers. Otherwise the native event bubbles\n // out afterwards too, re-invoking the same \"input\" listener with a plain\n // UIEvent whose `detail` defaults to 0, clobbering consumer state.\n e.stopPropagation();\n this.value = (e.target as HTMLTextAreaElement).value;\n this.dispatchEvent(\n new CustomEvent(\"input\", { detail: { value: this.value }, bubbles: true, composed: true }),\n );\n }\n\n private _onChange(e: Event): void {\n e.stopPropagation();\n this.value = (e.target as HTMLTextAreaElement).value;\n this.dispatchEvent(\n new CustomEvent(\"change\", { detail: { value: this.value }, bubbles: true, composed: true }),\n );\n }\n\n override render() {\n return html`\n <textarea\n .value=${this.value}\n rows=${this.rows}\n placeholder=${this.placeholder}\n ?readonly=${this.readonly}\n ?disabled=${this.disabled}\n @input=${this._onInput}\n @change=${this._onChange}\n ></textarea>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"text-area\": TextArea;\n }\n}\n"]}
|
package/dist/timeline-entry.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ import type { StatusPillColor } from "./status-pill.js";
|
|
|
17
17
|
* `primary` by default, plus `neutral`, `info`, `success`, `warning`, and
|
|
18
18
|
* `danger`.
|
|
19
19
|
*
|
|
20
|
+
* Set `compact` for dense, one-line system-status entries (running spinners,
|
|
21
|
+
* state changes): it tightens the vertical spacing and renders the content
|
|
22
|
+
* smaller and muted.
|
|
23
|
+
*
|
|
20
24
|
* @element timeline-entry
|
|
21
25
|
* @slot headline - Optional headline/title for the event.
|
|
22
26
|
* @slot - The event content; nest any elements here.
|
|
@@ -29,6 +33,11 @@ export declare class TimelineEntry extends LitElement {
|
|
|
29
33
|
* `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.
|
|
30
34
|
*/
|
|
31
35
|
color: StatusPillColor;
|
|
36
|
+
/**
|
|
37
|
+
* Dense, one-line presentation for system-status entries: tighter vertical
|
|
38
|
+
* spacing and smaller, muted content.
|
|
39
|
+
*/
|
|
40
|
+
compact: boolean;
|
|
32
41
|
/** Whether the headline slot currently has assigned content. */
|
|
33
42
|
private _hasHeadline;
|
|
34
43
|
static styles: import("lit").CSSResult[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-entry.d.ts","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAErD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"timeline-entry.d.ts","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAErD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,uEAAuE;IAC3D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3C;;;OAGG;IACS,KAAK,EAAE,eAAe,CAAa;IAE/C;;;OAGG;IACyC,OAAO,UAAS;IAE5D,gEAAgE;IACvD,OAAO,CAAC,YAAY,CAAS;IAEtC,OAAgB,MAAM,4BA+HpB;IAEO,iBAAiB,IAAI,IAAI,CAGjC;IAED,6EAA6E;IAC7E,OAAO,CAAC,qBAAqB;IAIpB,MAAM,yCAqBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
package/dist/timeline-entry.js
CHANGED
|
@@ -24,6 +24,10 @@ import { tokens } from "./tokens.js";
|
|
|
24
24
|
* `primary` by default, plus `neutral`, `info`, `success`, `warning`, and
|
|
25
25
|
* `danger`.
|
|
26
26
|
*
|
|
27
|
+
* Set `compact` for dense, one-line system-status entries (running spinners,
|
|
28
|
+
* state changes): it tightens the vertical spacing and renders the content
|
|
29
|
+
* smaller and muted.
|
|
30
|
+
*
|
|
27
31
|
* @element timeline-entry
|
|
28
32
|
* @slot headline - Optional headline/title for the event.
|
|
29
33
|
* @slot - The event content; nest any elements here.
|
|
@@ -38,6 +42,11 @@ let TimelineEntry = class TimelineEntry extends LitElement {
|
|
|
38
42
|
* `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.
|
|
39
43
|
*/
|
|
40
44
|
this.color = "primary";
|
|
45
|
+
/**
|
|
46
|
+
* Dense, one-line presentation for system-status entries: tighter vertical
|
|
47
|
+
* spacing and smaller, muted content.
|
|
48
|
+
*/
|
|
49
|
+
this.compact = false;
|
|
41
50
|
/** Whether the headline slot currently has assigned content. */
|
|
42
51
|
this._hasHeadline = false;
|
|
43
52
|
}
|
|
@@ -156,6 +165,17 @@ let TimelineEntry = class TimelineEntry extends LitElement {
|
|
|
156
165
|
line-height: var(--ui-line-height-normal, 1.5);
|
|
157
166
|
color: var(--ui-text, #0f172a);
|
|
158
167
|
}
|
|
168
|
+
:host([compact]) .body {
|
|
169
|
+
padding-bottom: 0.5rem;
|
|
170
|
+
}
|
|
171
|
+
:host([compact]:last-child) .body {
|
|
172
|
+
padding-bottom: 0;
|
|
173
|
+
}
|
|
174
|
+
:host([compact]) .content {
|
|
175
|
+
margin-top: 0.125rem;
|
|
176
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
177
|
+
color: var(--ui-text-muted, #64748b);
|
|
178
|
+
}
|
|
159
179
|
`,
|
|
160
180
|
]; }
|
|
161
181
|
connectedCallback() {
|
|
@@ -196,6 +216,9 @@ __decorate([
|
|
|
196
216
|
__decorate([
|
|
197
217
|
property()
|
|
198
218
|
], TimelineEntry.prototype, "color", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
property({ type: Boolean, reflect: true })
|
|
221
|
+
], TimelineEntry.prototype, "compact", void 0);
|
|
199
222
|
__decorate([
|
|
200
223
|
state()
|
|
201
224
|
], TimelineEntry.prototype, "_hasHeadline", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC
|
|
1
|
+
{"version":3,"file":"timeline-entry.js","sourceRoot":"","sources":["../src/timeline-entry.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,uEAAuE;QAC3D,aAAQ,GAAkB,IAAI,CAAC;QAE3C;;;WAGG;QACS,UAAK,GAAoB,SAAS,CAAC;QAE/C;;;WAGG;QACyC,YAAO,GAAG,KAAK,CAAC;QAE5D,gEAAgE;QAC/C,iBAAY,GAAG,KAAK,CAAC;IAmKxC,CAAC;aAjKiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4HF;KACF,AA/HqB,CA+HpB;IAEO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YAAE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;IAED,6EAA6E;IACrE,qBAAqB,CAAC,KAAY;QACxC,IAAI,CAAC,YAAY,GAAI,KAAK,CAAC,MAA0B,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACpG,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;;;;;6BAKc,IAAI,CAAC,KAAK;;;;oCAIH,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO;kDAClB,IAAI,CAAC,qBAAqB;;cAE9D,IAAI,CAAC,QAAQ;YACb,CAAC,CAAC,IAAI,CAAA,wCAAwC,IAAI,CAAC,QAAQ,mBAAmB;YAC9E,CAAC,CAAC,OAAO;;;;;KAKlB,CAAC;IACJ,CAAC;CACF,CAAA;AAlLa;IAAX,QAAQ,EAAE;+CAAgC;AAM/B;IAAX,QAAQ,EAAE;4CAAoC;AAMH;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAiB;AAG3C;IAAhB,KAAK,EAAE;mDAA8B;AAjB3B,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAoLzB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport \"./relative-time.js\";\nimport { tokens } from \"./tokens.js\";\nimport type { StatusPillColor } from \"./status-pill.js\";\n\n/**\n * One event on a `timeline-container`: a dot on the vertical line, an optional\n * headline, a relative timestamp (\"3 hours ago\"), and freely nested content.\n * The connecting line is drawn here — its segment above the dot is hidden on\n * the first entry and the segment below is hidden on the last, so the line caps\n * exactly at the first and last dots. Only meaningful inside a\n * `timeline-container`; demonstrated through it.\n *\n * `datetime` is the entry's one timestamp. A nested element that has its own\n * timestamp prop (e.g. `chat-message`'s `timestamp`) should leave it unset —\n * setting both renders the same time twice.\n *\n * The dot's `color` types the entry using the shared status-pill palette —\n * `primary` by default, plus `neutral`, `info`, `success`, `warning`, and\n * `danger`.\n *\n * Set `compact` for dense, one-line system-status entries (running spinners,\n * state changes): it tightens the vertical spacing and renders the content\n * smaller and muted.\n *\n * @element timeline-entry\n * @slot headline - Optional headline/title for the event.\n * @slot - The event content; nest any elements here.\n */\n@customElement(\"timeline-entry\")\nexport class TimelineEntry extends LitElement {\n /** ISO 8601 or SQLite datetime string, rendered as a relative time. */\n @property() datetime: string | null = null;\n\n /**\n * Visual type of the entry's dot, from the shared status-pill palette:\n * `primary` (default), `neutral`, `info`, `success`, `warning`, or `danger`.\n */\n @property() color: StatusPillColor = \"primary\";\n\n /**\n * Dense, one-line presentation for system-status entries: tighter vertical\n * spacing and smaller, muted content.\n */\n @property({ type: Boolean, reflect: true }) compact = false;\n\n /** Whether the headline slot currently has assigned content. */\n @state() private _hasHeadline = false;\n\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 .entry {\n display: flex;\n gap: 0.75rem;\n }\n .rail {\n position: relative;\n flex: 0 0 auto;\n width: 0.75rem;\n }\n .line {\n position: absolute;\n left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--ui-border, #e2e8f0);\n }\n .line-top {\n top: 0;\n height: 0.5rem;\n }\n .line-bottom {\n top: 0.5rem;\n bottom: 0;\n }\n .dot {\n position: absolute;\n top: 0.125rem;\n left: 50%;\n width: 0.75rem;\n height: 0.75rem;\n transform: translateX(-50%);\n border-radius: 9999px;\n /* Same lighter-on-top token gradient as map-circle/user-avatar; the\n base color is swapped per the color property via the private\n --_dot var. */\n background: linear-gradient(\n to bottom,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #ffffff) 0%,\n color-mix(in srgb, var(--_dot, var(--ui-primary, #4f46e5)) 70%, #000000) 100%\n );\n }\n .dot.neutral {\n --_dot: var(--ui-text-muted, #64748b);\n }\n .dot.info {\n --_dot: var(--ui-info, #0ea5e9);\n }\n .dot.primary {\n --_dot: var(--ui-primary, #4f46e5);\n }\n .dot.success {\n --_dot: var(--ui-success, #16a34a);\n }\n .dot.warning {\n --_dot: var(--ui-warning, #d97706);\n }\n .dot.danger {\n --_dot: var(--ui-danger, #dc2626);\n }\n :host(:first-child) .line-top {\n display: none;\n }\n :host(:last-child) .line-bottom {\n display: none;\n }\n .body {\n flex: 1 1 auto;\n min-width: 0;\n padding-bottom: 1.5rem;\n }\n :host(:last-child) .body {\n padding-bottom: 0;\n }\n .head {\n display: flex;\n align-items: baseline;\n gap: 0.5rem;\n flex-wrap: wrap;\n }\n .headline {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .headline.empty {\n display: none;\n }\n .time {\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n }\n .content {\n margin-top: 0.25rem;\n font-size: var(--ui-font-size, 0.875rem);\n line-height: var(--ui-line-height-normal, 1.5);\n color: var(--ui-text, #0f172a);\n }\n :host([compact]) .body {\n padding-bottom: 0.5rem;\n }\n :host([compact]:last-child) .body {\n padding-bottom: 0;\n }\n :host([compact]) .content {\n margin-top: 0.125rem;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(\"role\")) this.setAttribute(\"role\", \"listitem\");\n }\n\n /** Collapses the headline when nothing is slotted so the time sits alone. */\n private _onHeadlineSlotChange(event: Event): void {\n this._hasHeadline = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n override render() {\n return html`\n <div class=\"entry\">\n <div class=\"rail\" aria-hidden=\"true\">\n <span class=\"line line-top\"></span>\n <span class=\"line line-bottom\"></span>\n <span class=\"dot ${this.color}\"></span>\n </div>\n <div class=\"body\">\n <div class=\"head\">\n <span class=\"headline ${this._hasHeadline ? \"\" : \"empty\"}\">\n <slot name=\"headline\" @slotchange=${this._onHeadlineSlotChange}></slot>\n </span>\n ${this.datetime\n ? html`<relative-time class=\"time\" datetime=${this.datetime}></relative-time>`\n : nothing}\n </div>\n <div class=\"content\"><slot></slot></div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"timeline-entry\": TimelineEntry;\n }\n}\n"]}
|