@f-ewald/components 1.19.0 → 1.20.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/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,EACV,aAAa,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,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,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAsB,MAAM,uBAAuB,CAAC;AAC3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,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,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 notifyWarning,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { ScrollToBottom } from \"./scroll-to-bottom.js\";\nexport { ScrollToTop } from \"./scroll-to-top.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 { MapboxMap } from \"./mapbox-map.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { RangeSlider } from \"./range-slider.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.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 { LoadMore } from \"./load-more.js\";\nexport { LoadingSpinner } from \"./loading-spinner.js\";\nexport { LoadingDots } from \"./loading-dots.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { UiCheckbox } from \"./ui-checkbox.js\";\nexport { FormField } from \"./form-field.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 { TreeView, type TreeNode } from \"./tree-view.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 { MarkdownView } from \"./markdown-view.js\";\nexport { AutoScroll } from \"./auto-scroll.js\";\nexport { SplitHero } from \"./split-hero.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,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,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Aa,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,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAwB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,yBAAyB,CAAC;AACjC,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 notifyWarning,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { ScrollToBottom } from \"./scroll-to-bottom.js\";\nexport { ScrollToTop } from \"./scroll-to-top.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 { MapboxMap } from \"./mapbox-map.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { RangeSlider } from \"./range-slider.js\";\nexport { ButtonGroup, type ButtonGroupOption } from \"./button-group.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 { LoadMore } from \"./load-more.js\";\nexport { LoadingSpinner } from \"./loading-spinner.js\";\nexport { LoadingDots } from \"./loading-dots.js\";\nexport {\n ChatMessage,\n type ChatMessageRole,\n type ChatMessageVariant,\n} from \"./chat-message.js\";\nexport { UiCheckbox } from \"./ui-checkbox.js\";\nexport { FormField } from \"./form-field.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 { TreeView, type TreeNode } from \"./tree-view.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 { MarkdownView } from \"./markdown-view.js\";\nexport { AutoScroll } from \"./auto-scroll.js\";\nexport { SplitHero } from \"./split-hero.js\";\nexport { TabBar, type TabChangeDetail } from \"./tab-bar.js\";\nexport { TabItem } from \"./tab-item.js\";\nexport { MarkdownEditor } from \"./markdown-editor.js\";\nexport {\n parseFrontMatter,\n formatFrontMatterValue,\n type FrontMatterResult,\n} from \"./utils/front-matter.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
+ import "./tab-bar.js";
3
+ import "./tab-item.js";
4
+ import "./text-area.js";
5
+ import "./markdown-view.js";
6
+ import "./frame-box.js";
7
+ /**
8
+ * GitHub-style markdown editor: a "Write" tab holding a plain textarea and a
9
+ * "Preview" tab rendering the markdown body (via `markdown-view`). Leading
10
+ * YAML front matter (a `---`-delimited block) is detected, parsed, and shown
11
+ * as a key-value table above the rendered body rather than as raw text.
12
+ *
13
+ * @element markdown-editor
14
+ * @fires input - Fires on every keystroke in the Write tab; detail: { value: string }.
15
+ * @fires change - Native change semantics (on blur, if the value changed); detail: { value: string }.
16
+ */
17
+ export declare class MarkdownEditor extends LitElement {
18
+ /** Full raw document text, including any front matter block. */
19
+ value: string;
20
+ /** Visible row count for the Write tab's textarea. */
21
+ rows: number;
22
+ /** Placeholder text shown when the Write tab is empty. */
23
+ placeholder: string;
24
+ static styles: import("lit").CSSResult[];
25
+ private _onInput;
26
+ private _onChange;
27
+ render(): import("lit-html").TemplateResult<1>;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ "markdown-editor": MarkdownEditor;
32
+ }
33
+ }
34
+ //# sourceMappingURL=markdown-editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.d.ts","sourceRoot":"","sources":["../src/markdown-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;GASG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,gEAAgE;IACpD,KAAK,SAAM;IAEvB,sDAAsD;IAC1B,IAAI,SAAM;IAEtC,0DAA0D;IAC9C,WAAW,SAAM;IAE7B,OAAgB,MAAM,4BAsCpB;IAEF,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,SAAS;IAQR,MAAM,yCAgCd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
@@ -0,0 +1,130 @@
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 { tokens } from "./tokens.js";
10
+ import { parseFrontMatter, formatFrontMatterValue } from "./utils/front-matter.js";
11
+ import "./tab-bar.js";
12
+ import "./tab-item.js";
13
+ import "./text-area.js";
14
+ import "./markdown-view.js";
15
+ import "./frame-box.js";
16
+ /**
17
+ * GitHub-style markdown editor: a "Write" tab holding a plain textarea and a
18
+ * "Preview" tab rendering the markdown body (via `markdown-view`). Leading
19
+ * YAML front matter (a `---`-delimited block) is detected, parsed, and shown
20
+ * as a key-value table above the rendered body rather than as raw text.
21
+ *
22
+ * @element markdown-editor
23
+ * @fires input - Fires on every keystroke in the Write tab; detail: { value: string }.
24
+ * @fires change - Native change semantics (on blur, if the value changed); detail: { value: string }.
25
+ */
26
+ let MarkdownEditor = class MarkdownEditor extends LitElement {
27
+ constructor() {
28
+ super(...arguments);
29
+ /** Full raw document text, including any front matter block. */
30
+ this.value = "";
31
+ /** Visible row count for the Write tab's textarea. */
32
+ this.rows = 12;
33
+ /** Placeholder text shown when the Write tab is empty. */
34
+ this.placeholder = "";
35
+ }
36
+ static { this.styles = [
37
+ tokens,
38
+ css `
39
+ :host {
40
+ display: block;
41
+ }
42
+ markdown-view {
43
+ display: block;
44
+ margin-top: 1rem;
45
+ }
46
+ .front-matter {
47
+ margin: 0;
48
+ display: grid;
49
+ grid-template-columns: auto 1fr;
50
+ gap: 0.25rem 0.75rem;
51
+ font-family: var(
52
+ --ui-font,
53
+ ui-sans-serif,
54
+ system-ui,
55
+ sans-serif,
56
+ "Apple Color Emoji",
57
+ "Segoe UI Emoji",
58
+ "Segoe UI Symbol",
59
+ "Noto Color Emoji"
60
+ );
61
+ font-size: var(--ui-font-size-sm, 0.75rem);
62
+ line-height: var(--ui-line-height-normal, 1.5);
63
+ }
64
+ .front-matter dt {
65
+ font-weight: var(--ui-font-weight-medium, 500);
66
+ color: var(--ui-text-muted, #64748b);
67
+ }
68
+ .front-matter dd {
69
+ margin: 0;
70
+ color: var(--ui-text, #0f172a);
71
+ word-break: break-word;
72
+ }
73
+ `,
74
+ ]; }
75
+ _onInput(e) {
76
+ e.stopPropagation();
77
+ this.value = e.detail.value;
78
+ this.dispatchEvent(new CustomEvent("input", { detail: { value: this.value }, bubbles: true, composed: true }));
79
+ }
80
+ _onChange(e) {
81
+ e.stopPropagation();
82
+ this.value = e.detail.value;
83
+ this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value }, bubbles: true, composed: true }));
84
+ }
85
+ render() {
86
+ const { data, body } = parseFrontMatter(this.value);
87
+ return html `
88
+ <tab-bar label="Editor mode">
89
+ <tab-item label="Write" value="write" selected>
90
+ <text-area
91
+ .value=${this.value}
92
+ .rows=${this.rows}
93
+ .placeholder=${this.placeholder}
94
+ @input=${this._onInput}
95
+ @change=${this._onChange}
96
+ ></text-area>
97
+ </tab-item>
98
+ <tab-item label="Preview" value="preview">
99
+ ${data
100
+ ? html `
101
+ <frame-box label="Front matter">
102
+ <dl class="front-matter">
103
+ ${Object.entries(data).map(([key, entryValue]) => html `
104
+ <dt>${key}</dt>
105
+ <dd>${formatFrontMatterValue(entryValue)}</dd>
106
+ `)}
107
+ </dl>
108
+ </frame-box>
109
+ `
110
+ : nothing}
111
+ <markdown-view .markdown=${body}></markdown-view>
112
+ </tab-item>
113
+ </tab-bar>
114
+ `;
115
+ }
116
+ };
117
+ __decorate([
118
+ property()
119
+ ], MarkdownEditor.prototype, "value", void 0);
120
+ __decorate([
121
+ property({ type: Number })
122
+ ], MarkdownEditor.prototype, "rows", void 0);
123
+ __decorate([
124
+ property()
125
+ ], MarkdownEditor.prototype, "placeholder", void 0);
126
+ MarkdownEditor = __decorate([
127
+ customElement("markdown-editor")
128
+ ], MarkdownEditor);
129
+ export { MarkdownEditor };
130
+ //# sourceMappingURL=markdown-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-editor.js","sourceRoot":"","sources":["../src/markdown-editor.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,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AAExB;;;;;;;;;GASG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QACL,gEAAgE;QACpD,UAAK,GAAG,EAAE,CAAC;QAEvB,sDAAsD;QAC1B,SAAI,GAAG,EAAE,CAA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CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,IAAI,CAAA;8BACnB,GAAG;8BACH,sBAAsB,CAAC,UAAU,CAAC;uBACzC,CACF;;;eAGN;YACH,CAAC,CAAC,OAAO;qCACgB,IAAI;;;KAGpC,CAAC;IACJ,CAAC;CACF,CAAA;AAjGa;IAAX,QAAQ,EAAE;6CAAY;AAGK;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAW;AAG1B;IAAX,QAAQ,EAAE;mDAAkB;AARlB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAmG1B","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport { parseFrontMatter, formatFrontMatterValue } from \"./utils/front-matter.js\";\nimport \"./tab-bar.js\";\nimport \"./tab-item.js\";\nimport \"./text-area.js\";\nimport \"./markdown-view.js\";\nimport \"./frame-box.js\";\n\n/**\n * GitHub-style markdown editor: a \"Write\" tab holding a plain textarea and a\n * \"Preview\" tab rendering the markdown body (via `markdown-view`). Leading\n * YAML front matter (a `---`-delimited block) is detected, parsed, and shown\n * as a key-value table above the rendered body rather than as raw text.\n *\n * @element markdown-editor\n * @fires input - Fires on every keystroke in the Write tab; detail: { value: string }.\n * @fires change - Native change semantics (on blur, if the value changed); detail: { value: string }.\n */\n@customElement(\"markdown-editor\")\nexport class MarkdownEditor extends LitElement {\n /** Full raw document text, including any front matter block. */\n @property() value = \"\";\n\n /** Visible row count for the Write tab's textarea. */\n @property({ type: Number }) rows = 12;\n\n /** Placeholder text shown when the Write tab is empty. */\n @property() placeholder = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n markdown-view {\n display: block;\n margin-top: 1rem;\n }\n .front-matter {\n margin: 0;\n display: grid;\n grid-template-columns: auto 1fr;\n gap: 0.25rem 0.75rem;\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 }\n .front-matter dt {\n font-weight: var(--ui-font-weight-medium, 500);\n color: var(--ui-text-muted, #64748b);\n }\n .front-matter dd {\n margin: 0;\n color: var(--ui-text, #0f172a);\n word-break: break-word;\n }\n `,\n ];\n\n private _onInput(e: Event): void {\n e.stopPropagation();\n this.value = (e as CustomEvent<{ value: string }>).detail.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 as CustomEvent<{ value: string }>).detail.value;\n this.dispatchEvent(\n new CustomEvent(\"change\", { detail: { value: this.value }, bubbles: true, composed: true }),\n );\n }\n\n override render() {\n const { data, body } = parseFrontMatter(this.value);\n return html`\n <tab-bar label=\"Editor mode\">\n <tab-item label=\"Write\" value=\"write\" selected>\n <text-area\n .value=${this.value}\n .rows=${this.rows}\n .placeholder=${this.placeholder}\n @input=${this._onInput}\n @change=${this._onChange}\n ></text-area>\n </tab-item>\n <tab-item label=\"Preview\" value=\"preview\">\n ${data\n ? html`\n <frame-box label=\"Front matter\">\n <dl class=\"front-matter\">\n ${Object.entries(data).map(\n ([key, entryValue]) => html`\n <dt>${key}</dt>\n <dd>${formatFrontMatterValue(entryValue)}</dd>\n `,\n )}\n </dl>\n </frame-box>\n `\n : nothing}\n <markdown-view .markdown=${body}></markdown-view>\n </tab-item>\n </tab-bar>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"markdown-editor\": MarkdownEditor;\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { LitElement } from "lit";
2
+ /** Fired when the active tab changes in response to user interaction. */
3
+ export interface TabChangeDetail {
4
+ /** The newly active `tab-item`'s `value` (falling back to its `label`). */
5
+ value: string;
6
+ /** Index of the newly active `tab-item` among its siblings. */
7
+ index: number;
8
+ }
9
+ /**
10
+ * WAI-ARIA tabs pattern (automatic activation, roving tabindex) driving a
11
+ * strip of declarative `tab-item` children. `tab-bar` renders the `role="tab"`
12
+ * button strip itself, reading `label`/`value`/`selected` off each slotted
13
+ * `tab-item`; each `tab-item` owns its own visibility via its reflected
14
+ * `selected` attribute.
15
+ *
16
+ * The active tab's underline uses `--ui-primary`; a `--ui-border` line spans
17
+ * the full strip beneath every tab, standing in for the inactive state since
18
+ * this design system has no dedicated secondary accent color.
19
+ *
20
+ * @element tab-bar
21
+ * @slot - `tab-item` elements.
22
+ * @fires change - The active tab changed via click or keyboard; detail: `TabChangeDetail`.
23
+ */
24
+ export declare class TabBar extends LitElement {
25
+ /** Accessible name for the tablist (e.g. "Editor mode"). */
26
+ label: string;
27
+ private readonly _tabItems;
28
+ private _version;
29
+ private readonly _uid;
30
+ private _observer?;
31
+ static styles: import("lit").CSSResult[];
32
+ connectedCallback(): void;
33
+ disconnectedCallback(): void;
34
+ protected updated(): void;
35
+ private _handleSlotChange;
36
+ /** Defaults the first tab-item to selected if none was marked so by the consumer. */
37
+ private _ensureSelection;
38
+ private _currentIndex;
39
+ private _tabButtonId;
40
+ private _select;
41
+ private _focusButton;
42
+ /** Arrow/Home/End roving-tabindex navigation with automatic activation. */
43
+ private _onKeydown;
44
+ render(): import("lit-html").TemplateResult<1>;
45
+ }
46
+ declare global {
47
+ interface HTMLElementTagNameMap {
48
+ "tab-bar": TabBar;
49
+ }
50
+ }
51
+ //# sourceMappingURL=tab-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-bar.d.ts","sourceRoot":"","sources":["../src/tab-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAQrD,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,qBACa,MAAO,SAAQ,UAAU;IACpC,4DAA4D;IAChD,KAAK,SAAM;IAGvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAa;IAE9B,OAAO,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgC;IACrD,OAAO,CAAC,SAAS,CAAC,CAAmB;IAErC,OAAgB,MAAM,4BA8DpB;IAEO,iBAAiB,IAAI,IAAI,CAYjC;IAEQ,oBAAoB,IAAI,IAAI,CAIpC;IAED,UAAmB,OAAO,IAAI,IAAI,CAIjC;IAED,OAAO,CAAC,iBAAiB;IAKzB,qFAAqF;IACrF,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,YAAY;IAMpB,2EAA2E;IAC3E,OAAO,CAAC,UAAU;IA2BT,MAAM,yCA+Bd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
@@ -0,0 +1,233 @@
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, queryAssignedElements, state } from "lit/decorators.js";
9
+ import { repeat } from "lit/directives/repeat.js";
10
+ import { tokens } from "./tokens.js";
11
+ let instanceCount = 0;
12
+ /**
13
+ * WAI-ARIA tabs pattern (automatic activation, roving tabindex) driving a
14
+ * strip of declarative `tab-item` children. `tab-bar` renders the `role="tab"`
15
+ * button strip itself, reading `label`/`value`/`selected` off each slotted
16
+ * `tab-item`; each `tab-item` owns its own visibility via its reflected
17
+ * `selected` attribute.
18
+ *
19
+ * The active tab's underline uses `--ui-primary`; a `--ui-border` line spans
20
+ * the full strip beneath every tab, standing in for the inactive state since
21
+ * this design system has no dedicated secondary accent color.
22
+ *
23
+ * @element tab-bar
24
+ * @slot - `tab-item` elements.
25
+ * @fires change - The active tab changed via click or keyboard; detail: `TabChangeDetail`.
26
+ */
27
+ let TabBar = class TabBar extends LitElement {
28
+ constructor() {
29
+ super(...arguments);
30
+ /** Accessible name for the tablist (e.g. "Editor mode"). */
31
+ this.label = "";
32
+ this._version = 0;
33
+ this._uid = `tab-bar-${++instanceCount}`;
34
+ }
35
+ static { this.styles = [
36
+ tokens,
37
+ css `
38
+ :host {
39
+ display: block;
40
+ }
41
+ .tablist {
42
+ display: flex;
43
+ gap: 1rem;
44
+ border-bottom: 1px solid var(--ui-border, #e2e8f0);
45
+ }
46
+ .tab {
47
+ appearance: none;
48
+ background: none;
49
+ border: none;
50
+ border-bottom: 2px solid transparent;
51
+ margin-bottom: -1px;
52
+ min-height: 2rem;
53
+ padding: 0.5rem 0.25rem;
54
+ font-family: var(
55
+ --ui-font,
56
+ ui-sans-serif,
57
+ system-ui,
58
+ sans-serif,
59
+ "Apple Color Emoji",
60
+ "Segoe UI Emoji",
61
+ "Segoe UI Symbol",
62
+ "Noto Color Emoji"
63
+ );
64
+ font-size: var(--ui-font-size-sm, 0.75rem);
65
+ font-weight: var(--ui-font-weight-medium, 500);
66
+ line-height: var(--ui-line-height-tight, 1.25);
67
+ color: var(--ui-text-muted, #64748b);
68
+ cursor: pointer;
69
+ }
70
+ .tab:hover {
71
+ color: var(--ui-text, #0f172a);
72
+ }
73
+ .tab[aria-selected="true"] {
74
+ color: var(--ui-text, #0f172a);
75
+ font-weight: var(--ui-font-weight-semibold, 600);
76
+ border-bottom-color: var(--ui-primary, #4f46e5);
77
+ }
78
+ .tab:focus-visible {
79
+ outline: none;
80
+ border-radius: var(--ui-radius-sm, 0.25rem);
81
+ box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
82
+ }
83
+ .panels {
84
+ margin-top: 1rem;
85
+ }
86
+ @media (forced-colors: active) {
87
+ .tab[aria-selected="true"] {
88
+ border-bottom-color: Highlight;
89
+ }
90
+ .tab:focus-visible {
91
+ outline: 2px solid CanvasText;
92
+ outline-offset: 2px;
93
+ box-shadow: none;
94
+ }
95
+ }
96
+ `,
97
+ ]; }
98
+ connectedCallback() {
99
+ super.connectedCallback();
100
+ this._observer ??= new MutationObserver(() => {
101
+ this._version++;
102
+ this._ensureSelection();
103
+ });
104
+ this._observer.observe(this, {
105
+ attributes: true,
106
+ attributeFilter: ["label", "value", "selected"],
107
+ childList: true,
108
+ subtree: true,
109
+ });
110
+ }
111
+ disconnectedCallback() {
112
+ super.disconnectedCallback();
113
+ this._observer?.disconnect();
114
+ this._observer = undefined;
115
+ }
116
+ updated() {
117
+ this._tabItems.forEach((item, index) => {
118
+ item.setAttribute("aria-labelledby", this._tabButtonId(index));
119
+ });
120
+ }
121
+ _handleSlotChange() {
122
+ this._version++;
123
+ this._ensureSelection();
124
+ }
125
+ /** Defaults the first tab-item to selected if none was marked so by the consumer. */
126
+ _ensureSelection() {
127
+ const items = this._tabItems;
128
+ if (items.length > 0 && !items.some((item) => item.selected)) {
129
+ items[0].selected = true;
130
+ }
131
+ }
132
+ _currentIndex() {
133
+ const index = this._tabItems.findIndex((item) => item.selected);
134
+ return index === -1 ? 0 : index;
135
+ }
136
+ _tabButtonId(index) {
137
+ return `${this._uid}-tab-${index}`;
138
+ }
139
+ _select(index, options) {
140
+ const items = this._tabItems;
141
+ const target = items[index];
142
+ if (!target)
143
+ return;
144
+ const changed = !target.selected;
145
+ for (const item of items)
146
+ item.selected = item === target;
147
+ this._version++;
148
+ if (options?.focus)
149
+ this._focusButton(index);
150
+ if (changed) {
151
+ this.dispatchEvent(new CustomEvent("change", {
152
+ detail: { value: target.value || target.label, index },
153
+ bubbles: true,
154
+ composed: true,
155
+ }));
156
+ }
157
+ }
158
+ _focusButton(index) {
159
+ void this.updateComplete.then(() => {
160
+ this.shadowRoot?.querySelectorAll(".tab")[index]?.focus();
161
+ });
162
+ }
163
+ /** Arrow/Home/End roving-tabindex navigation with automatic activation. */
164
+ _onKeydown(event) {
165
+ const items = this._tabItems;
166
+ if (items.length === 0)
167
+ return;
168
+ const current = this._currentIndex();
169
+ let next;
170
+ switch (event.key) {
171
+ case "ArrowRight":
172
+ case "ArrowDown":
173
+ next = (current + 1) % items.length;
174
+ break;
175
+ case "ArrowLeft":
176
+ case "ArrowUp":
177
+ next = (current - 1 + items.length) % items.length;
178
+ break;
179
+ case "Home":
180
+ next = 0;
181
+ break;
182
+ case "End":
183
+ next = items.length - 1;
184
+ break;
185
+ default:
186
+ return;
187
+ }
188
+ event.preventDefault();
189
+ this._select(next, { focus: true });
190
+ }
191
+ render() {
192
+ const items = this._tabItems ?? [];
193
+ const current = this._currentIndex();
194
+ return html `
195
+ <div
196
+ class="tablist"
197
+ role="tablist"
198
+ aria-label=${this.label || nothing}
199
+ @keydown=${this._onKeydown}
200
+ >
201
+ ${repeat(items, (item) => item, (item, index) => html `
202
+ <button
203
+ type="button"
204
+ class="tab"
205
+ role="tab"
206
+ id=${this._tabButtonId(index)}
207
+ aria-selected=${item.selected ? "true" : "false"}
208
+ aria-controls=${item.id}
209
+ tabindex=${index === current ? 0 : -1}
210
+ @click=${() => this._select(index)}
211
+ >
212
+ ${item.label}
213
+ </button>
214
+ `)}
215
+ </div>
216
+ <div class="panels"><slot @slotchange=${this._handleSlotChange}></slot></div>
217
+ `;
218
+ }
219
+ };
220
+ __decorate([
221
+ property()
222
+ ], TabBar.prototype, "label", void 0);
223
+ __decorate([
224
+ queryAssignedElements({ selector: "tab-item" })
225
+ ], TabBar.prototype, "_tabItems", void 0);
226
+ __decorate([
227
+ state()
228
+ ], TabBar.prototype, "_version", void 0);
229
+ TabBar = __decorate([
230
+ customElement("tab-bar")
231
+ ], TabBar);
232
+ export { TabBar };
233
+ //# sourceMappingURL=tab-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-bar.js","sourceRoot":"","sources":["../src/tab-bar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,IAAI,aAAa,GAAG,CAAC,CAAC;AAUtB;;;;;;;;;;;;;;GAcG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QACL,4DAA4D;QAChD,UAAK,GAAG,EAAE,CAAC;QAKN,aAAQ,GAAG,CAAC,CAAC;QACb,SAAI,GAAG,WAAW,EAAE,aAAa,EAAE,CAAC;IAwMvD,CAAC;aArMiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2DF;KACF,AA9DqB,CA8DpB;IAEO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,SAAS,KAAK,IAAI,gBAAgB,CAAC,GAAG,EAAE;YAC3C,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,S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C;uBAC5B,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;;gBAEhC,IAAI,CAAC,KAAK;;WAEf,CACF;;8CAEqC,IAAI,CAAC,iBAAiB;KAC/D,CAAC;IACJ,CAAC;CACF,CAAA;AA9Ma;IAAX,QAAQ,EAAE;qCAAY;AAGN;IADhB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;yCACT;AAEtB;IAAhB,KAAK,EAAE;wCAAsB;AAPnB,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAgNlB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\nimport { TabItem } from \"./tab-item.js\";\n\nlet instanceCount = 0;\n\n/** Fired when the active tab changes in response to user interaction. */\nexport interface TabChangeDetail {\n /** The newly active `tab-item`'s `value` (falling back to its `label`). */\n value: string;\n /** Index of the newly active `tab-item` among its siblings. */\n index: number;\n}\n\n/**\n * WAI-ARIA tabs pattern (automatic activation, roving tabindex) driving a\n * strip of declarative `tab-item` children. `tab-bar` renders the `role=\"tab\"`\n * button strip itself, reading `label`/`value`/`selected` off each slotted\n * `tab-item`; each `tab-item` owns its own visibility via its reflected\n * `selected` attribute.\n *\n * The active tab's underline uses `--ui-primary`; a `--ui-border` line spans\n * the full strip beneath every tab, standing in for the inactive state since\n * this design system has no dedicated secondary accent color.\n *\n * @element tab-bar\n * @slot - `tab-item` elements.\n * @fires change - The active tab changed via click or keyboard; detail: `TabChangeDetail`.\n */\n@customElement(\"tab-bar\")\nexport class TabBar extends LitElement {\n /** Accessible name for the tablist (e.g. \"Editor mode\"). */\n @property() label = \"\";\n\n @queryAssignedElements({ selector: \"tab-item\" })\n private readonly _tabItems!: TabItem[];\n\n @state() private _version = 0;\n private readonly _uid = `tab-bar-${++instanceCount}`;\n private _observer?: MutationObserver;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .tablist {\n display: flex;\n gap: 1rem;\n border-bottom: 1px solid var(--ui-border, #e2e8f0);\n }\n .tab {\n appearance: none;\n background: none;\n border: none;\n border-bottom: 2px solid transparent;\n margin-bottom: -1px;\n min-height: 2rem;\n padding: 0.5rem 0.25rem;\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 font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n cursor: pointer;\n }\n .tab:hover {\n color: var(--ui-text, #0f172a);\n }\n .tab[aria-selected=\"true\"] {\n color: var(--ui-text, #0f172a);\n font-weight: var(--ui-font-weight-semibold, 600);\n border-bottom-color: var(--ui-primary, #4f46e5);\n }\n .tab:focus-visible {\n outline: none;\n border-radius: var(--ui-radius-sm, 0.25rem);\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .panels {\n margin-top: 1rem;\n }\n @media (forced-colors: active) {\n .tab[aria-selected=\"true\"] {\n border-bottom-color: Highlight;\n }\n .tab:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._observer ??= new MutationObserver(() => {\n this._version++;\n this._ensureSelection();\n });\n this._observer.observe(this, {\n attributes: true,\n attributeFilter: [\"label\", \"value\", \"selected\"],\n childList: true,\n subtree: true,\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._observer?.disconnect();\n this._observer = undefined;\n }\n\n protected override updated(): void {\n this._tabItems.forEach((item, index) => {\n item.setAttribute(\"aria-labelledby\", this._tabButtonId(index));\n });\n }\n\n private _handleSlotChange(): void {\n this._version++;\n this._ensureSelection();\n }\n\n /** Defaults the first tab-item to selected if none was marked so by the consumer. */\n private _ensureSelection(): void {\n const items = this._tabItems;\n if (items.length > 0 && !items.some((item) => item.selected)) {\n items[0].selected = true;\n }\n }\n\n private _currentIndex(): number {\n const index = this._tabItems.findIndex((item) => item.selected);\n return index === -1 ? 0 : index;\n }\n\n private _tabButtonId(index: number): string {\n return `${this._uid}-tab-${index}`;\n }\n\n private _select(index: number, options?: { focus?: boolean }): void {\n const items = this._tabItems;\n const target = items[index];\n if (!target) return;\n const changed = !target.selected;\n for (const item of items) item.selected = item === target;\n this._version++;\n if (options?.focus) this._focusButton(index);\n if (changed) {\n this.dispatchEvent(\n new CustomEvent<TabChangeDetail>(\"change\", {\n detail: { value: target.value || target.label, index },\n bubbles: true,\n composed: true,\n }),\n );\n }\n }\n\n private _focusButton(index: number): void {\n void this.updateComplete.then(() => {\n this.shadowRoot?.querySelectorAll<HTMLButtonElement>(\".tab\")[index]?.focus();\n });\n }\n\n /** Arrow/Home/End roving-tabindex navigation with automatic activation. */\n private _onKeydown(event: KeyboardEvent): void {\n const items = this._tabItems;\n if (items.length === 0) return;\n const current = this._currentIndex();\n let next: number;\n switch (event.key) {\n case \"ArrowRight\":\n case \"ArrowDown\":\n next = (current + 1) % items.length;\n break;\n case \"ArrowLeft\":\n case \"ArrowUp\":\n next = (current - 1 + items.length) % items.length;\n break;\n case \"Home\":\n next = 0;\n break;\n case \"End\":\n next = items.length - 1;\n break;\n default:\n return;\n }\n event.preventDefault();\n this._select(next, { focus: true });\n }\n\n override render() {\n const items = this._tabItems ?? [];\n const current = this._currentIndex();\n return html`\n <div\n class=\"tablist\"\n role=\"tablist\"\n aria-label=${this.label || nothing}\n @keydown=${this._onKeydown}\n >\n ${repeat(\n items,\n (item) => item,\n (item, index) => html`\n <button\n type=\"button\"\n class=\"tab\"\n role=\"tab\"\n id=${this._tabButtonId(index)}\n aria-selected=${item.selected ? \"true\" : \"false\"}\n aria-controls=${item.id}\n tabindex=${index === current ? 0 : -1}\n @click=${() => this._select(index)}\n >\n ${item.label}\n </button>\n `,\n )}\n </div>\n <div class=\"panels\"><slot @slotchange=${this._handleSlotChange}></slot></div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"tab-bar\": TabBar;\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A single labeled panel inside a `tab-bar`. Renders its default slot as an
4
+ * ARIA `tabpanel`, shown or hidden based on `selected` — `tab-bar` reads
5
+ * `label`/`value` to build its tab strip and toggles `selected` on the
6
+ * active panel.
7
+ *
8
+ * @element tab-item
9
+ * @slot - Panel content, shown only while `selected`.
10
+ */
11
+ export declare class TabItem extends LitElement {
12
+ /** Text shown in the tab-bar's tab button for this panel. */
13
+ label: string;
14
+ /** Stable identifier reported in `tab-bar`'s `change` event; defaults to `label`. */
15
+ value: string;
16
+ /** Whether this panel is the active one; `tab-bar` owns this. */
17
+ selected: boolean;
18
+ static styles: import("lit").CSSResult[];
19
+ connectedCallback(): void;
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ "tab-item": TabItem;
25
+ }
26
+ }
27
+ //# sourceMappingURL=tab-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-item.d.ts","sourceRoot":"","sources":["../src/tab-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAM5C;;;;;;;;GAQG;AACH,qBACa,OAAQ,SAAQ,UAAU;IACrC,6DAA6D;IACjD,KAAK,SAAM;IAEvB,qFAAqF;IACzE,KAAK,SAAM;IAEvB,iEAAiE;IACrB,QAAQ,UAAS;IAE7D,OAAgB,MAAM,4BAUpB;IAEO,iBAAiB,IAAI,IAAI,CAOjC;IAEQ,MAAM,yCAEd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -0,0 +1,67 @@
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 { tokens } from "./tokens.js";
10
+ let instanceCount = 0;
11
+ /**
12
+ * A single labeled panel inside a `tab-bar`. Renders its default slot as an
13
+ * ARIA `tabpanel`, shown or hidden based on `selected` — `tab-bar` reads
14
+ * `label`/`value` to build its tab strip and toggles `selected` on the
15
+ * active panel.
16
+ *
17
+ * @element tab-item
18
+ * @slot - Panel content, shown only while `selected`.
19
+ */
20
+ let TabItem = class TabItem extends LitElement {
21
+ constructor() {
22
+ super(...arguments);
23
+ /** Text shown in the tab-bar's tab button for this panel. */
24
+ this.label = "";
25
+ /** Stable identifier reported in `tab-bar`'s `change` event; defaults to `label`. */
26
+ this.value = "";
27
+ /** Whether this panel is the active one; `tab-bar` owns this. */
28
+ this.selected = false;
29
+ }
30
+ static { this.styles = [
31
+ tokens,
32
+ css `
33
+ :host {
34
+ display: block;
35
+ }
36
+ :host(:not([selected])) {
37
+ display: none;
38
+ }
39
+ `,
40
+ ]; }
41
+ connectedCallback() {
42
+ super.connectedCallback();
43
+ // Custom element constructors must not gain attributes (throws when
44
+ // created via document.createElement), so this is set on connect instead.
45
+ if (!this.id)
46
+ this.id = `tab-item-${++instanceCount}`;
47
+ this.setAttribute("role", "tabpanel");
48
+ this.setAttribute("tabindex", "0");
49
+ }
50
+ render() {
51
+ return html `<slot></slot>`;
52
+ }
53
+ };
54
+ __decorate([
55
+ property()
56
+ ], TabItem.prototype, "label", void 0);
57
+ __decorate([
58
+ property()
59
+ ], TabItem.prototype, "value", void 0);
60
+ __decorate([
61
+ property({ type: Boolean, reflect: true })
62
+ ], TabItem.prototype, "selected", void 0);
63
+ TabItem = __decorate([
64
+ customElement("tab-item")
65
+ ], TabItem);
66
+ export { TabItem };
67
+ //# sourceMappingURL=tab-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tab-item.js","sourceRoot":"","sources":["../src/tab-item.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,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB;;;;;;;;GAQG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QACL,6DAA6D;QACjD,UAAK,GAAG,EAAE,CAAC;QAEvB,qFAAqF;QACzE,UAAK,GAAG,EAAE,CAAC;QAEvB,iEAAiE;QACrB,aAAQ,GAAG,KAAK,CAAC;IA0B/D,CAAC;aAxBiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;KAOF;KACF,AAVqB,CAUpB;IAEO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,oEAAoE;QACpE,0EAA0E;QAC1E,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,GAAG,YAAY,EAAE,aAAa,EAAE,CAAC;QACtD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;CACF,CAAA;AAhCa;IAAX,QAAQ,EAAE;sCAAY;AAGX;IAAX,QAAQ,EAAE;sCAAY;AAGqB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAAkB;AARlD,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAkCnB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\nlet instanceCount = 0;\n\n/**\n * A single labeled panel inside a `tab-bar`. Renders its default slot as an\n * ARIA `tabpanel`, shown or hidden based on `selected` — `tab-bar` reads\n * `label`/`value` to build its tab strip and toggles `selected` on the\n * active panel.\n *\n * @element tab-item\n * @slot - Panel content, shown only while `selected`.\n */\n@customElement(\"tab-item\")\nexport class TabItem extends LitElement {\n /** Text shown in the tab-bar's tab button for this panel. */\n @property() label = \"\";\n\n /** Stable identifier reported in `tab-bar`'s `change` event; defaults to `label`. */\n @property() value = \"\";\n\n /** Whether this panel is the active one; `tab-bar` owns this. */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n :host(:not([selected])) {\n display: none;\n }\n `,\n ];\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Custom element constructors must not gain attributes (throws when\n // created via document.createElement), so this is set on connect instead.\n if (!this.id) this.id = `tab-item-${++instanceCount}`;\n this.setAttribute(\"role\", \"tabpanel\");\n this.setAttribute(\"tabindex\", \"0\");\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"tab-item\": TabItem;\n }\n}\n"]}