@f-ewald/components 1.40.3 → 1.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +14 -4
  2. package/custom-elements.json +2017 -131
  3. package/dist/app-shell.js +1 -1
  4. package/dist/app-shell.js.map +1 -1
  5. package/dist/blink-cursor.d.ts +27 -0
  6. package/dist/blink-cursor.d.ts.map +1 -0
  7. package/dist/blink-cursor.js +78 -0
  8. package/dist/blink-cursor.js.map +1 -0
  9. package/dist/code-diff.d.ts +41 -0
  10. package/dist/code-diff.d.ts.map +1 -0
  11. package/dist/code-diff.js +161 -0
  12. package/dist/code-diff.js.map +1 -0
  13. package/dist/comment-label.d.ts +26 -0
  14. package/dist/comment-label.d.ts.map +1 -0
  15. package/dist/comment-label.js +81 -0
  16. package/dist/comment-label.js.map +1 -0
  17. package/dist/confirm-dialog.d.ts +12 -6
  18. package/dist/confirm-dialog.d.ts.map +1 -1
  19. package/dist/confirm-dialog.js +50 -88
  20. package/dist/confirm-dialog.js.map +1 -1
  21. package/dist/dag-graph.d.ts +161 -0
  22. package/dist/dag-graph.d.ts.map +1 -0
  23. package/dist/dag-graph.js +724 -0
  24. package/dist/dag-graph.js.map +1 -0
  25. package/dist/icons.d.ts +16 -0
  26. package/dist/icons.d.ts.map +1 -1
  27. package/dist/icons.js +16 -0
  28. package/dist/icons.js.map +1 -1
  29. package/dist/index.d.ts +9 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +9 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/mcp-server.js +1 -1
  34. package/dist/mcp-server.js.map +1 -1
  35. package/dist/modal-dialog.d.ts +16 -13
  36. package/dist/modal-dialog.d.ts.map +1 -1
  37. package/dist/modal-dialog.js +69 -104
  38. package/dist/modal-dialog.js.map +1 -1
  39. package/dist/photo-gallery.js +1 -1
  40. package/dist/photo-gallery.js.map +1 -1
  41. package/dist/price-history-chart.js +1 -1
  42. package/dist/price-history-chart.js.map +1 -1
  43. package/dist/progress-bar.d.ts.map +1 -1
  44. package/dist/progress-bar.js +23 -17
  45. package/dist/progress-bar.js.map +1 -1
  46. package/dist/slide-panel.d.ts +3 -3
  47. package/dist/slide-panel.d.ts.map +1 -1
  48. package/dist/slide-panel.js +38 -22
  49. package/dist/slide-panel.js.map +1 -1
  50. package/dist/stat-strip.d.ts +30 -0
  51. package/dist/stat-strip.d.ts.map +1 -0
  52. package/dist/stat-strip.js +111 -0
  53. package/dist/stat-strip.js.map +1 -0
  54. package/dist/step-ladder.d.ts +46 -0
  55. package/dist/step-ladder.d.ts.map +1 -0
  56. package/dist/step-ladder.js +175 -0
  57. package/dist/step-ladder.js.map +1 -0
  58. package/dist/terminal-block.d.ts +45 -0
  59. package/dist/terminal-block.d.ts.map +1 -0
  60. package/dist/terminal-block.js +113 -0
  61. package/dist/terminal-block.js.map +1 -0
  62. package/dist/toast-notification.d.ts +7 -0
  63. package/dist/toast-notification.d.ts.map +1 -1
  64. package/dist/toast-notification.js +34 -0
  65. package/dist/toast-notification.js.map +1 -1
  66. package/dist/tokens.css +64 -1
  67. package/dist/tokens.d.ts +58 -0
  68. package/dist/tokens.d.ts.map +1 -1
  69. package/dist/tokens.js +145 -0
  70. package/dist/tokens.js.map +1 -1
  71. package/dist/ui-button.js +2 -2
  72. package/dist/ui-button.js.map +1 -1
  73. package/dist/utils/dag-layout.d.ts +60 -0
  74. package/dist/utils/dag-layout.d.ts.map +1 -0
  75. package/dist/utils/dag-layout.js +80 -0
  76. package/dist/utils/dag-layout.js.map +1 -0
  77. package/dist/window-chrome.d.ts +34 -0
  78. package/dist/window-chrome.d.ts.map +1 -0
  79. package/dist/window-chrome.js +141 -0
  80. package/dist/window-chrome.js.map +1 -0
  81. package/docs/app-shell.md +1 -1
  82. package/docs/blink-cursor.md +45 -0
  83. package/docs/code-diff.md +64 -0
  84. package/docs/comment-label.md +49 -0
  85. package/docs/confirm-dialog.md +4 -3
  86. package/docs/dag-graph.md +101 -0
  87. package/docs/design-language.md +43 -21
  88. package/docs/icons.md +8 -0
  89. package/docs/layouts/marketing-landing.md +102 -0
  90. package/docs/modal-dialog.md +9 -9
  91. package/docs/photo-gallery.md +1 -1
  92. package/docs/price-history-chart.md +1 -0
  93. package/docs/slide-panel.md +2 -2
  94. package/docs/stat-strip.md +57 -0
  95. package/docs/step-ladder.md +63 -0
  96. package/docs/terminal-block.md +69 -0
  97. package/docs/ui-button.md +2 -0
  98. package/docs/window-chrome.md +64 -0
  99. package/llms.txt +282 -18
  100. package/package.json +2 -1
package/dist/app-shell.js CHANGED
@@ -252,7 +252,7 @@ let AppShell = class AppShell extends LitElement {
252
252
  padding: 0.25rem 0.5rem;
253
253
  border-radius: var(--ui-radius-sm, 0.25rem);
254
254
  background: var(--ui-tooltip, #0f172a);
255
- color: var(--ui-on-accent, #ffffff);
255
+ color: var(--ui-tooltip-text, #ffffff);
256
256
  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));
257
257
  font-size: var(--ui-font-size-sm, 0.75rem);
258
258
  line-height: var(--ui-line-height-tight, 1.25);
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../src/app-shell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU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CAAyB;AAEhB;IAAhB,KAAK,EAAE;4CAA4B;AAjBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAocpB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconBars3 } from \"./icons.js\";\nimport \"./kbd-hint.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** Fired when the built-in toggle changes the sidebar state. */\nexport interface SidebarToggleDetail {\n /** Whether the sidebar is now open. */\n open: boolean;\n}\n\n/**\n * The dashboard page shell: a slot-based CSS-grid backbone that arranges a\n * top bar, the main content, an optional right-hand detail column, an\n * optional footer, and a sidebar. The top bar always spans the shell's full\n * width, in every sidebar state.\n *\n * The sidebar's visibility, width, and layout mode are three independent\n * properties:\n * - `sidebar-open` (default closed) — whether it's shown at all.\n * - `sidebar-width`: `\"full\"` (16rem, icons + labels, the default) or\n * `\"icon\"` (3.5rem rail, icons only — drives the slotted `app-sidebar`'s\n * own `collapsed` attribute).\n * - `sidebar-mode`: `\"overlay\"` (the default) floats the sidebar above the\n * shell's own content with a higher z-index, covering part of the top\n * bar's corner and whatever content sits beneath it, without ever\n * resizing or reflowing `main`/`footer`. `\"push\"` instead reserves a real\n * grid column beside `main`/`footer` (which resize to make room) — the\n * top bar still spans full width above it either way.\n *\n * Below the shared 48rem breakpoint the sidebar always behaves as a\n * full-width, modal, scrim/Escape-dismissible drawer regardless of\n * `sidebar-mode`/`sidebar-width` — those two properties only affect the\n * desktop presentation. Above 48rem, an `overlay`-mode sidebar is a\n * non-modal panel (no dimming scrim, no Escape-dismiss, since it reads as\n * an ordinary always-interactive panel rather than a blocking dialog); a\n * `push`-mode sidebar is even more clearly non-modal, since it never\n * covers anything.\n *\n * The right-hand detail column is unaffected by any of the above: it still\n * reserves an inline grid column on desktop and becomes a dismissible\n * overlay (scrim/Escape) on mobile.\n *\n * Widths are tunable per instance via `--component-sidebar-width` (16rem),\n * `--component-sidebar-rail-width` (3.5rem), and `--component-topbar-height`\n * (3rem); the detail column reuses the 20rem/25rem panel widths. The main\n * content area is white by default — override it with\n * `--component-main-background`. Give the shell a height (e.g. `height:\n * 100vh`) so the sidebar and main can size and scroll.\n *\n * Hovering or keyboard-focusing the toggle reveals a tooltip naming the\n * action and its `[` shortcut — the shortcut is not shown as permanent\n * chrome.\n *\n * Consumers with their own external top bar can set `no-topbar` to skip\n * rendering the built-in topbar row and toggle button entirely (the grid\n * drops that row rather than leaving dead space). The `[`/Escape shortcuts\n * stay fully active either way — drive `sidebar-open` from your own UI and\n * listen for `sidebar-toggle` to stay in sync with keyboard-driven changes.\n *\n * @element app-shell\n * @slot - Main content area.\n * @slot sidebar - Sidebar navigation (typically `app-sidebar`).\n * @slot topbar - Top bar content, right of the built-in toggle.\n * @slot detail - Optional right-hand detail; shown when `detail-open` is set.\n * @slot footer - Optional footer beneath the main content.\n * @fires sidebar-toggle - The built-in toggle changed the sidebar state.\n * @fires detail-close - The scrim or Escape dismissed the mobile detail overlay.\n */\n@customElement(\"app-shell\")\nexport class AppShell extends LitElement {\n /** Whether the sidebar is open. Closed by default at every breakpoint. */\n @property({ type: Boolean, reflect: true, attribute: \"sidebar-open\" }) sidebarOpen = false;\n /** `\"overlay\"` (default) floats the sidebar above content; `\"push\"` reserves a grid column instead. */\n @property({ reflect: true, attribute: \"sidebar-mode\" }) sidebarMode: \"overlay\" | \"push\" = \"overlay\";\n /** Sidebar width when open: `\"full\"` (16rem, icons + labels) or `\"icon\"` (3.5rem rail, icons only). */\n @property({ reflect: true, attribute: \"sidebar-width\" }) sidebarWidth: \"full\" | \"icon\" = \"full\";\n /** Shows the right-hand detail region (inline column, or overlay on mobile). */\n @property({ type: Boolean, reflect: true, attribute: \"detail-open\" }) detailOpen = false;\n /** Detail width: `compact` (20rem) or `comfortable` (25rem). */\n @property({ attribute: \"detail-width\" }) detailWidth: \"compact\" | \"comfortable\" = \"compact\";\n /** Skips rendering the built-in topbar row and its nav toggle entirely, for consumers with their own external top bar. The `[`/Escape shortcuts stay active regardless — this only affects what's rendered. */\n @property({ type: Boolean, reflect: true, attribute: \"no-topbar\" }) noTopbar = false;\n\n /** Whether the viewport is at/below the 48rem breakpoint. */\n @state() private _mobile = false;\n /** Whether the footer slot has assigned content. */\n @state() private _hasFooter = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n block-size: 100%;\n }\n .shell {\n --_sidebar-w: 0px;\n --_detail-w: 0px;\n display: grid;\n grid-template-columns: var(--_sidebar-w) minmax(0, 1fr) var(--_detail-w);\n grid-template-rows: auto minmax(0, 1fr) auto;\n grid-template-areas:\n \"topbar topbar topbar\"\n \"sidebar main detail\"\n \"sidebar footer footer\";\n position: relative;\n block-size: 100%;\n min-height: 0;\n background: var(--ui-surface, #ffffff);\n }\n /* no-topbar drops the topbar row from the grid rather than rendering\n an empty one — the header element itself is skipped in render(). */\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"sidebar main detail\"\n \"sidebar footer footer\";\n }\n :host([detail-open]) .shell {\n --_detail-w: 20rem;\n }\n :host([detail-open][detail-width=\"comfortable\"]) .shell {\n --_detail-w: 25rem;\n }\n /* Push mode reserves a real grid column, sized only while open — the\n column width doesn't animate (custom properties feeding a grid\n track don't transition smoothly without @property registration),\n so push mode's open/close is an instant snap, unlike overlay\n mode's sliding transform. */\n :host([sidebar-mode=\"push\"][sidebar-open]) .shell {\n --_sidebar-w: var(--component-sidebar-width, 16rem);\n }\n :host([sidebar-mode=\"push\"][sidebar-open][sidebar-width=\"icon\"]) .shell {\n --_sidebar-w: var(--component-sidebar-rail-width, 3.5rem);\n }\n .sidebar {\n /* No grid-area here: an absolutely-positioned grid item's inset\n properties resolve against its OWN grid area's box, not the\n whole grid container, once grid-area is set — even with\n explicit (non-auto) insets. Overlay mode must stay anchored to\n the whole .shell (to overlap the topbar row), so grid-area is\n assigned only in push mode below, where the sidebar is a real,\n in-flow grid item instead of an absolutely-positioned one. */\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: var(--component-sidebar-width, 16rem);\n z-index: 40;\n overflow: hidden;\n border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n transform: translateX(-100%);\n transition: transform 150ms ease;\n }\n :host([sidebar-open]) .sidebar {\n transform: translateX(0);\n }\n :host([sidebar-open]:not([sidebar-mode=\"push\"])) .sidebar {\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n :host([sidebar-width=\"icon\"]) .sidebar {\n width: var(--component-sidebar-rail-width, 3.5rem);\n }\n :host([sidebar-mode=\"push\"]) .sidebar {\n grid-area: sidebar;\n position: static;\n width: 100%;\n transform: none;\n }\n .topbar {\n grid-area: topbar;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: var(--component-topbar-height, 3rem);\n padding: 0.5rem 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n /* Deliberately no z-index here: an explicit z-index on a CSS grid\n item creates a stacking context, which would trap .nav-toggle\n below .sidebar once an overlay-mode sidebar opens and covers this\n corner. See CLAUDE.md before adding one. */\n }\n .nav-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: none;\n border: none;\n cursor: pointer;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .nav-group {\n position: relative;\n z-index: 41;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n flex: 0 0 auto;\n }\n .nav-tip {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 0.25rem;\n z-index: 10;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n white-space: nowrap;\n padding: 0.25rem 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-tooltip, #0f172a);\n color: var(--ui-on-accent, #ffffff);\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 font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 120ms ease;\n }\n .nav-toggle:hover + .nav-tip,\n .nav-toggle:focus-visible + .nav-tip {\n opacity: 1;\n visibility: visible;\n }\n .nav-toggle:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .nav-toggle:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .topbar-content {\n flex: 1 1 auto;\n min-width: 0;\n }\n .main {\n grid-area: main;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n padding: 1rem;\n background: var(--component-main-background, var(--ui-surface, #ffffff));\n }\n .detail {\n grid-area: detail;\n display: none;\n min-height: 0;\n overflow: auto;\n border-left: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n :host([detail-open]) .detail {\n display: block;\n }\n .footer {\n grid-area: footer;\n padding: 0.5rem 0.75rem;\n border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n .footer.empty {\n display: none;\n }\n .scrim {\n display: none;\n }\n @media (max-width: 48rem) {\n .shell {\n grid-template-columns: minmax(0, 1fr) var(--_detail-w);\n grid-template-areas:\n \"topbar topbar\"\n \"main detail\"\n \"footer footer\";\n }\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"main detail\"\n \"footer footer\";\n }\n /* Mobile is always a full-screen, position:absolute overlay drawer,\n regardless of sidebar-mode/sidebar-width — those two properties\n only affect the desktop presentation. A full-width sidebar sits\n above .scrim (z-index 40 vs 39), so .scrim's click target is only\n reachable on desktop, where the sidebar doesn't span the whole\n shell — Escape is the mobile dismiss path (see app-shell.spec.ts). */\n .sidebar,\n :host([sidebar-mode=\"push\"]) .sidebar {\n position: absolute;\n width: 100%;\n }\n .detail {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--_detail-w, 20rem);\n max-width: calc(100vw - 3rem);\n z-index: 40;\n transform: translateX(110%);\n transition: transform 250ms ease;\n }\n :host([detail-open]) .detail {\n transform: translateX(0);\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n .scrim.show {\n display: block;\n position: absolute;\n inset: 0;\n z-index: 39;\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .detail,\n .nav-tip {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .nav-toggle:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .nav-tip {\n border: 1px solid CanvasText;\n }\n }\n `,\n ];\n\n private _mediaQuery: MediaQueryList | null = null;\n private _previousFocus: HTMLElement | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._mediaQuery = window.matchMedia(\"(max-width: 48rem)\");\n this._mobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n window.addEventListener(\"keydown\", this._onKeydown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this._mediaQuery = null;\n window.removeEventListener(\"keydown\", this._onKeydown);\n }\n\n /** Tracks the breakpoint the sidebar's width and modality depend on. */\n private _onMediaChange = (event: MediaQueryListEvent): void => {\n this._mobile = event.matches;\n };\n\n /** Handles the `[` sidebar shortcut and Escape dismissal of mobile overlays. */\n private _onKeydown = (event: KeyboardEvent): void => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\" && this._mobile) {\n if (this.detailOpen) {\n event.preventDefault();\n this._closeDetail();\n } else if (this.sidebarOpen) {\n event.preventDefault();\n this.sidebarOpen = false;\n }\n return;\n }\n if (\n event.key === \"[\" &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !this._isEditableTarget(event)\n ) {\n event.preventDefault();\n this._toggleSidebar();\n }\n };\n\n /** Whether the keydown originated in a text field, so the shortcut defers to typing. */\n private _isEditableTarget(event: KeyboardEvent): boolean {\n const target = event.composedPath()[0] as HTMLElement | undefined;\n if (!target) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n }\n\n /** Toggles the sidebar and announces it. */\n private _toggleSidebar(): void {\n this.sidebarOpen = !this.sidebarOpen;\n if (this._mobile && this.sidebarOpen) {\n this._previousFocus = document.activeElement as HTMLElement | null;\n }\n this.dispatchEvent(\n new CustomEvent<SidebarToggleDetail>(\"sidebar-toggle\", {\n detail: { open: this.sidebarOpen },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Closes the detail overlay and notifies the consumer that owns `detail-open`. */\n private _closeDetail(): void {\n this.detailOpen = false;\n this.dispatchEvent(new CustomEvent(\"detail-close\", { bubbles: true, composed: true }));\n }\n\n /** Scrim click dismisses whichever overlay is open. */\n private _onScrim(): void {\n if (this.detailOpen) this._closeDetail();\n if (this.sidebarOpen) this.sidebarOpen = false;\n }\n\n /** Mirrors `sidebar-width` onto the slotted sidebar's `collapsed` (icon rail) attribute. */\n private _syncSidebarWidth(): void {\n const icon = this.sidebarWidth === \"icon\";\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"sidebar\"]');\n for (const element of slot?.assignedElements() ?? []) {\n element.toggleAttribute(\"collapsed\", icon);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"sidebarWidth\")) this._syncSidebarWidth();\n if (!changed.has(\"sidebarOpen\") || !this._mobile) return;\n if (this.sidebarOpen) {\n this.shadowRoot?.querySelector<HTMLElement>(\".sidebar\")?.focus();\n return;\n }\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override render() {\n const scrimActive = this._mobile && (this.sidebarOpen || this.detailOpen);\n return html`\n <div class=\"shell\">\n <aside\n class=\"sidebar\"\n tabindex=\"-1\"\n aria-label=\"Primary\"\n ?inert=${!this.sidebarOpen}\n aria-hidden=${String(!this.sidebarOpen)}\n >\n <slot name=\"sidebar\" @slotchange=${this._syncSidebarWidth}></slot>\n </aside>\n ${this.noTopbar\n ? nothing\n : html`\n <header class=\"topbar\">\n <div class=\"nav-group\">\n <button\n class=\"nav-toggle\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n aria-keyshortcuts=\"[\"\n aria-describedby=\"nav-tip\"\n aria-expanded=${String(this.sidebarOpen)}\n @click=${this._toggleSidebar}\n >\n ${iconBars3(18)}\n </button>\n <span class=\"nav-tip\" id=\"nav-tip\" role=\"tooltip\">\n <span>${this.sidebarOpen ? \"Hide navigation\" : \"Show navigation\"}</span>\n <kbd-hint keys=\"[\"></kbd-hint>\n </span>\n </div>\n <div class=\"topbar-content\"><slot name=\"topbar\"></slot></div>\n </header>\n `}\n <main class=\"main\"><slot></slot></main>\n <aside\n class=\"detail\"\n aria-label=\"Detail\"\n ?inert=${!this.detailOpen}\n aria-hidden=${String(!this.detailOpen)}\n >\n <slot name=\"detail\"></slot>\n </aside>\n <footer class=\"footer ${this._hasFooter ? \"\" : \"empty\"}\">\n <slot name=\"footer\" @slotchange=${this._onFooterSlotChange}></slot>\n </footer>\n <button\n class=\"scrim ${scrimActive ? \"show\" : \"\"}\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Close\"\n @click=${this._onScrim}\n ?hidden=${!scrimActive}\n ></button>\n </div>\n `;\n }\n\n /** Collapses the footer row when nothing is slotted into it. */\n private _onFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"app-shell\": AppShell;\n }\n}\n"]}
1
+ {"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../src/app-shell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QACL,0EAA0E;QACH,gBAAW,GAAG,KAAK,CAAC;QAC3F,uGAAuG;QAC/C,gBAAW,GAAuB,SAAS,CAAC;QACpG,uGAAuG;QAC9C,iBAAY,GAAoB,MAAM,CAAC;QAChG,gFAAgF;QACV,eAAU,GAAG,KAAK,CAAC;QACzF,gEAAgE;QACvB,gBAAW,GAA8B,SAAS,CAAC;QAC5F,+MAA+M;QAC3I,aAAQ,GAAG,KAAK,CAAC;QAErF,6DAA6D;QAC5C,YAAO,GAAG,KAAK,CAAC;QACjC,oDAAoD;QACnC,eAAU,GAAG,KAAK,CAAC;QA0Q5B,gBAAW,GAA0B,IAAI,CAAC;QAC1C,mBAAc,GAAuB,IAAI,CAAC;QAiBlD,wEAAwE;QAChE,mBAAc,GAAG,CAAC,KAA0B,EAAQ,EAAE;YAC5D,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC;QAEF,gFAAgF;QACxE,eAAU,GAAG,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I,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAAqB;AAEnC;IAAvD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAA6C;AAE3C;IAAxD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;8CAAwC;AAE1B;IAArE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;4CAAoB;AAEhD;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAAoD;AAExB;IAAnE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;0CAAkB;AAGpE;IAAhB,KAAK,EAAE;yCAAyB;AAEhB;IAAhB,KAAK,EAAE;4CAA4B;AAjBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAocpB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconBars3 } from \"./icons.js\";\nimport \"./kbd-hint.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** Fired when the built-in toggle changes the sidebar state. */\nexport interface SidebarToggleDetail {\n /** Whether the sidebar is now open. */\n open: boolean;\n}\n\n/**\n * The dashboard page shell: a slot-based CSS-grid backbone that arranges a\n * top bar, the main content, an optional right-hand detail column, an\n * optional footer, and a sidebar. The top bar always spans the shell's full\n * width, in every sidebar state.\n *\n * The sidebar's visibility, width, and layout mode are three independent\n * properties:\n * - `sidebar-open` (default closed) — whether it's shown at all.\n * - `sidebar-width`: `\"full\"` (16rem, icons + labels, the default) or\n * `\"icon\"` (3.5rem rail, icons only — drives the slotted `app-sidebar`'s\n * own `collapsed` attribute).\n * - `sidebar-mode`: `\"overlay\"` (the default) floats the sidebar above the\n * shell's own content with a higher z-index, covering part of the top\n * bar's corner and whatever content sits beneath it, without ever\n * resizing or reflowing `main`/`footer`. `\"push\"` instead reserves a real\n * grid column beside `main`/`footer` (which resize to make room) — the\n * top bar still spans full width above it either way.\n *\n * Below the shared 48rem breakpoint the sidebar always behaves as a\n * full-width, modal, scrim/Escape-dismissible drawer regardless of\n * `sidebar-mode`/`sidebar-width` — those two properties only affect the\n * desktop presentation. Above 48rem, an `overlay`-mode sidebar is a\n * non-modal panel (no dimming scrim, no Escape-dismiss, since it reads as\n * an ordinary always-interactive panel rather than a blocking dialog); a\n * `push`-mode sidebar is even more clearly non-modal, since it never\n * covers anything.\n *\n * The right-hand detail column is unaffected by any of the above: it still\n * reserves an inline grid column on desktop and becomes a dismissible\n * overlay (scrim/Escape) on mobile.\n *\n * Widths are tunable per instance via `--component-sidebar-width` (16rem),\n * `--component-sidebar-rail-width` (3.5rem), and `--component-topbar-height`\n * (3rem); the detail column reuses the 20rem/25rem panel widths. The main\n * content area is white by default — override it with\n * `--component-main-background`. Give the shell a height (e.g. `height:\n * 100vh`) so the sidebar and main can size and scroll.\n *\n * Hovering or keyboard-focusing the toggle reveals a tooltip naming the\n * action and its `[` shortcut — the shortcut is not shown as permanent\n * chrome.\n *\n * Consumers with their own external top bar can set `no-topbar` to skip\n * rendering the built-in topbar row and toggle button entirely (the grid\n * drops that row rather than leaving dead space). The `[`/Escape shortcuts\n * stay fully active either way — drive `sidebar-open` from your own UI and\n * listen for `sidebar-toggle` to stay in sync with keyboard-driven changes.\n *\n * @element app-shell\n * @slot - Main content area.\n * @slot sidebar - Sidebar navigation (typically `app-sidebar`).\n * @slot topbar - Top bar content, right of the built-in toggle.\n * @slot detail - Optional right-hand detail; shown when `detail-open` is set.\n * @slot footer - Optional footer beneath the main content.\n * @fires sidebar-toggle - The built-in toggle changed the sidebar state.\n * @fires detail-close - The scrim or Escape dismissed the mobile detail overlay.\n */\n@customElement(\"app-shell\")\nexport class AppShell extends LitElement {\n /** Whether the sidebar is open. Closed by default at every breakpoint. */\n @property({ type: Boolean, reflect: true, attribute: \"sidebar-open\" }) sidebarOpen = false;\n /** `\"overlay\"` (default) floats the sidebar above content; `\"push\"` reserves a grid column instead. */\n @property({ reflect: true, attribute: \"sidebar-mode\" }) sidebarMode: \"overlay\" | \"push\" = \"overlay\";\n /** Sidebar width when open: `\"full\"` (16rem, icons + labels) or `\"icon\"` (3.5rem rail, icons only). */\n @property({ reflect: true, attribute: \"sidebar-width\" }) sidebarWidth: \"full\" | \"icon\" = \"full\";\n /** Shows the right-hand detail region (inline column, or overlay on mobile). */\n @property({ type: Boolean, reflect: true, attribute: \"detail-open\" }) detailOpen = false;\n /** Detail width: `compact` (20rem) or `comfortable` (25rem). */\n @property({ attribute: \"detail-width\" }) detailWidth: \"compact\" | \"comfortable\" = \"compact\";\n /** Skips rendering the built-in topbar row and its nav toggle entirely, for consumers with their own external top bar. The `[`/Escape shortcuts stay active regardless — this only affects what's rendered. */\n @property({ type: Boolean, reflect: true, attribute: \"no-topbar\" }) noTopbar = false;\n\n /** Whether the viewport is at/below the 48rem breakpoint. */\n @state() private _mobile = false;\n /** Whether the footer slot has assigned content. */\n @state() private _hasFooter = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n block-size: 100%;\n }\n .shell {\n --_sidebar-w: 0px;\n --_detail-w: 0px;\n display: grid;\n grid-template-columns: var(--_sidebar-w) minmax(0, 1fr) var(--_detail-w);\n grid-template-rows: auto minmax(0, 1fr) auto;\n grid-template-areas:\n \"topbar topbar topbar\"\n \"sidebar main detail\"\n \"sidebar footer footer\";\n position: relative;\n block-size: 100%;\n min-height: 0;\n background: var(--ui-surface, #ffffff);\n }\n /* no-topbar drops the topbar row from the grid rather than rendering\n an empty one — the header element itself is skipped in render(). */\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"sidebar main detail\"\n \"sidebar footer footer\";\n }\n :host([detail-open]) .shell {\n --_detail-w: 20rem;\n }\n :host([detail-open][detail-width=\"comfortable\"]) .shell {\n --_detail-w: 25rem;\n }\n /* Push mode reserves a real grid column, sized only while open — the\n column width doesn't animate (custom properties feeding a grid\n track don't transition smoothly without @property registration),\n so push mode's open/close is an instant snap, unlike overlay\n mode's sliding transform. */\n :host([sidebar-mode=\"push\"][sidebar-open]) .shell {\n --_sidebar-w: var(--component-sidebar-width, 16rem);\n }\n :host([sidebar-mode=\"push\"][sidebar-open][sidebar-width=\"icon\"]) .shell {\n --_sidebar-w: var(--component-sidebar-rail-width, 3.5rem);\n }\n .sidebar {\n /* No grid-area here: an absolutely-positioned grid item's inset\n properties resolve against its OWN grid area's box, not the\n whole grid container, once grid-area is set — even with\n explicit (non-auto) insets. Overlay mode must stay anchored to\n the whole .shell (to overlap the topbar row), so grid-area is\n assigned only in push mode below, where the sidebar is a real,\n in-flow grid item instead of an absolutely-positioned one. */\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: var(--component-sidebar-width, 16rem);\n z-index: 40;\n overflow: hidden;\n border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n transform: translateX(-100%);\n transition: transform 150ms ease;\n }\n :host([sidebar-open]) .sidebar {\n transform: translateX(0);\n }\n :host([sidebar-open]:not([sidebar-mode=\"push\"])) .sidebar {\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n :host([sidebar-width=\"icon\"]) .sidebar {\n width: var(--component-sidebar-rail-width, 3.5rem);\n }\n :host([sidebar-mode=\"push\"]) .sidebar {\n grid-area: sidebar;\n position: static;\n width: 100%;\n transform: none;\n }\n .topbar {\n grid-area: topbar;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: var(--component-topbar-height, 3rem);\n padding: 0.5rem 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n /* Deliberately no z-index here: an explicit z-index on a CSS grid\n item creates a stacking context, which would trap .nav-toggle\n below .sidebar once an overlay-mode sidebar opens and covers this\n corner. See CLAUDE.md before adding one. */\n }\n .nav-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: none;\n border: none;\n cursor: pointer;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .nav-group {\n position: relative;\n z-index: 41;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n flex: 0 0 auto;\n }\n .nav-tip {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 0.25rem;\n z-index: 10;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n white-space: nowrap;\n padding: 0.25rem 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-tooltip, #0f172a);\n color: var(--ui-tooltip-text, #ffffff);\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 font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 120ms ease;\n }\n .nav-toggle:hover + .nav-tip,\n .nav-toggle:focus-visible + .nav-tip {\n opacity: 1;\n visibility: visible;\n }\n .nav-toggle:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .nav-toggle:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .topbar-content {\n flex: 1 1 auto;\n min-width: 0;\n }\n .main {\n grid-area: main;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n padding: 1rem;\n background: var(--component-main-background, var(--ui-surface, #ffffff));\n }\n .detail {\n grid-area: detail;\n display: none;\n min-height: 0;\n overflow: auto;\n border-left: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n :host([detail-open]) .detail {\n display: block;\n }\n .footer {\n grid-area: footer;\n padding: 0.5rem 0.75rem;\n border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n .footer.empty {\n display: none;\n }\n .scrim {\n display: none;\n }\n @media (max-width: 48rem) {\n .shell {\n grid-template-columns: minmax(0, 1fr) var(--_detail-w);\n grid-template-areas:\n \"topbar topbar\"\n \"main detail\"\n \"footer footer\";\n }\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"main detail\"\n \"footer footer\";\n }\n /* Mobile is always a full-screen, position:absolute overlay drawer,\n regardless of sidebar-mode/sidebar-width — those two properties\n only affect the desktop presentation. A full-width sidebar sits\n above .scrim (z-index 40 vs 39), so .scrim's click target is only\n reachable on desktop, where the sidebar doesn't span the whole\n shell — Escape is the mobile dismiss path (see app-shell.spec.ts). */\n .sidebar,\n :host([sidebar-mode=\"push\"]) .sidebar {\n position: absolute;\n width: 100%;\n }\n .detail {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--_detail-w, 20rem);\n max-width: calc(100vw - 3rem);\n z-index: 40;\n transform: translateX(110%);\n transition: transform 250ms ease;\n }\n :host([detail-open]) .detail {\n transform: translateX(0);\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n .scrim.show {\n display: block;\n position: absolute;\n inset: 0;\n z-index: 39;\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .detail,\n .nav-tip {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .nav-toggle:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .nav-tip {\n border: 1px solid CanvasText;\n }\n }\n `,\n ];\n\n private _mediaQuery: MediaQueryList | null = null;\n private _previousFocus: HTMLElement | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._mediaQuery = window.matchMedia(\"(max-width: 48rem)\");\n this._mobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n window.addEventListener(\"keydown\", this._onKeydown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this._mediaQuery = null;\n window.removeEventListener(\"keydown\", this._onKeydown);\n }\n\n /** Tracks the breakpoint the sidebar's width and modality depend on. */\n private _onMediaChange = (event: MediaQueryListEvent): void => {\n this._mobile = event.matches;\n };\n\n /** Handles the `[` sidebar shortcut and Escape dismissal of mobile overlays. */\n private _onKeydown = (event: KeyboardEvent): void => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\" && this._mobile) {\n if (this.detailOpen) {\n event.preventDefault();\n this._closeDetail();\n } else if (this.sidebarOpen) {\n event.preventDefault();\n this.sidebarOpen = false;\n }\n return;\n }\n if (\n event.key === \"[\" &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !this._isEditableTarget(event)\n ) {\n event.preventDefault();\n this._toggleSidebar();\n }\n };\n\n /** Whether the keydown originated in a text field, so the shortcut defers to typing. */\n private _isEditableTarget(event: KeyboardEvent): boolean {\n const target = event.composedPath()[0] as HTMLElement | undefined;\n if (!target) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n }\n\n /** Toggles the sidebar and announces it. */\n private _toggleSidebar(): void {\n this.sidebarOpen = !this.sidebarOpen;\n if (this._mobile && this.sidebarOpen) {\n this._previousFocus = document.activeElement as HTMLElement | null;\n }\n this.dispatchEvent(\n new CustomEvent<SidebarToggleDetail>(\"sidebar-toggle\", {\n detail: { open: this.sidebarOpen },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Closes the detail overlay and notifies the consumer that owns `detail-open`. */\n private _closeDetail(): void {\n this.detailOpen = false;\n this.dispatchEvent(new CustomEvent(\"detail-close\", { bubbles: true, composed: true }));\n }\n\n /** Scrim click dismisses whichever overlay is open. */\n private _onScrim(): void {\n if (this.detailOpen) this._closeDetail();\n if (this.sidebarOpen) this.sidebarOpen = false;\n }\n\n /** Mirrors `sidebar-width` onto the slotted sidebar's `collapsed` (icon rail) attribute. */\n private _syncSidebarWidth(): void {\n const icon = this.sidebarWidth === \"icon\";\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"sidebar\"]');\n for (const element of slot?.assignedElements() ?? []) {\n element.toggleAttribute(\"collapsed\", icon);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"sidebarWidth\")) this._syncSidebarWidth();\n if (!changed.has(\"sidebarOpen\") || !this._mobile) return;\n if (this.sidebarOpen) {\n this.shadowRoot?.querySelector<HTMLElement>(\".sidebar\")?.focus();\n return;\n }\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override render() {\n const scrimActive = this._mobile && (this.sidebarOpen || this.detailOpen);\n return html`\n <div class=\"shell\">\n <aside\n class=\"sidebar\"\n tabindex=\"-1\"\n aria-label=\"Primary\"\n ?inert=${!this.sidebarOpen}\n aria-hidden=${String(!this.sidebarOpen)}\n >\n <slot name=\"sidebar\" @slotchange=${this._syncSidebarWidth}></slot>\n </aside>\n ${this.noTopbar\n ? nothing\n : html`\n <header class=\"topbar\">\n <div class=\"nav-group\">\n <button\n class=\"nav-toggle\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n aria-keyshortcuts=\"[\"\n aria-describedby=\"nav-tip\"\n aria-expanded=${String(this.sidebarOpen)}\n @click=${this._toggleSidebar}\n >\n ${iconBars3(18)}\n </button>\n <span class=\"nav-tip\" id=\"nav-tip\" role=\"tooltip\">\n <span>${this.sidebarOpen ? \"Hide navigation\" : \"Show navigation\"}</span>\n <kbd-hint keys=\"[\"></kbd-hint>\n </span>\n </div>\n <div class=\"topbar-content\"><slot name=\"topbar\"></slot></div>\n </header>\n `}\n <main class=\"main\"><slot></slot></main>\n <aside\n class=\"detail\"\n aria-label=\"Detail\"\n ?inert=${!this.detailOpen}\n aria-hidden=${String(!this.detailOpen)}\n >\n <slot name=\"detail\"></slot>\n </aside>\n <footer class=\"footer ${this._hasFooter ? \"\" : \"empty\"}\">\n <slot name=\"footer\" @slotchange=${this._onFooterSlotChange}></slot>\n </footer>\n <button\n class=\"scrim ${scrimActive ? \"show\" : \"\"}\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Close\"\n @click=${this._onScrim}\n ?hidden=${!scrimActive}\n ></button>\n </div>\n `;\n }\n\n /** Collapses the footer row when nothing is slotted into it. */\n private _onFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"app-shell\": AppShell;\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A small inline blinking cursor glyph for terminal- or editor-styled
4
+ * headings, prompts, and status lines. It renders its own decorative
5
+ * character so consumers can append it directly to adjacent text while
6
+ * inheriting the surrounding typography.
7
+ *
8
+ * The cursor uses the shared `--ui-primary` accent color so it reads as an
9
+ * active insertion point across themes. Change `char` to swap the glyph (for
10
+ * example `|` or `▋`). Under `prefers-reduced-motion` the blink stops and the
11
+ * cursor remains visible.
12
+ *
13
+ * @element blink-cursor
14
+ */
15
+ export declare class BlinkCursor extends LitElement {
16
+ static styles: import("lit").CSSResult[];
17
+ /** Character shown for the cursor; any single character or short string such as `|` or `▋` works. */
18
+ char: string;
19
+ connectedCallback(): void;
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ "blink-cursor": BlinkCursor;
25
+ }
26
+ }
27
+ //# sourceMappingURL=blink-cursor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blink-cursor.d.ts","sourceRoot":"","sources":["../src/blink-cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C;;;;;;;;;;;;GAYG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,4BAiCpB;IAEF,qGAAqG;IACzF,IAAI,SAAO;IAEd,iBAAiB,IAAI,IAAI,CAGjC;IAEQ,MAAM,yCAEd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -0,0 +1,78 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, css, html } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { tokens } from "./tokens.js";
10
+ /**
11
+ * A small inline blinking cursor glyph for terminal- or editor-styled
12
+ * headings, prompts, and status lines. It renders its own decorative
13
+ * character so consumers can append it directly to adjacent text while
14
+ * inheriting the surrounding typography.
15
+ *
16
+ * The cursor uses the shared `--ui-primary` accent color so it reads as an
17
+ * active insertion point across themes. Change `char` to swap the glyph (for
18
+ * example `|` or `▋`). Under `prefers-reduced-motion` the blink stops and the
19
+ * cursor remains visible.
20
+ *
21
+ * @element blink-cursor
22
+ */
23
+ let BlinkCursor = class BlinkCursor extends LitElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ /** Character shown for the cursor; any single character or short string such as `|` or `▋` works. */
27
+ this.char = "▋";
28
+ }
29
+ static { this.styles = [
30
+ tokens,
31
+ css `
32
+ :host {
33
+ display: inline-block;
34
+ line-height: var(--ui-line-height-glyph, 1);
35
+ color: var(--ui-primary, #4f46e5);
36
+ }
37
+
38
+ .cursor {
39
+ display: inline-block;
40
+ white-space: pre;
41
+ animation: blink-cursor-blink 1s steps(1, end) infinite;
42
+ }
43
+
44
+ @keyframes blink-cursor-blink {
45
+ 0%,
46
+ 50% {
47
+ opacity: 1;
48
+ }
49
+ 50.01%,
50
+ 100% {
51
+ opacity: 0;
52
+ }
53
+ }
54
+
55
+ @media (prefers-reduced-motion: reduce) {
56
+ .cursor {
57
+ animation: none;
58
+ opacity: 1;
59
+ }
60
+ }
61
+ `,
62
+ ]; }
63
+ connectedCallback() {
64
+ super.connectedCallback();
65
+ this.setAttribute("aria-hidden", "true");
66
+ }
67
+ render() {
68
+ return html `<span class="cursor">${this.char}</span>`;
69
+ }
70
+ };
71
+ __decorate([
72
+ property()
73
+ ], BlinkCursor.prototype, "char", void 0);
74
+ BlinkCursor = __decorate([
75
+ customElement("blink-cursor")
76
+ ], BlinkCursor);
77
+ export { BlinkCursor };
78
+ //# sourceMappingURL=blink-cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blink-cursor.js","sourceRoot":"","sources":["../src/blink-cursor.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;;;;;;;;;;;;GAYG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAoCL,qGAAqG;QACzF,SAAI,GAAG,GAAG,CAAC;IAUzB,CAAC;aA9CiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;KACF,AAjCqB,CAiCpB;IAKO,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,wBAAwB,IAAI,CAAC,IAAI,SAAS,CAAC;IACxD,CAAC;CACF,CAAA;AAVa;IAAX,QAAQ,EAAE;yCAAY;AArCZ,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA+CvB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A small inline blinking cursor glyph for terminal- or editor-styled\n * headings, prompts, and status lines. It renders its own decorative\n * character so consumers can append it directly to adjacent text while\n * inheriting the surrounding typography.\n *\n * The cursor uses the shared `--ui-primary` accent color so it reads as an\n * active insertion point across themes. Change `char` to swap the glyph (for\n * example `|` or `▋`). Under `prefers-reduced-motion` the blink stops and the\n * cursor remains visible.\n *\n * @element blink-cursor\n */\n@customElement(\"blink-cursor\")\nexport class BlinkCursor extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n line-height: var(--ui-line-height-glyph, 1);\n color: var(--ui-primary, #4f46e5);\n }\n\n .cursor {\n display: inline-block;\n white-space: pre;\n animation: blink-cursor-blink 1s steps(1, end) infinite;\n }\n\n @keyframes blink-cursor-blink {\n 0%,\n 50% {\n opacity: 1;\n }\n 50.01%,\n 100% {\n opacity: 0;\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cursor {\n animation: none;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Character shown for the cursor; any single character or short string such as `|` or `▋` works. */\n @property() char = \"▋\";\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute(\"aria-hidden\", \"true\");\n }\n\n override render() {\n return html`<span class=\"cursor\">${this.char}</span>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"blink-cursor\": BlinkCursor;\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { LitElement } from "lit";
2
+ /** The visual treatment for one diff line. */
3
+ export type CodeDiffLineType = "add" | "del" | "context";
4
+ /** One ordered line in the diff body. */
5
+ export interface CodeDiffLine {
6
+ /** Whether the line is added, removed, or unchanged context. */
7
+ type: CodeDiffLineType;
8
+ /** The plain code text for the line, without the rendered diff prefix. */
9
+ text: string;
10
+ }
11
+ /**
12
+ * A compact, read-only code diff viewer: a bordered panel with a header bar
13
+ * for `filename` and `stat`, followed by a numbered `<pre>` listing of
14
+ * `lines`. Each {@link CodeDiffLine} renders as `"add"`, `"del"`, or
15
+ * `"context"` with fixed `"+ "` / `"- "` / `" "` prefixes so the diff
16
+ * remains understandable even when color is unavailable.
17
+ *
18
+ * Added and removed rows reuse `--ui-success` / `--ui-danger` for their text
19
+ * and low-alpha background washes, while the shell itself reuses
20
+ * `--ui-font-mono`, `--ui-border`, and `--ui-surface`. The caller owns the
21
+ * data shape entirely: `filename` and `stat` are passed through verbatim, and
22
+ * `lines` is a flat ordered array of `{ type, text }` objects.
23
+ *
24
+ * @element code-diff
25
+ */
26
+ export declare class CodeDiff extends LitElement {
27
+ static styles: import("lit").CSSResult[];
28
+ /** The filename shown in the header bar's left side. */
29
+ filename: string;
30
+ /** The caller-supplied stat summary shown in the header bar's right side. */
31
+ stat: string;
32
+ /** Ordered diff lines, each rendered with its type-driven prefix and styling. */
33
+ lines: CodeDiffLine[];
34
+ render(): import("lit-html").TemplateResult<1>;
35
+ }
36
+ declare global {
37
+ interface HTMLElementTagNameMap {
38
+ "code-diff": CodeDiff;
39
+ }
40
+ }
41
+ //# sourceMappingURL=code-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-diff.d.ts","sourceRoot":"","sources":["../src/code-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAK5C,8CAA8C;AAC9C,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAEzD,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,IAAI,EAAE,gBAAgB,CAAC;IACvB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,OAAgB,MAAM,4BA6FpB;IAEF,wDAAwD;IAC5C,QAAQ,SAAM;IAE1B,6EAA6E;IACjE,IAAI,SAAM;IAEtB,iFAAiF;IACtD,KAAK,EAAE,YAAY,EAAE,CAAM;IAE7C,MAAM,yCAmBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -0,0 +1,161 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, css, html } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { repeat } from "lit/directives/repeat.js";
10
+ import { tokens } from "./tokens.js";
11
+ /**
12
+ * A compact, read-only code diff viewer: a bordered panel with a header bar
13
+ * for `filename` and `stat`, followed by a numbered `<pre>` listing of
14
+ * `lines`. Each {@link CodeDiffLine} renders as `"add"`, `"del"`, or
15
+ * `"context"` with fixed `"+ "` / `"- "` / `" "` prefixes so the diff
16
+ * remains understandable even when color is unavailable.
17
+ *
18
+ * Added and removed rows reuse `--ui-success` / `--ui-danger` for their text
19
+ * and low-alpha background washes, while the shell itself reuses
20
+ * `--ui-font-mono`, `--ui-border`, and `--ui-surface`. The caller owns the
21
+ * data shape entirely: `filename` and `stat` are passed through verbatim, and
22
+ * `lines` is a flat ordered array of `{ type, text }` objects.
23
+ *
24
+ * @element code-diff
25
+ */
26
+ let CodeDiff = class CodeDiff extends LitElement {
27
+ constructor() {
28
+ super(...arguments);
29
+ /** The filename shown in the header bar's left side. */
30
+ this.filename = "";
31
+ /** The caller-supplied stat summary shown in the header bar's right side. */
32
+ this.stat = "";
33
+ /** Ordered diff lines, each rendered with its type-driven prefix and styling. */
34
+ this.lines = [];
35
+ }
36
+ static { this.styles = [
37
+ tokens,
38
+ css `
39
+ :host {
40
+ display: block;
41
+ }
42
+ .panel {
43
+ overflow: hidden;
44
+ border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
45
+ border-radius: var(--ui-radius, 0.5rem);
46
+ background: var(--ui-surface, #ffffff);
47
+ color: var(--ui-text, #0f172a);
48
+ font-family: var(
49
+ --ui-font-mono,
50
+ ui-monospace,
51
+ SFMono-Regular,
52
+ Menlo,
53
+ Monaco,
54
+ Consolas,
55
+ monospace
56
+ );
57
+ font-size: var(--ui-font-size-sm, 0.75rem);
58
+ line-height: var(--ui-line-height-normal, 1.5);
59
+ }
60
+ .bar {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ gap: 1rem;
65
+ padding: 0.5rem 0.75rem;
66
+ border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
67
+ color: var(--ui-text-muted, #64748b);
68
+ font-variant-numeric: var(--ui-numeric, normal);
69
+ }
70
+ .filename {
71
+ min-width: 0;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ white-space: nowrap;
75
+ }
76
+ .stat {
77
+ flex: 0 0 auto;
78
+ white-space: nowrap;
79
+ }
80
+ .body {
81
+ margin: 0;
82
+ overflow-x: auto;
83
+ background: var(--ui-surface, #ffffff);
84
+ }
85
+ .line {
86
+ display: grid;
87
+ grid-template-columns: 4ch minmax(0, 1fr);
88
+ }
89
+ .number {
90
+ box-sizing: border-box;
91
+ padding: 0.25rem 0.5rem 0.25rem 0;
92
+ border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);
93
+ color: var(--ui-text-muted, #64748b);
94
+ font-variant-numeric: tabular-nums;
95
+ text-align: right;
96
+ user-select: none;
97
+ }
98
+ .text {
99
+ min-width: 0;
100
+ padding: 0.25rem 0.75rem;
101
+ }
102
+ .line.context {
103
+ color: var(--ui-text-muted, #64748b);
104
+ }
105
+ /* Derived from the light theme's --ui-success/#16a34a and
106
+ --ui-danger/#dc2626 fallbacks; there is no dedicated diff-wash token. */
107
+ .line.add {
108
+ background: rgb(22 163 74 / 0.1);
109
+ color: var(--ui-success, #16a34a);
110
+ }
111
+ .line.del {
112
+ background: rgb(220 38 38 / 0.1);
113
+ color: var(--ui-danger, #dc2626);
114
+ }
115
+ @media (forced-colors: active) {
116
+ .panel {
117
+ border: 1px solid CanvasText;
118
+ background: Canvas;
119
+ }
120
+ .bar,
121
+ .number {
122
+ border-color: CanvasText;
123
+ }
124
+ .line {
125
+ background: transparent;
126
+ }
127
+ }
128
+ `,
129
+ ]; }
130
+ render() {
131
+ return html `
132
+ <div class="panel">
133
+ <!-- Keep the bar even when both values are blank so the shell stays stable. -->
134
+ <div class="bar">
135
+ <span class="filename">${this.filename}</span>
136
+ <span class="stat">${this.stat}</span>
137
+ </div>
138
+ <pre class="body">${repeat(this.lines,
139
+ // Fixed diffs do not reorder lines, so the display index is the deliberate stable key.
140
+ (_line, index) => index, (line, index) => {
141
+ const prefix = line.type === "add" ? "+ " : line.type === "del" ? "- " : " ";
142
+ return html `<span class=${`line ${line.type}`}><span class="number" aria-hidden="true">${index + 1}</span><span class="text">${prefix}${line.text}</span></span>`;
143
+ })}</pre>
144
+ </div>
145
+ `;
146
+ }
147
+ };
148
+ __decorate([
149
+ property()
150
+ ], CodeDiff.prototype, "filename", void 0);
151
+ __decorate([
152
+ property()
153
+ ], CodeDiff.prototype, "stat", void 0);
154
+ __decorate([
155
+ property({ type: Array })
156
+ ], CodeDiff.prototype, "lines", void 0);
157
+ CodeDiff = __decorate([
158
+ customElement("code-diff")
159
+ ], CodeDiff);
160
+ export { CodeDiff };
161
+ //# sourceMappingURL=code-diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-diff.js","sourceRoot":"","sources":["../src/code-diff.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAarC;;;;;;;;;;;;;;GAcG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAgGL,wDAAwD;QAC5C,aAAQ,GAAG,EAAE,CAAC;QAE1B,6EAA6E;QACjE,SAAI,GAAG,EAAE,CAAC;QAEtB,iFAAiF;QACtD,UAAK,GAAmB,EAAE,CAAC;IAsBxD,CAAC;aA5HiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0FF;KACF,AA7FqB,CA6FpB;IAWO,MAAM;QACb,OAAO,IAAI,CAAA;;;;mCAIoB,IAAI,CAAC,QAAQ;+BACjB,IAAI,CAAC,IAAI;;4BAEZ,MAAM,CACxB,IAAI,CAAC,KAAK;QACV,uFAAuF;QACvF,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EACvB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACd,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAC9E,OAAO,IAAI,CAAA,eAAe,QAAQ,IAAI,CAAC,IAAI,EAAE,4CAA4C,KAAK,GAAG,CAAC,6BAA6B,MAAM,GAAG,IAAI,CAAC,IAAI,gBAAgB,CAAC;QACpK,CAAC,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AA5Ba;IAAX,QAAQ,EAAE;0CAAe;AAGd;IAAX,QAAQ,EAAE;sCAAW;AAGK;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;uCAA4B;AAvG3C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA6HpB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** The visual treatment for one diff line. */\nexport type CodeDiffLineType = \"add\" | \"del\" | \"context\";\n\n/** One ordered line in the diff body. */\nexport interface CodeDiffLine {\n /** Whether the line is added, removed, or unchanged context. */\n type: CodeDiffLineType;\n /** The plain code text for the line, without the rendered diff prefix. */\n text: string;\n}\n\n/**\n * A compact, read-only code diff viewer: a bordered panel with a header bar\n * for `filename` and `stat`, followed by a numbered `<pre>` listing of\n * `lines`. Each {@link CodeDiffLine} renders as `\"add\"`, `\"del\"`, or\n * `\"context\"` with fixed `\"+ \"` / `\"- \"` / `\" \"` prefixes so the diff\n * remains understandable even when color is unavailable.\n *\n * Added and removed rows reuse `--ui-success` / `--ui-danger` for their text\n * and low-alpha background washes, while the shell itself reuses\n * `--ui-font-mono`, `--ui-border`, and `--ui-surface`. The caller owns the\n * data shape entirely: `filename` and `stat` are passed through verbatim, and\n * `lines` is a flat ordered array of `{ type, text }` objects.\n *\n * @element code-diff\n */\n@customElement(\"code-diff\")\nexport class CodeDiff extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n overflow: hidden;\n border: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius, 0.5rem);\n background: var(--ui-surface, #ffffff);\n color: var(--ui-text, #0f172a);\n font-family: var(\n --ui-font-mono,\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-normal, 1.5);\n }\n .bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n padding: 0.5rem 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: var(--ui-numeric, normal);\n }\n .filename {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .stat {\n flex: 0 0 auto;\n white-space: nowrap;\n }\n .body {\n margin: 0;\n overflow-x: auto;\n background: var(--ui-surface, #ffffff);\n }\n .line {\n display: grid;\n grid-template-columns: 4ch minmax(0, 1fr);\n }\n .number {\n box-sizing: border-box;\n padding: 0.25rem 0.5rem 0.25rem 0;\n border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: tabular-nums;\n text-align: right;\n user-select: none;\n }\n .text {\n min-width: 0;\n padding: 0.25rem 0.75rem;\n }\n .line.context {\n color: var(--ui-text-muted, #64748b);\n }\n /* Derived from the light theme's --ui-success/#16a34a and\n --ui-danger/#dc2626 fallbacks; there is no dedicated diff-wash token. */\n .line.add {\n background: rgb(22 163 74 / 0.1);\n color: var(--ui-success, #16a34a);\n }\n .line.del {\n background: rgb(220 38 38 / 0.1);\n color: var(--ui-danger, #dc2626);\n }\n @media (forced-colors: active) {\n .panel {\n border: 1px solid CanvasText;\n background: Canvas;\n }\n .bar,\n .number {\n border-color: CanvasText;\n }\n .line {\n background: transparent;\n }\n }\n `,\n ];\n\n /** The filename shown in the header bar's left side. */\n @property() filename = \"\";\n\n /** The caller-supplied stat summary shown in the header bar's right side. */\n @property() stat = \"\";\n\n /** Ordered diff lines, each rendered with its type-driven prefix and styling. */\n @property({ type: Array }) lines: CodeDiffLine[] = [];\n\n override render() {\n return html`\n <div class=\"panel\">\n <!-- Keep the bar even when both values are blank so the shell stays stable. -->\n <div class=\"bar\">\n <span class=\"filename\">${this.filename}</span>\n <span class=\"stat\">${this.stat}</span>\n </div>\n <pre class=\"body\">${repeat(\n this.lines,\n // Fixed diffs do not reorder lines, so the display index is the deliberate stable key.\n (_line, index) => index,\n (line, index) => {\n const prefix = line.type === \"add\" ? \"+ \" : line.type === \"del\" ? \"- \" : \" \";\n return html`<span class=${`line ${line.type}`}><span class=\"number\" aria-hidden=\"true\">${index + 1}</span><span class=\"text\">${prefix}${line.text}</span></span>`;\n },\n )}</pre>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"code-diff\": CodeDiff;\n }\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import { LitElement } from "lit";
2
+ /**
3
+ * A code-comment-style eyebrow line for section chrome in terminal- or
4
+ * editor-themed pages. It renders a colored comment marker (`##` by default)
5
+ * before muted slotted text, so `<comment-label>the_whole_idea</comment-label>`
6
+ * reads like a short section kicker. Set `prefix="//"` and `italic` for a
7
+ * closing or footer quote line that keeps the marker upright while the message
8
+ * itself turns italic.
9
+ *
10
+ * @element comment-label
11
+ * @slot - The label text, such as a section eyebrow or a longer closing quote.
12
+ */
13
+ export declare class CommentLabel extends LitElement {
14
+ static styles: import("lit").CSSResult[];
15
+ /** Comment marker rendered before the slotted label text. */
16
+ prefix: string;
17
+ /** Renders the slotted label text in italics while leaving the prefix upright. */
18
+ italic: boolean;
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ "comment-label": CommentLabel;
24
+ }
25
+ }
26
+ //# sourceMappingURL=comment-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-label.d.ts","sourceRoot":"","sources":["../src/comment-label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD;;;;;;;;;;GAUG;AACH,qBACa,YAAa,SAAQ,UAAU;IAC1C,OAAgB,MAAM,4BA+BpB;IAEF,6DAA6D;IACxC,MAAM,SAAQ;IAEnC,kFAAkF;IACtC,MAAM,UAAS;IAElD,MAAM,yCAQd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
@@ -0,0 +1,81 @@
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
+ /**
11
+ * A code-comment-style eyebrow line for section chrome in terminal- or
12
+ * editor-themed pages. It renders a colored comment marker (`##` by default)
13
+ * before muted slotted text, so `<comment-label>the_whole_idea</comment-label>`
14
+ * reads like a short section kicker. Set `prefix="//"` and `italic` for a
15
+ * closing or footer quote line that keeps the marker upright while the message
16
+ * itself turns italic.
17
+ *
18
+ * @element comment-label
19
+ * @slot - The label text, such as a section eyebrow or a longer closing quote.
20
+ */
21
+ let CommentLabel = class CommentLabel extends LitElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ /** Comment marker rendered before the slotted label text. */
25
+ this.prefix = "##";
26
+ /** Renders the slotted label text in italics while leaving the prefix upright. */
27
+ this.italic = false;
28
+ }
29
+ static { this.styles = [
30
+ tokens,
31
+ css `
32
+ :host {
33
+ display: block;
34
+ color: var(--ui-text-muted, #64748b);
35
+ font-family: var(--ui-font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
36
+ font-size: var(--ui-font-size-sm, 0.75rem);
37
+ font-weight: var(--ui-font-weight-semibold, 600);
38
+ line-height: var(--ui-line-height-tight, 1.25);
39
+ letter-spacing: var(--ui-tracking-wide, 0.04em);
40
+ text-transform: var(--ui-label-transform, none);
41
+ }
42
+ :host([italic]) {
43
+ font-style: italic;
44
+ }
45
+ .label {
46
+ display: flex;
47
+ align-items: baseline;
48
+ gap: 0.25rem;
49
+ }
50
+ .prefix {
51
+ flex: 0 0 auto;
52
+ color: var(--ui-primary, #4f46e5);
53
+ font-style: normal;
54
+ }
55
+ .content {
56
+ flex: 1 1 auto;
57
+ min-width: 0;
58
+ }
59
+ `,
60
+ ]; }
61
+ render() {
62
+ const hasPrefix = this.prefix.length > 0;
63
+ return html `
64
+ <span class="label">
65
+ ${hasPrefix ? html `<span class="prefix" aria-hidden="true">${this.prefix}</span>` : nothing}
66
+ <span class="content"><slot></slot></span>
67
+ </span>
68
+ `;
69
+ }
70
+ };
71
+ __decorate([
72
+ property()
73
+ ], CommentLabel.prototype, "prefix", void 0);
74
+ __decorate([
75
+ property({ type: Boolean, reflect: true })
76
+ ], CommentLabel.prototype, "italic", void 0);
77
+ CommentLabel = __decorate([
78
+ customElement("comment-label")
79
+ ], CommentLabel);
80
+ export { CommentLabel };
81
+ //# sourceMappingURL=comment-label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-label.js","sourceRoot":"","sources":["../src/comment-label.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;AAErC;;;;;;;;;;GAUG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAArC;;QAkCL,6DAA6D;QACxC,WAAM,GAAG,IAAI,CAAC;QAEnC,kFAAkF;QACtC,WAAM,GAAG,KAAK,CAAC;IAW7D,CAAC;aAhDiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BF;KACF,AA/BqB,CA+BpB;IAQO,MAAM;QACb,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACzC,OAAO,IAAI,CAAA;;UAEL,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA,2CAA2C,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,OAAO;;;KAG9F,CAAC;IACJ,CAAC;CACF,CAAA;AAdsB;IAApB,QAAQ,EAAE;4CAAwB;AAGS;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAgB;AAtChD,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAiDxB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A code-comment-style eyebrow line for section chrome in terminal- or\n * editor-themed pages. It renders a colored comment marker (`##` by default)\n * before muted slotted text, so `<comment-label>the_whole_idea</comment-label>`\n * reads like a short section kicker. Set `prefix=\"//\"` and `italic` for a\n * closing or footer quote line that keeps the marker upright while the message\n * itself turns italic.\n *\n * @element comment-label\n * @slot - The label text, such as a section eyebrow or a longer closing quote.\n */\n@customElement(\"comment-label\")\nexport class CommentLabel extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n color: var(--ui-text-muted, #64748b);\n font-family: var(--ui-font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-semibold, 600);\n line-height: var(--ui-line-height-tight, 1.25);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n text-transform: var(--ui-label-transform, none);\n }\n :host([italic]) {\n font-style: italic;\n }\n .label {\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n }\n .prefix {\n flex: 0 0 auto;\n color: var(--ui-primary, #4f46e5);\n font-style: normal;\n }\n .content {\n flex: 1 1 auto;\n min-width: 0;\n }\n `,\n ];\n\n /** Comment marker rendered before the slotted label text. */\n @property() override prefix = \"##\";\n\n /** Renders the slotted label text in italics while leaving the prefix upright. */\n @property({ type: Boolean, reflect: true }) italic = false;\n\n override render() {\n const hasPrefix = this.prefix.length > 0;\n return html`\n <span class=\"label\">\n ${hasPrefix ? html`<span class=\"prefix\" aria-hidden=\"true\">${this.prefix}</span>` : nothing}\n <span class=\"content\"><slot></slot></span>\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"comment-label\": CommentLabel;\n }\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { LitElement, type PropertyValues } from "lit";
2
2
  /**
3
- * Reusable confirmation dialog: overlay + centered card with a slotted body,
4
- * an optional error line, and Cancel/Confirm actions. Instant `display:none`
5
- * → `display:flex` toggle (no transitions). Fires `confirm`/`cancel`
3
+ * Reusable confirmation dialog: a native modal `<dialog>` (top layer, inert
4
+ * page behind it, built-in focus containment) with a slotted body, an
5
+ * optional error line, and Cancel/Confirm actions. Instant open/close (no
6
+ * transitions). Fires `confirm`/`cancel`
6
7
  * (bubbling, composed) instead of owning any deletion logic itself —
7
8
  * callers stay in charge of the request. Set `size="sm"` for compact
8
9
  * actions one step below the default, matching `ui-button`'s `sm` size.
@@ -27,13 +28,18 @@ export declare class ConfirmDialog extends LitElement {
27
28
  error: string | null;
28
29
  /** Size — `sm` reduces both action buttons' height/padding/font-size one step below the default. */
29
30
  size: "sm" | "md";
30
- private _previousFocus;
31
+ private _dialog;
31
32
  private _confirm;
32
33
  private _cancel;
33
- private _getFocusableElements;
34
+ /** Native focus delegation doesn't reliably reach slotted light-DOM content, so focus explicitly. */
34
35
  private _focusInitial;
35
- private _onDocumentFocusIn;
36
+ /** Escape goes to the topmost layer only; it's ignored while a request is in flight. */
36
37
  private _onWindowKeydown;
38
+ /**
39
+ * Native close requests (e.g. a back gesture) are routed through `cancel`; the consumer owns `open`.
40
+ * Named `_onNativeCancel` because this component also fires its own bubbling `cancel` CustomEvent.
41
+ */
42
+ private _onNativeCancel;
37
43
  protected updated(changed: PropertyValues): void;
38
44
  disconnectedCallback(): void;
39
45
  render(): import("lit-html").TemplateResult<1>;