@f-ewald/components 1.40.3 → 1.41.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.
Files changed (86) hide show
  1. package/README.md +11 -3
  2. package/custom-elements.json +788 -97
  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/index.d.ts +8 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +8 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/mcp-server.js +1 -1
  26. package/dist/mcp-server.js.map +1 -1
  27. package/dist/modal-dialog.d.ts +16 -13
  28. package/dist/modal-dialog.d.ts.map +1 -1
  29. package/dist/modal-dialog.js +69 -104
  30. package/dist/modal-dialog.js.map +1 -1
  31. package/dist/photo-gallery.js +1 -1
  32. package/dist/photo-gallery.js.map +1 -1
  33. package/dist/price-history-chart.js +1 -1
  34. package/dist/price-history-chart.js.map +1 -1
  35. package/dist/progress-bar.d.ts.map +1 -1
  36. package/dist/progress-bar.js +23 -17
  37. package/dist/progress-bar.js.map +1 -1
  38. package/dist/slide-panel.d.ts +3 -3
  39. package/dist/slide-panel.d.ts.map +1 -1
  40. package/dist/slide-panel.js +38 -22
  41. package/dist/slide-panel.js.map +1 -1
  42. package/dist/stat-strip.d.ts +30 -0
  43. package/dist/stat-strip.d.ts.map +1 -0
  44. package/dist/stat-strip.js +111 -0
  45. package/dist/stat-strip.js.map +1 -0
  46. package/dist/step-ladder.d.ts +46 -0
  47. package/dist/step-ladder.d.ts.map +1 -0
  48. package/dist/step-ladder.js +175 -0
  49. package/dist/step-ladder.js.map +1 -0
  50. package/dist/terminal-block.d.ts +45 -0
  51. package/dist/terminal-block.d.ts.map +1 -0
  52. package/dist/terminal-block.js +113 -0
  53. package/dist/terminal-block.js.map +1 -0
  54. package/dist/toast-notification.d.ts +7 -0
  55. package/dist/toast-notification.d.ts.map +1 -1
  56. package/dist/toast-notification.js +34 -0
  57. package/dist/toast-notification.js.map +1 -1
  58. package/dist/tokens.css +60 -1
  59. package/dist/tokens.d.ts +58 -0
  60. package/dist/tokens.d.ts.map +1 -1
  61. package/dist/tokens.js +135 -0
  62. package/dist/tokens.js.map +1 -1
  63. package/dist/ui-button.js +2 -2
  64. package/dist/ui-button.js.map +1 -1
  65. package/dist/window-chrome.d.ts +34 -0
  66. package/dist/window-chrome.d.ts.map +1 -0
  67. package/dist/window-chrome.js +141 -0
  68. package/dist/window-chrome.js.map +1 -0
  69. package/docs/app-shell.md +1 -1
  70. package/docs/blink-cursor.md +45 -0
  71. package/docs/code-diff.md +64 -0
  72. package/docs/comment-label.md +49 -0
  73. package/docs/confirm-dialog.md +4 -3
  74. package/docs/design-language.md +39 -20
  75. package/docs/layouts/marketing-landing.md +102 -0
  76. package/docs/modal-dialog.md +9 -9
  77. package/docs/photo-gallery.md +1 -1
  78. package/docs/price-history-chart.md +1 -0
  79. package/docs/slide-panel.md +2 -2
  80. package/docs/stat-strip.md +57 -0
  81. package/docs/step-ladder.md +63 -0
  82. package/docs/terminal-block.md +69 -0
  83. package/docs/ui-button.md +2 -0
  84. package/docs/window-chrome.md +64 -0
  85. package/llms.txt +225 -18
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"price-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QAEvE,OAAO,IAAI,CAAA;;sBAEO,IAAI,CAAC,MAAM,aAAa,CAAC,2BAA2B,OAAO;;;;;;;YAOrE,MAAM;qBACG,KAAK;yCACe,KAAK;;YAElC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAA;+CACU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;oCAEpD,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;oCAC/B,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;WAC3D,CAAC;YACA,MAAM;YACN,SAAS;;;KAGhB,CAAC;IACJ,CAAC;CACF,CAAA;AAxN4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAA4B;AACjB;IAApC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;kDAA+C;AAC5B;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDAAgB;AAErD;IAAhB,KAAK,EAAE;iDAAoB;AACX;IAAhB,KAAK,EAAE;sDAA2C;AANxC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAyN7B","sourcesContent":["import { LitElement, css, html, svg } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { scaleTime, scaleLinear } from \"d3-scale\";\nimport { line, area } from \"d3-shape\";\nimport { min, max } from \"d3-array\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface PricePoint {\n date: string | null;\n price: number | null;\n eventType: string;\n source?: string | null;\n}\n\ninterface PlottedPoint extends PricePoint {\n x: number;\n y: number;\n}\n\nfunction fmtMoney(n: number): string {\n return `$${n.toLocaleString(\"en-US\")}`;\n}\n\nfunction fmtMoneyShort(n: number): string {\n if (n >= 1_000_000) return `$${(n / 1_000_000).toFixed(1)}M`;\n if (n >= 1_000) return `$${Math.round(n / 1_000)}K`;\n return `$${n.toLocaleString(\"en-US\")}`;\n}\n\n/**\n * D3-powered SVG line chart for property price history.\n *\n * Uses scaleTime (X) + scaleLinear (Y) from d3-scale and line/area path\n * generators from d3-shape. Adapts to container width via ResizeObserver.\n *\n * @element price-history-chart\n * @prop history - Array of price points (points with null price/date are skipped).\n * @prop yLabels - \"auto\" (default) | \"always\" | \"never\"\n * @prop maxXLabels - Max X-axis date ticks (default 3).\n */\n@customElement(\"price-history-chart\")\nexport class PriceHistoryChart extends LitElement {\n @property({ type: Array }) history: PricePoint[] = [];\n @property({ attribute: \"y-labels\" }) yLabels: \"auto\" | \"always\" | \"never\" = \"auto\";\n @property({ type: Number, attribute: \"max-x-labels\" }) maxXLabels = 3;\n\n @state() private _width = 0;\n @state() private _hoveredIdx: number | null = null;\n\n private _ro: ResizeObserver | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) this._width = entry.contentRect.width;\n });\n this._ro.observe(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._ro?.disconnect();\n this._ro = null;\n }\n\n private get validPoints(): PricePoint[] {\n return this.history\n .filter((h) => h.price != null && h.date != null)\n .sort((a, b) => new Date(a.date!).getTime() - new Date(b.date!).getTime());\n }\n\n private get showY(): boolean {\n return this.yLabels === \"always\" || (this.yLabels === \"auto\" && this._width >= 260);\n }\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n width: 100%;\n }\n .wrap {\n position: relative;\n width: 100%;\n }\n svg {\n display: block;\n overflow: visible;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .axis-label {\n fill: var(--ui-text-muted, #64748b);\n }\n .grid-line {\n stroke: var(--ui-border, #e2e8f0);\n }\n .series-line {\n stroke: var(--ui-primary, #4f46e5);\n }\n .series-gradient {\n stop-color: var(--ui-primary, #4f46e5);\n }\n .series-point {\n fill: var(--ui-primary, #4f46e5);\n stroke: var(--ui-on-accent, #ffffff);\n cursor: pointer;\n }\n .tooltip {\n fill: var(--ui-tooltip, #0f172a);\n }\n .tooltip-label {\n fill: var(--ui-on-accent, #ffffff);\n }\n `,\n ];\n\n private computeLayout() {\n if (this._width < 10) return null;\n const points = this.validPoints;\n if (points.length < 2) return null;\n\n const H = 180;\n const MT = 20;\n const MB = 30;\n const MR = 12;\n const ML = this.showY ? 56 : 12;\n const plotW = Math.max(this._width - ML - MR, 1);\n const plotH = Math.max(H - MT - MB, 1);\n const bottomY = MT + plotH;\n\n const prices = points.map((p) => p.price!);\n const dates = points.map((p) => new Date(p.date!));\n const minPrice = min(prices)!;\n const maxPrice = max(prices)!;\n const pad = (maxPrice - minPrice) * 0.05 || maxPrice * 0.05;\n\n const xScale = scaleTime()\n .domain([min(dates)!, max(dates)!])\n .range([ML, ML + plotW]);\n\n const yScale = scaleLinear()\n .domain([minPrice - pad, maxPrice + pad])\n .range([bottomY, MT]);\n\n const lineFn = line<PricePoint>()\n .x((p) => xScale(new Date(p.date!)))\n .y((p) => yScale(p.price!));\n\n const areaFn = area<PricePoint>()\n .x((p) => xScale(new Date(p.date!)))\n .y0(bottomY)\n .y1((p) => yScale(p.price!));\n\n const plotted: PlottedPoint[] = points.map((p) => ({\n ...p,\n x: xScale(new Date(p.date!)),\n y: yScale(p.price!),\n }));\n\n return { points, plotted, H, MT, ML, MR, plotW, plotH, bottomY, minPrice, maxPrice, xScale, yScale, lineFn, areaFn };\n }\n\n override render() {\n const layout = this.computeLayout();\n if (!layout) return html``;\n\n const { points, plotted, H, MT, ML, MR, plotW, plotH, xScale, yScale, lineFn, areaFn } = layout;\n\n const lineD = lineFn(points) ?? \"\";\n const areaD = areaFn(points) ?? \"\";\n\n const hIdx = this._hoveredIdx;\n const hovPt = hIdx !== null ? plotted[hIdx] : null;\n\n const tooltipEl = hovPt ? (() => {\n const tipText = `${fmtMoney(hovPt.price!)} · ${hovPt.date ? new Date(hovPt.date).toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" }) : \"\"} · ${hovPt.eventType}`;\n const tipW = Math.min(tipText.length * 6.5 + 16, this._width - ML - MR);\n const tipH = 24;\n const tipGap = 8;\n const above = hovPt.y > plotH / 2 + MT;\n const tipRectY = above ? hovPt.y - tipGap - tipH : hovPt.y + tipGap;\n const tipX = Math.min(Math.max(hovPt.x - tipW / 2, ML), this._width - MR - tipW);\n return svg`\n <g pointer-events=\"none\">\n <rect class=\"tooltip\" x=\"${tipX}\" y=\"${tipRectY}\" width=\"${tipW}\" height=\"${tipH}\"\n rx=\"4\" />\n <text class=\"tooltip-label\" x=\"${tipX + tipW / 2}\" y=\"${tipRectY + 15.5}\"\n text-anchor=\"middle\" font-size=\"11\">${tipText}</text>\n </g>\n `;\n })() : \"\";\n\n const xTicks = xScale.ticks(this.maxXLabels).map((d, i, arr) => {\n const x = xScale(d);\n const label = d.toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" });\n const anchor = i === 0 ? \"start\" : i === arr.length - 1 ? \"end\" : \"middle\";\n return svg`\n <text class=\"axis-label\" x=\"${x}\" y=\"${H - 6}\" text-anchor=\"${anchor}\" font-size=\"10\">${label}</text>\n `;\n });\n\n const yTicks = this.showY ? yScale.ticks(3).map((v, i, arr) => {\n const y = yScale(v);\n const isFirst = i === 0;\n const isLast = i === arr.length - 1;\n return svg`\n <line class=\"grid-line\" x1=\"${ML - 4}\" y1=\"${y}\" x2=\"${ML + plotW}\" y2=\"${y}\"\n stroke-width=\"1\" />\n ${isFirst || isLast ? svg`\n <text class=\"axis-label\" x=\"${ML - 6}\" y=\"${y + 4}\" text-anchor=\"end\" font-size=\"10\">${fmtMoneyShort(v)}</text>\n ` : \"\"}\n `;\n }) : [];\n\n const firstPoint = points[0];\n const lastPoint = points[points.length - 1];\n const formatDate = (date: string | null) =>\n new Date(date!).toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" });\n const summary =\n `${points.length} price points from ${formatDate(firstPoint.date)} at ${fmtMoney(firstPoint.price!)} ` +\n `to ${formatDate(lastPoint.date)} at ${fmtMoney(lastPoint.price!)}.`;\n\n return html`\n <div class=\"wrap\">\n <svg width=\"${this._width}\" height=\"${H}\" role=\"img\" aria-label=${summary}>\n <defs>\n <linearGradient id=\"phg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop class=\"series-gradient\" offset=\"0%\" stop-opacity=\"0.25\" />\n <stop class=\"series-gradient\" offset=\"100%\" stop-opacity=\"0\" />\n </linearGradient>\n </defs>\n ${yTicks}\n <path d=\"${areaD}\" fill=\"url(#phg)\" />\n <path class=\"series-line\" d=\"${lineD}\" fill=\"none\" stroke-width=\"2.5\"\n stroke-linejoin=\"round\" stroke-linecap=\"round\" />\n ${plotted.map((p, i) => svg`\n <circle class=\"series-point\" cx=\"${p.x}\" cy=\"${p.y}\" r=\"${i === hIdx ? 7 : 5}\"\n stroke-width=\"2\"\n @pointerenter=${() => { this._hoveredIdx = i; }}\n @pointerleave=${() => { this._hoveredIdx = null; }} />\n `)}\n ${xTicks}\n ${tooltipEl}\n </svg>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"price-history-chart\": PriceHistoryChart;\n }\n}\n"]}
1
+ {"version":3,"file":"price-history-chart.js","sourceRoot":"","sources":["../src/price-history-chart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE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,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;oCAEpD,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;oCAC/B,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;WAC3D,CAAC;YACA,MAAM;YACN,SAAS;;;KAGhB,CAAC;IACJ,CAAC;CACF,CAAA;AAxN4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAA4B;AACjB;IAApC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;kDAA+C;AAC5B;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;qDAAgB;AAErD;IAAhB,KAAK,EAAE;iDAAoB;AACX;IAAhB,KAAK,EAAE;sDAA2C;AANxC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAyN7B","sourcesContent":["import { LitElement, css, html, svg } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { scaleTime, scaleLinear } from \"d3-scale\";\nimport { line, area } from \"d3-shape\";\nimport { min, max } from \"d3-array\";\nimport { tokens } from \"./tokens.js\";\n\nexport interface PricePoint {\n date: string | null;\n price: number | null;\n eventType: string;\n source?: string | null;\n}\n\ninterface PlottedPoint extends PricePoint {\n x: number;\n y: number;\n}\n\nfunction fmtMoney(n: number): string {\n return `$${n.toLocaleString(\"en-US\")}`;\n}\n\nfunction fmtMoneyShort(n: number): string {\n if (n >= 1_000_000) return `$${(n / 1_000_000).toFixed(1)}M`;\n if (n >= 1_000) return `$${Math.round(n / 1_000)}K`;\n return `$${n.toLocaleString(\"en-US\")}`;\n}\n\n/**\n * D3-powered SVG line chart for property price history.\n *\n * Uses scaleTime (X) + scaleLinear (Y) from d3-scale and line/area path\n * generators from d3-shape. Adapts to container width via ResizeObserver.\n *\n * @element price-history-chart\n * @prop history - Array of price points (points with null price/date are skipped).\n * @prop yLabels - \"auto\" (default) | \"always\" | \"never\"\n * @prop maxXLabels - Max X-axis date ticks (default 3).\n */\n@customElement(\"price-history-chart\")\nexport class PriceHistoryChart extends LitElement {\n @property({ type: Array }) history: PricePoint[] = [];\n @property({ attribute: \"y-labels\" }) yLabels: \"auto\" | \"always\" | \"never\" = \"auto\";\n @property({ type: Number, attribute: \"max-x-labels\" }) maxXLabels = 3;\n\n @state() private _width = 0;\n @state() private _hoveredIdx: number | null = null;\n\n private _ro: ResizeObserver | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) this._width = entry.contentRect.width;\n });\n this._ro.observe(this);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this._ro?.disconnect();\n this._ro = null;\n }\n\n private get validPoints(): PricePoint[] {\n return this.history\n .filter((h) => h.price != null && h.date != null)\n .sort((a, b) => new Date(a.date!).getTime() - new Date(b.date!).getTime());\n }\n\n private get showY(): boolean {\n return this.yLabels === \"always\" || (this.yLabels === \"auto\" && this._width >= 260);\n }\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n width: 100%;\n }\n .wrap {\n position: relative;\n width: 100%;\n }\n svg {\n display: block;\n overflow: visible;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .axis-label {\n fill: var(--ui-text-muted, #64748b);\n }\n .grid-line {\n stroke: var(--ui-border, #e2e8f0);\n }\n .series-line {\n stroke: var(--ui-primary, #4f46e5);\n }\n .series-gradient {\n stop-color: var(--ui-primary, #4f46e5);\n }\n .series-point {\n fill: var(--ui-primary, #4f46e5);\n stroke: var(--ui-on-accent, #ffffff);\n cursor: pointer;\n }\n .tooltip {\n fill: var(--ui-tooltip, #0f172a);\n }\n .tooltip-label {\n fill: var(--ui-tooltip-text, #ffffff);\n }\n `,\n ];\n\n private computeLayout() {\n if (this._width < 10) return null;\n const points = this.validPoints;\n if (points.length < 2) return null;\n\n const H = 180;\n const MT = 20;\n const MB = 30;\n const MR = 12;\n const ML = this.showY ? 56 : 12;\n const plotW = Math.max(this._width - ML - MR, 1);\n const plotH = Math.max(H - MT - MB, 1);\n const bottomY = MT + plotH;\n\n const prices = points.map((p) => p.price!);\n const dates = points.map((p) => new Date(p.date!));\n const minPrice = min(prices)!;\n const maxPrice = max(prices)!;\n const pad = (maxPrice - minPrice) * 0.05 || maxPrice * 0.05;\n\n const xScale = scaleTime()\n .domain([min(dates)!, max(dates)!])\n .range([ML, ML + plotW]);\n\n const yScale = scaleLinear()\n .domain([minPrice - pad, maxPrice + pad])\n .range([bottomY, MT]);\n\n const lineFn = line<PricePoint>()\n .x((p) => xScale(new Date(p.date!)))\n .y((p) => yScale(p.price!));\n\n const areaFn = area<PricePoint>()\n .x((p) => xScale(new Date(p.date!)))\n .y0(bottomY)\n .y1((p) => yScale(p.price!));\n\n const plotted: PlottedPoint[] = points.map((p) => ({\n ...p,\n x: xScale(new Date(p.date!)),\n y: yScale(p.price!),\n }));\n\n return { points, plotted, H, MT, ML, MR, plotW, plotH, bottomY, minPrice, maxPrice, xScale, yScale, lineFn, areaFn };\n }\n\n override render() {\n const layout = this.computeLayout();\n if (!layout) return html``;\n\n const { points, plotted, H, MT, ML, MR, plotW, plotH, xScale, yScale, lineFn, areaFn } = layout;\n\n const lineD = lineFn(points) ?? \"\";\n const areaD = areaFn(points) ?? \"\";\n\n const hIdx = this._hoveredIdx;\n const hovPt = hIdx !== null ? plotted[hIdx] : null;\n\n const tooltipEl = hovPt ? (() => {\n const tipText = `${fmtMoney(hovPt.price!)} · ${hovPt.date ? new Date(hovPt.date).toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" }) : \"\"} · ${hovPt.eventType}`;\n const tipW = Math.min(tipText.length * 6.5 + 16, this._width - ML - MR);\n const tipH = 24;\n const tipGap = 8;\n const above = hovPt.y > plotH / 2 + MT;\n const tipRectY = above ? hovPt.y - tipGap - tipH : hovPt.y + tipGap;\n const tipX = Math.min(Math.max(hovPt.x - tipW / 2, ML), this._width - MR - tipW);\n return svg`\n <g pointer-events=\"none\">\n <rect class=\"tooltip\" x=\"${tipX}\" y=\"${tipRectY}\" width=\"${tipW}\" height=\"${tipH}\"\n rx=\"4\" />\n <text class=\"tooltip-label\" x=\"${tipX + tipW / 2}\" y=\"${tipRectY + 15.5}\"\n text-anchor=\"middle\" font-size=\"11\">${tipText}</text>\n </g>\n `;\n })() : \"\";\n\n const xTicks = xScale.ticks(this.maxXLabels).map((d, i, arr) => {\n const x = xScale(d);\n const label = d.toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" });\n const anchor = i === 0 ? \"start\" : i === arr.length - 1 ? \"end\" : \"middle\";\n return svg`\n <text class=\"axis-label\" x=\"${x}\" y=\"${H - 6}\" text-anchor=\"${anchor}\" font-size=\"10\">${label}</text>\n `;\n });\n\n const yTicks = this.showY ? yScale.ticks(3).map((v, i, arr) => {\n const y = yScale(v);\n const isFirst = i === 0;\n const isLast = i === arr.length - 1;\n return svg`\n <line class=\"grid-line\" x1=\"${ML - 4}\" y1=\"${y}\" x2=\"${ML + plotW}\" y2=\"${y}\"\n stroke-width=\"1\" />\n ${isFirst || isLast ? svg`\n <text class=\"axis-label\" x=\"${ML - 6}\" y=\"${y + 4}\" text-anchor=\"end\" font-size=\"10\">${fmtMoneyShort(v)}</text>\n ` : \"\"}\n `;\n }) : [];\n\n const firstPoint = points[0];\n const lastPoint = points[points.length - 1];\n const formatDate = (date: string | null) =>\n new Date(date!).toLocaleDateString(\"en-US\", { month: \"short\", year: \"numeric\" });\n const summary =\n `${points.length} price points from ${formatDate(firstPoint.date)} at ${fmtMoney(firstPoint.price!)} ` +\n `to ${formatDate(lastPoint.date)} at ${fmtMoney(lastPoint.price!)}.`;\n\n return html`\n <div class=\"wrap\">\n <svg width=\"${this._width}\" height=\"${H}\" role=\"img\" aria-label=${summary}>\n <defs>\n <linearGradient id=\"phg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop class=\"series-gradient\" offset=\"0%\" stop-opacity=\"0.25\" />\n <stop class=\"series-gradient\" offset=\"100%\" stop-opacity=\"0\" />\n </linearGradient>\n </defs>\n ${yTicks}\n <path d=\"${areaD}\" fill=\"url(#phg)\" />\n <path class=\"series-line\" d=\"${lineD}\" fill=\"none\" stroke-width=\"2.5\"\n stroke-linejoin=\"round\" stroke-linecap=\"round\" />\n ${plotted.map((p, i) => svg`\n <circle class=\"series-point\" cx=\"${p.x}\" cy=\"${p.y}\" r=\"${i === hIdx ? 7 : 5}\"\n stroke-width=\"2\"\n @pointerenter=${() => { this._hoveredIdx = i; }}\n @pointerleave=${() => { this._hoveredIdx = null; }} />\n `)}\n ${xTicks}\n ${tooltipEl}\n </svg>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"price-history-chart\": PriceHistoryChart;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../src/progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD;;;;;;;;;GASG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,4BAqDpB;IAEF,+CAA+C;IACnB,KAAK,SAAK;IACtC,qCAAqC;IACT,GAAG,SAAO;IACtC,oFAAoF;IACxE,KAAK,SAAM;IACvB,iDAAiD;IACrC,KAAK,SAAM;IACvB,mCAAmC;IACK,UAAU,SAAM;IAE/C,MAAM,yCAoBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../src/progress-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD;;;;;;;;;GASG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,OAAgB,MAAM,4BA4DpB;IAEF,+CAA+C;IACnB,KAAK,SAAK;IACtC,qCAAqC;IACT,GAAG,SAAO;IACtC,oFAAoF;IACxE,KAAK,SAAM;IACvB,iDAAiD;IACrC,KAAK,SAAM;IACvB,mCAAmC;IACK,UAAU,SAAM;IAE/C,MAAM,yCAmBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -52,17 +52,23 @@ let ProgressBar = class ProgressBar extends LitElement {
52
52
  .track {
53
53
  flex: 1 1 auto;
54
54
  display: block;
55
+ appearance: none;
55
56
  height: 0.5rem;
57
+ border: 0;
56
58
  border-radius: var(--ui-radius-sm, 0.25rem);
57
59
  background: var(--track-color, var(--ui-surface-muted, #f8fafc));
58
60
  overflow: hidden;
59
61
  }
60
- .fill {
61
- display: block;
62
- height: 100%;
62
+ .track::-webkit-progress-bar {
63
+ background: transparent;
64
+ }
65
+ .track::-webkit-progress-value {
63
66
  background: var(--fill-color, var(--ui-button-accent, var(--ui-primary, #4f46e5)));
64
67
  transition: width 200ms ease;
65
68
  }
69
+ .track::-moz-progress-bar {
70
+ background: var(--fill-color, var(--ui-button-accent, var(--ui-primary, #4f46e5)));
71
+ }
66
72
  .label {
67
73
  flex: 0 0 auto;
68
74
  font-size: var(--ui-font-size-sm, 0.75rem);
@@ -71,7 +77,7 @@ let ProgressBar = class ProgressBar extends LitElement {
71
77
  white-space: nowrap;
72
78
  }
73
79
  @media (prefers-reduced-motion: reduce) {
74
- .fill {
80
+ .track::-webkit-progress-value {
75
81
  transition: none;
76
82
  }
77
83
  }
@@ -79,7 +85,8 @@ let ProgressBar = class ProgressBar extends LitElement {
79
85
  .track {
80
86
  border: 1px solid CanvasText;
81
87
  }
82
- .fill {
88
+ .track::-webkit-progress-value,
89
+ .track::-moz-progress-bar {
83
90
  background: Highlight;
84
91
  }
85
92
  }
@@ -88,21 +95,20 @@ let ProgressBar = class ProgressBar extends LitElement {
88
95
  render() {
89
96
  const max = Math.max(0, this.max);
90
97
  const clamped = Math.min(max, Math.max(0, this.value));
91
- const pct = max === 0 ? 0 : (clamped / max) * 100;
92
- const fillStyle = this.color ? `width: ${pct}%; --fill-color: ${this.color}` : `width: ${pct}%`;
93
- const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : "";
98
+ const style = [
99
+ this.trackColor && `--track-color: ${this.trackColor}`,
100
+ this.color && `--fill-color: ${this.color}`,
101
+ ]
102
+ .filter(Boolean)
103
+ .join("; ");
94
104
  return html `
95
- <span
105
+ <progress
96
106
  class="track"
97
- style=${trackStyle}
98
- role="progressbar"
99
- aria-valuenow=${clamped}
100
- aria-valuemin="0"
101
- aria-valuemax=${max}
107
+ style=${style}
108
+ value=${clamped}
109
+ max=${max || 1}
102
110
  aria-label=${this.label || nothing}
103
- >
104
- <span class="fill" style=${fillStyle}></span>
105
- </span>
111
+ ></progress>
106
112
  ${this.label ? html `<span class="label">${this.label}</span>` : nothing}
107
113
  `;
108
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../src/progress-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,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;GASG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAwDL,+CAA+C;QACnB,UAAK,GAAG,CAAC,CAAC;QACtC,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IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAW;AAEV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAW;AAE1B;IAAX,QAAQ,EAAE;0CAAY;AAEX;IAAX,QAAQ,EAAE;0CAAY;AAEiB;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAiB;AAjE7C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAwFvB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A determinate horizontal progress indicator — a page-level \"step 3 of 14\"\n * bar. `stat-meter` is the closest existing thing but is an inline\n * CPU-gauge-style meter with a leading label and a computed percent value;\n * `progress-bar` instead takes a raw `value`/`max` pair and renders an\n * optional plain-text `label` to the right of the bar rather than a percent\n * inside it.\n *\n * @element progress-bar\n */\n@customElement(\"progress-bar\")\nexport class ProgressBar extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .track {\n flex: 1 1 auto;\n display: block;\n height: 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--track-color, var(--ui-surface-muted, #f8fafc));\n overflow: hidden;\n }\n .fill {\n display: block;\n height: 100%;\n background: var(--fill-color, var(--ui-button-accent, var(--ui-primary, #4f46e5)));\n transition: width 200ms ease;\n }\n .label {\n flex: 0 0 auto;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: var(--ui-numeric, normal);\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n .fill {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .track {\n border: 1px solid CanvasText;\n }\n .fill {\n background: Highlight;\n }\n }\n `,\n ];\n\n /** Current progress. Clamped into [0, max]. */\n @property({ type: Number }) value = 0;\n /** Value representing a full bar. */\n @property({ type: Number }) max = 100;\n /** Optional text rendered to the right of the bar (e.g. \"Question 3 out of 14\"). */\n @property() label = \"\";\n /** Fill color; defaults to the themed accent. */\n @property() color = \"\";\n /** Track color behind the fill. */\n @property({ attribute: \"track-color\" }) trackColor = \"\";\n\n override render() {\n const max = Math.max(0, this.max);\n const clamped = Math.min(max, Math.max(0, this.value));\n const pct = max === 0 ? 0 : (clamped / max) * 100;\n const fillStyle = this.color ? `width: ${pct}%; --fill-color: ${this.color}` : `width: ${pct}%`;\n const trackStyle = this.trackColor ? `--track-color: ${this.trackColor}` : \"\";\n return html`\n <span\n class=\"track\"\n style=${trackStyle}\n role=\"progressbar\"\n aria-valuenow=${clamped}\n aria-valuemin=\"0\"\n aria-valuemax=${max}\n aria-label=${this.label || nothing}\n >\n <span class=\"fill\" style=${fillStyle}></span>\n </span>\n ${this.label ? html`<span class=\"label\">${this.label}</span>` : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"progress-bar\": ProgressBar;\n }\n}\n"]}
1
+ {"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../src/progress-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,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;;;;GASG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA+DL,+CAA+C;QACnB,UAAK,GAAG,CAAC,CAAC;QACtC,qCAAqC;QACT,QAAG,G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B;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAiB;AAxE7C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA8FvB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\n/**\n * A determinate horizontal progress indicator — a page-level \"step 3 of 14\"\n * bar. `stat-meter` is the closest existing thing but is an inline\n * CPU-gauge-style meter with a leading label and a computed percent value;\n * `progress-bar` instead takes a raw `value`/`max` pair and renders an\n * optional plain-text `label` to the right of the bar rather than a percent\n * inside it.\n *\n * @element progress-bar\n */\n@customElement(\"progress-bar\")\nexport class ProgressBar extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n .track {\n flex: 1 1 auto;\n display: block;\n appearance: none;\n height: 0.5rem;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--track-color, var(--ui-surface-muted, #f8fafc));\n overflow: hidden;\n }\n .track::-webkit-progress-bar {\n background: transparent;\n }\n .track::-webkit-progress-value {\n background: var(--fill-color, var(--ui-button-accent, var(--ui-primary, #4f46e5)));\n transition: width 200ms ease;\n }\n .track::-moz-progress-bar {\n background: var(--fill-color, var(--ui-button-accent, var(--ui-primary, #4f46e5)));\n }\n .label {\n flex: 0 0 auto;\n font-size: var(--ui-font-size-sm, 0.75rem);\n color: var(--ui-text-muted, #64748b);\n font-variant-numeric: var(--ui-numeric, normal);\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n .track::-webkit-progress-value {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .track {\n border: 1px solid CanvasText;\n }\n .track::-webkit-progress-value,\n .track::-moz-progress-bar {\n background: Highlight;\n }\n }\n `,\n ];\n\n /** Current progress. Clamped into [0, max]. */\n @property({ type: Number }) value = 0;\n /** Value representing a full bar. */\n @property({ type: Number }) max = 100;\n /** Optional text rendered to the right of the bar (e.g. \"Question 3 out of 14\"). */\n @property() label = \"\";\n /** Fill color; defaults to the themed accent. */\n @property() color = \"\";\n /** Track color behind the fill. */\n @property({ attribute: \"track-color\" }) trackColor = \"\";\n\n override render() {\n const max = Math.max(0, this.max);\n const clamped = Math.min(max, Math.max(0, this.value));\n const style = [\n this.trackColor && `--track-color: ${this.trackColor}`,\n this.color && `--fill-color: ${this.color}`,\n ]\n .filter(Boolean)\n .join(\"; \");\n return html`\n <progress\n class=\"track\"\n style=${style}\n value=${clamped}\n max=${max || 1}\n aria-label=${this.label || nothing}\n ></progress>\n ${this.label ? html`<span class=\"label\">${this.label}</span>` : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"progress-bar\": ProgressBar;\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { LitElement, type PropertyValues } from "lit";
2
2
  /**
3
- * Generic sliding panel shell. Handles positioning, open/close animation,
4
- * header chrome, and a close button. Body content is provided via the
3
+ * Generic sliding panel shell: a non-modal native `<dialog>` (`show()`). Handles
4
+ * positioning, open/close animation, header chrome, and a close button. Body content is provided via the
5
5
  * default slot; the consumer controls its own padding and overflow.
6
6
  *
7
7
  * Desktop: fixed right-side panel that slides from the right.
@@ -16,7 +16,7 @@ export declare class SlidePanel extends LitElement {
16
16
  /** Title text shown in the panel header (overridable via slot="title"). */
17
17
  heading: string;
18
18
  static styles: import("lit").CSSResult[];
19
- private _previousFocus;
19
+ private _dialog;
20
20
  private _close;
21
21
  private _onWindowKeydown;
22
22
  protected updated(changed: PropertyValues): void;
@@ -1 +1 @@
1
- {"version":3,"file":"slide-panel.d.ts","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E;;;;;;;;;;GAUG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,8CAA8C;IACjB,IAAI,UAAS;IAC1C,2EAA2E;IAC/D,OAAO,SAAM;IAEzB,OAAgB,MAAM,4BA0HpB;IAEF,OAAO,CAAC,cAAc,CAA4B;IAElD,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,gBAAgB,CAGtB;IAEF,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAaxD;IAEQ,oBAAoB,IAAI,IAAI,CAOpC;IAEQ,MAAM,yCAwBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"slide-panel.d.ts","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E;;;;;;;;;;GAUG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,8CAA8C;IACjB,IAAI,UAAS;IAC1C,2EAA2E;IAC/D,OAAO,SAAM;IAEzB,OAAgB,MAAM,4BA+IpB;IAEe,OAAO,CAAC,OAAO,CAAqB;IAErD,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,gBAAgB,CAGtB;IAEF,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAYxD;IAEQ,oBAAoB,IAAI,IAAI,CAKpC;IAEQ,MAAM,yCAoBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -5,13 +5,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { LitElement, css, html, nothing } from "lit";
8
- import { customElement, property } from "lit/decorators.js";
8
+ import { customElement, property, query } from "lit/decorators.js";
9
9
  import { iconX } from "./icons.js";
10
10
  import { tokens } from "./tokens.js";
11
11
  import { activateLayer, claimEscape, deactivateLayer } from "./utils/layer-stack.js";
12
12
  /**
13
- * Generic sliding panel shell. Handles positioning, open/close animation,
14
- * header chrome, and a close button. Body content is provided via the
13
+ * Generic sliding panel shell: a non-modal native `<dialog>` (`show()`). Handles
14
+ * positioning, open/close animation, header chrome, and a close button. Body content is provided via the
15
15
  * default slot; the consumer controls its own padding and overflow.
16
16
  *
17
17
  * Desktop: fixed right-side panel that slides from the right.
@@ -27,7 +27,6 @@ let SlidePanel = class SlidePanel extends LitElement {
27
27
  this.open = false;
28
28
  /** Title text shown in the panel header (overridable via slot="title"). */
29
29
  this.heading = "";
30
- this._previousFocus = null;
31
30
  this._onWindowKeydown = (event) => {
32
31
  if (!this.open || !claimEscape(this, event))
33
32
  return;
@@ -41,23 +40,39 @@ let SlidePanel = class SlidePanel extends LitElement {
41
40
  display: block;
42
41
  }
43
42
  .panel {
43
+ /* Non-modal native <dialog> (show()): stays in normal stacking, so --component-layer-z still orders panels. */
44
44
  position: fixed;
45
45
  top: 0;
46
46
  right: 0;
47
47
  bottom: 0;
48
+ left: auto;
48
49
  width: 20rem;
50
+ height: auto;
51
+ margin: 0;
52
+ padding: 0;
53
+ border: 0;
54
+ color: inherit;
49
55
  z-index: var(--component-layer-z, 20);
50
56
  background: var(--ui-surface, #ffffff);
51
57
  box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));
52
58
  transform: translateX(110%);
53
- transition: transform 250ms ease;
54
- display: flex;
59
+ /* display is animated discretely so the closing slide stays visible until it finishes. */
60
+ transition:
61
+ transform 250ms ease,
62
+ display 250ms allow-discrete;
55
63
  flex-direction: column;
56
64
  overflow: hidden;
57
65
  }
58
- .panel.open {
66
+ /* Scoped to [open]: an author display value would otherwise defeat the UA's display:none. */
67
+ .panel[open] {
68
+ display: flex;
59
69
  transform: translateX(0);
60
70
  }
71
+ @starting-style {
72
+ .panel[open] {
73
+ transform: translateX(110%);
74
+ }
75
+ }
61
76
  .panel-header {
62
77
  display: flex;
63
78
  align-items: center;
@@ -139,9 +154,14 @@ let SlidePanel = class SlidePanel extends LitElement {
139
154
  );
140
155
  transform: translateY(110%);
141
156
  }
142
- .panel.open {
157
+ .panel[open] {
143
158
  transform: translateY(0);
144
159
  }
160
+ @starting-style {
161
+ .panel[open] {
162
+ transform: translateY(110%);
163
+ }
164
+ }
145
165
  .handle {
146
166
  display: block;
147
167
  width: 2.25rem;
@@ -165,37 +185,30 @@ let SlidePanel = class SlidePanel extends LitElement {
165
185
  return;
166
186
  if (this.open) {
167
187
  activateLayer(this);
168
- this._previousFocus = document.activeElement;
169
188
  window.addEventListener("keydown", this._onWindowKeydown);
189
+ if (!this._dialog.open)
190
+ this._dialog.show();
170
191
  this.shadowRoot?.querySelector(".close-btn")?.focus();
171
192
  return;
172
193
  }
173
194
  deactivateLayer(this);
174
195
  window.removeEventListener("keydown", this._onWindowKeydown);
175
- if (this._previousFocus?.isConnected)
176
- this._previousFocus.focus();
177
- this._previousFocus = null;
196
+ if (this._dialog.open)
197
+ this._dialog.close();
178
198
  }
179
199
  disconnectedCallback() {
180
200
  super.disconnectedCallback();
181
201
  window.removeEventListener("keydown", this._onWindowKeydown);
182
202
  deactivateLayer(this);
183
- if (this._previousFocus?.isConnected)
184
- this._previousFocus.focus();
185
- this._previousFocus = null;
186
203
  this.open = false;
187
204
  }
188
205
  render() {
189
206
  const explicitLabel = this.getAttribute("aria-label");
190
207
  return html `
191
- <div
192
- class="panel ${this.open ? "open" : ""}"
193
- role="dialog"
194
- aria-modal="false"
208
+ <dialog
209
+ class="panel"
195
210
  aria-label=${explicitLabel ?? nothing}
196
211
  aria-labelledby=${explicitLabel ? nothing : "panel-title"}
197
- aria-hidden=${String(!this.open)}
198
- ?inert=${!this.open}
199
212
  >
200
213
  <div class="handle" aria-hidden="true"></div>
201
214
  <div class="panel-header">
@@ -207,7 +220,7 @@ let SlidePanel = class SlidePanel extends LitElement {
207
220
  </button>
208
221
  </div>
209
222
  <slot></slot>
210
- </div>
223
+ </dialog>
211
224
  `;
212
225
  }
213
226
  };
@@ -217,6 +230,9 @@ __decorate([
217
230
  __decorate([
218
231
  property()
219
232
  ], SlidePanel.prototype, "heading", void 0);
233
+ __decorate([
234
+ query("dialog")
235
+ ], SlidePanel.prototype, "_dialog", void 0);
220
236
  SlidePanel = __decorate([
221
237
  customElement("slide-panel")
222
238
  ], SlidePanel);
@@ -1 +1 @@
1
- {"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErF;;;;;;;;;;GAUG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACL,8CAA8C;QACjB,SAAI,GAAG,KAAK,CAAC;QAC1C,2EAA2E;QAC/D,YAAO,GAAG,EAAE,CAAC;QA8HjB,mBAAc,GAAuB,IAAI,CAAC;QAM1C,qBAAgB,GAAG,CAAC,KAAoB,EAAQ,EAAE;YACxD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;gBAAE,OAAO;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC,CAAC;IAmDJ,CAAC;aAxLi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AAc,EAAE,WAAW;YAAE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAClE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAEQ,MAAM;QACb,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,IAAI,CAAA;;uBAEQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;;;qBAGzB,aAAa,IAAI,OAAO;0BACnB,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;sBAC3C,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBACvB,CAAC,IAAI,CAAC,IAAI;;;;;iCAKM,IAAI,CAAC,OAAO,IAAI,OAAO;;sEAEc,IAAI,CAAC,MAAM;uCAC1C,KAAK,CAAC,EAAE,CAAC;;;;;KAK3C,CAAC;IACJ,CAAC;CACF,CAAA;AA5L8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAc;AAE9B;IAAX,QAAQ,EAAE;2CAAc;AAJd,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA8LtB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport { activateLayer, claimEscape, deactivateLayer } from \"./utils/layer-stack.js\";\n\n/**\n * Generic sliding panel shell. Handles positioning, open/close animation,\n * header chrome, and a close button. Body content is provided via the\n * default slot; the consumer controls its own padding and overflow.\n *\n * Desktop: fixed right-side panel that slides from the right.\n * Mobile (≤48rem): bottom-sheet drawer (60vh) — reserved for future use.\n *\n * @element slide-panel\n * @fires panel-close - User clicked the close (✕) button.\n */\n@customElement(\"slide-panel\")\nexport class SlidePanel extends LitElement {\n /** Whether the panel is currently visible. */\n @property({ type: Boolean }) open = false;\n /** Title text shown in the panel header (overridable via slot=\"title\"). */\n @property() heading = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n width: 20rem;\n z-index: var(--component-layer-z, 20);\n background: var(--ui-surface, #ffffff);\n box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));\n transform: translateX(110%);\n transition: transform 250ms ease;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .panel.open {\n transform: translateX(0);\n }\n .panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n flex: 0 0 auto;\n }\n .panel-title {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size-lg, 1rem);\n line-height: var(--ui-line-height-tight, 1.25);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: 0.5rem;\n }\n .close-btn {\n background: none;\n border: none;\n cursor: pointer;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n .close-btn:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .close-btn:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .handle {\n display: none;\n }\n @media (prefers-reduced-motion: reduce) {\n .panel {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .close-btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (max-width: 48rem) {\n .panel {\n top: auto;\n right: 0;\n bottom: 0;\n left: 0;\n width: auto;\n height: 60vh;\n border-radius: var(--ui-radius, 0.5rem) var(--ui-radius, 0.5rem) 0 0;\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n transform: translateY(110%);\n }\n .panel.open {\n transform: translateY(0);\n }\n .handle {\n display: block;\n width: 2.25rem;\n height: 0.25rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n margin: 0.5rem auto 0;\n flex: 0 0 auto;\n }\n .panel-header {\n padding: 0.25rem 0.5rem 0.5rem;\n }\n }\n `,\n ];\n\n private _previousFocus: HTMLElement | null = null;\n\n private _close() {\n this.dispatchEvent(new CustomEvent(\"panel-close\", { bubbles: true, composed: true }));\n }\n\n private _onWindowKeydown = (event: KeyboardEvent): void => {\n if (!this.open || !claimEscape(this, event)) return;\n this._close();\n };\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"open\")) return;\n if (this.open) {\n activateLayer(this);\n this._previousFocus = document.activeElement as HTMLElement | null;\n window.addEventListener(\"keydown\", this._onWindowKeydown);\n this.shadowRoot?.querySelector<HTMLElement>(\".close-btn\")?.focus();\n return;\n }\n deactivateLayer(this);\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n deactivateLayer(this);\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n this.open = false;\n }\n\n override render() {\n const explicitLabel = this.getAttribute(\"aria-label\");\n return html`\n <div\n class=\"panel ${this.open ? \"open\" : \"\"}\"\n role=\"dialog\"\n aria-modal=\"false\"\n aria-label=${explicitLabel ?? nothing}\n aria-labelledby=${explicitLabel ? nothing : \"panel-title\"}\n aria-hidden=${String(!this.open)}\n ?inert=${!this.open}\n >\n <div class=\"handle\" aria-hidden=\"true\"></div>\n <div class=\"panel-header\">\n <span id=\"panel-title\" class=\"panel-title\">\n <slot name=\"title\">${this.heading || \"Panel\"}</slot>\n </span>\n <button class=\"close-btn\" aria-label=\"Close panel\" @click=${this._close}>\n <span aria-hidden=\"true\">${iconX(18)}</span>\n </button>\n </div>\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"slide-panel\": SlidePanel;\n }\n}\n"]}
1
+ {"version":3,"file":"slide-panel.js","sourceRoot":"","sources":["../src/slide-panel.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAErF;;;;;;;;;;GAUG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QACL,8CAA8C;QACjB,SAAI,GAAG,KAAK,CAAC;QAC1C,2EAA2E;QAC/D,YAAO,GAAG,EAAE,CAAC;QAyJjB,qBAAgB,GAAG,CAAC,KAAoB,EAAQ,EAAE;YACxD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC;gBAAE,OAAO;YACpD,IAAI,CAAC,MAAM,EAAE,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,CAAC;QAC7D,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACpB,CAAC;IAEQ,MAAM;QACb,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,OAAO,IAAI,CAAA;;;qBAGM,aAAa,IAAI,OAAO;0BACnB,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa;;;;;iCAKhC,IAAI,CAAC,OAAO,IAAI,OAAO;;sEAEc,IAAI,CAAC,MAAM;uCAC1C,KAAK,CAAC,EAAE,CAAC;;;;;KAK3C,CAAC;IACJ,CAAC;CACF,CAAA;AA1M8B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCAAc;AAE9B;IAAX,QAAQ,EAAE;2CAAc;AAmJA;IAAxB,KAAK,CAAC,QAAQ,CAAC;2CAAqC;AAvJ1C,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA4MtB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { iconX } from \"./icons.js\";\nimport { tokens } from \"./tokens.js\";\nimport { activateLayer, claimEscape, deactivateLayer } from \"./utils/layer-stack.js\";\n\n/**\n * Generic sliding panel shell: a non-modal native `<dialog>` (`show()`). Handles\n * positioning, open/close animation, header chrome, and a close button. Body content is provided via the\n * default slot; the consumer controls its own padding and overflow.\n *\n * Desktop: fixed right-side panel that slides from the right.\n * Mobile (≤48rem): bottom-sheet drawer (60vh) — reserved for future use.\n *\n * @element slide-panel\n * @fires panel-close - User clicked the close (✕) button.\n */\n@customElement(\"slide-panel\")\nexport class SlidePanel extends LitElement {\n /** Whether the panel is currently visible. */\n @property({ type: Boolean }) open = false;\n /** Title text shown in the panel header (overridable via slot=\"title\"). */\n @property() heading = \"\";\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .panel {\n /* Non-modal native <dialog> (show()): stays in normal stacking, so --component-layer-z still orders panels. */\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: auto;\n width: 20rem;\n height: auto;\n margin: 0;\n padding: 0;\n border: 0;\n color: inherit;\n z-index: var(--component-layer-z, 20);\n background: var(--ui-surface, #ffffff);\n box-shadow: var(--ui-shadow-lg, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));\n transform: translateX(110%);\n /* display is animated discretely so the closing slide stays visible until it finishes. */\n transition:\n transform 250ms ease,\n display 250ms allow-discrete;\n flex-direction: column;\n overflow: hidden;\n }\n /* Scoped to [open]: an author display value would otherwise defeat the UA's display:none. */\n .panel[open] {\n display: flex;\n transform: translateX(0);\n }\n @starting-style {\n .panel[open] {\n transform: translateX(110%);\n }\n }\n .panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n flex: 0 0 auto;\n }\n .panel-title {\n font-weight: var(--ui-font-weight-semibold, 600);\n font-size: var(--ui-font-size-lg, 1rem);\n line-height: var(--ui-line-height-tight, 1.25);\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n color: var(--ui-text, #0f172a);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-right: 0.5rem;\n }\n .close-btn {\n background: none;\n border: none;\n cursor: pointer;\n width: 2rem;\n height: 2rem;\n padding: 0;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n .close-btn:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .close-btn:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .handle {\n display: none;\n }\n @media (prefers-reduced-motion: reduce) {\n .panel {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .close-btn:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n }\n @media (max-width: 48rem) {\n .panel {\n top: auto;\n right: 0;\n bottom: 0;\n left: 0;\n width: auto;\n height: 60vh;\n border-radius: var(--ui-radius, 0.5rem) var(--ui-radius, 0.5rem) 0 0;\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n transform: translateY(110%);\n }\n .panel[open] {\n transform: translateY(0);\n }\n @starting-style {\n .panel[open] {\n transform: translateY(110%);\n }\n }\n .handle {\n display: block;\n width: 2.25rem;\n height: 0.25rem;\n background: var(--ui-border, #e2e8f0);\n border-radius: var(--ui-radius-pill, 9999px);\n margin: 0.5rem auto 0;\n flex: 0 0 auto;\n }\n .panel-header {\n padding: 0.25rem 0.5rem 0.5rem;\n }\n }\n `,\n ];\n\n @query(\"dialog\") private _dialog!: HTMLDialogElement;\n\n private _close() {\n this.dispatchEvent(new CustomEvent(\"panel-close\", { bubbles: true, composed: true }));\n }\n\n private _onWindowKeydown = (event: KeyboardEvent): void => {\n if (!this.open || !claimEscape(this, event)) return;\n this._close();\n };\n\n protected override updated(changed: PropertyValues): void {\n if (!changed.has(\"open\")) return;\n if (this.open) {\n activateLayer(this);\n window.addEventListener(\"keydown\", this._onWindowKeydown);\n if (!this._dialog.open) this._dialog.show();\n this.shadowRoot?.querySelector<HTMLElement>(\".close-btn\")?.focus();\n return;\n }\n deactivateLayer(this);\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n if (this._dialog.open) this._dialog.close();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._onWindowKeydown);\n deactivateLayer(this);\n this.open = false;\n }\n\n override render() {\n const explicitLabel = this.getAttribute(\"aria-label\");\n return html`\n <dialog\n class=\"panel\"\n aria-label=${explicitLabel ?? nothing}\n aria-labelledby=${explicitLabel ? nothing : \"panel-title\"}\n >\n <div class=\"handle\" aria-hidden=\"true\"></div>\n <div class=\"panel-header\">\n <span id=\"panel-title\" class=\"panel-title\">\n <slot name=\"title\">${this.heading || \"Panel\"}</slot>\n </span>\n <button class=\"close-btn\" aria-label=\"Close panel\" @click=${this._close}>\n <span aria-hidden=\"true\">${iconX(18)}</span>\n </button>\n </div>\n <slot></slot>\n </dialog>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"slide-panel\": SlidePanel;\n }\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { LitElement, nothing } from "lit";
2
+ /** One stat highlight in a strip. */
3
+ export interface StatStripItem {
4
+ /** Large figure rendered verbatim, e.g. `"54%"` or `"1.2M"`. */
5
+ value: string;
6
+ /** Short caption rendered beneath the figure, e.g. `"less code"`. */
7
+ label: string;
8
+ }
9
+ /**
10
+ * A headless, presentational strip of headline stats — one large figure plus
11
+ * one muted caption per `items` entry, wrapping across lines on narrow
12
+ * viewports. Unlike `stat-meter`, this component does not compute percentages
13
+ * or render a fill bar: callers pass preformatted figure strings as-is and
14
+ * `stat-strip` only lays them out for marketing, benchmark, or dashboard
15
+ * summary rows.
16
+ *
17
+ * @element stat-strip
18
+ */
19
+ export declare class StatStrip extends LitElement {
20
+ static styles: import("lit").CSSResult[];
21
+ /** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */
22
+ items: StatStripItem[];
23
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
24
+ }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ "stat-strip": StatStrip;
28
+ }
29
+ }
30
+ //# sourceMappingURL=stat-strip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-strip.d.ts","sourceRoot":"","sources":["../src/stat-strip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAKrD,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA0DpB;IAEF,uGAAuG;IAC5E,KAAK,EAAE,aAAa,EAAE,CAAM;IAE9C,MAAM,0DAmBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
@@ -0,0 +1,111 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, css, html, nothing } from "lit";
8
+ import { customElement, property } from "lit/decorators.js";
9
+ import { repeat } from "lit/directives/repeat.js";
10
+ import { tokens } from "./tokens.js";
11
+ /**
12
+ * A headless, presentational strip of headline stats — one large figure plus
13
+ * one muted caption per `items` entry, wrapping across lines on narrow
14
+ * viewports. Unlike `stat-meter`, this component does not compute percentages
15
+ * or render a fill bar: callers pass preformatted figure strings as-is and
16
+ * `stat-strip` only lays them out for marketing, benchmark, or dashboard
17
+ * summary rows.
18
+ *
19
+ * @element stat-strip
20
+ */
21
+ let StatStrip = class StatStrip extends LitElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ /** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */
25
+ this.items = [];
26
+ }
27
+ static { this.styles = [
28
+ tokens,
29
+ css `
30
+ :host {
31
+ display: block;
32
+ font-family: var(
33
+ --ui-font,
34
+ ui-sans-serif,
35
+ system-ui,
36
+ sans-serif,
37
+ "Apple Color Emoji",
38
+ "Segoe UI Emoji",
39
+ "Segoe UI Symbol",
40
+ "Noto Color Emoji"
41
+ );
42
+ }
43
+
44
+ .strip {
45
+ display: flex;
46
+ flex-wrap: wrap;
47
+ align-items: flex-start;
48
+ gap: 1rem 1.5rem;
49
+ margin: 0;
50
+ padding: 0;
51
+ }
52
+
53
+ .item {
54
+ display: flex;
55
+ flex: 1 1 8rem;
56
+ flex-direction: column;
57
+ gap: 0.25rem;
58
+ min-width: 8rem;
59
+ }
60
+
61
+ .value {
62
+ order: -1;
63
+ margin: 0;
64
+ color: var(--ui-primary, #4f46e5);
65
+ /* The lg title tier, same as calendar-month/popover-panel/slide-panel's
66
+ most prominent text — the shared scale is never themed for size, so
67
+ this stays the largest available step rather than a literal. */
68
+ font-size: var(--ui-font-size-lg, 1rem);
69
+ font-weight: var(--ui-font-weight-bold, 700);
70
+ line-height: var(--ui-line-height-tight, 1.25);
71
+ font-variant-numeric: var(--ui-numeric, normal);
72
+ white-space: nowrap;
73
+ }
74
+
75
+ .label {
76
+ margin: 0;
77
+ color: var(--ui-text-muted, #64748b);
78
+ font-size: var(--ui-font-size-sm, 0.75rem);
79
+ font-weight: var(--ui-font-weight-medium, 500);
80
+ letter-spacing: var(--ui-tracking-wide, 0.04em);
81
+ line-height: var(--ui-line-height-tight, 1.25);
82
+ text-transform: var(--ui-label-transform, none);
83
+ }
84
+ `,
85
+ ]; }
86
+ render() {
87
+ if (this.items.length === 0)
88
+ return nothing;
89
+ return html `
90
+ <dl class="strip">
91
+ ${repeat(this.items,
92
+ // Stat strips are short presentational rows with no intrinsic item IDs;
93
+ // keying by index deliberately preserves caller-supplied display order.
94
+ (_item, index) => index, (item) => html `
95
+ <div class="item">
96
+ <dt class="label">${item.label}</dt>
97
+ <dd class="value">${item.value}</dd>
98
+ </div>
99
+ `)}
100
+ </dl>
101
+ `;
102
+ }
103
+ };
104
+ __decorate([
105
+ property({ type: Array })
106
+ ], StatStrip.prototype, "items", void 0);
107
+ StatStrip = __decorate([
108
+ customElement("stat-strip")
109
+ ], StatStrip);
110
+ export { StatStrip };
111
+ //# sourceMappingURL=stat-strip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat-strip.js","sourceRoot":"","sources":["../src/stat-strip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;;;;;GASG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QA6DL,uGAAuG;QAC5E,UAAK,GAAoB,EAAE,CAAC;IAsBzD,CAAC;aAnFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuDF;KACF,AA1DqB,CA0DpB;IAKO,MAAM;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC;QAE5C,OAAO,IAAI,CAAA;;UAEL,MAAM,CACN,IAAI,CAAC,KAAK;QACV,wEAAwE;QACxE,wEAAwE;QACxE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EACvB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAA;;kCAEU,IAAI,CAAC,KAAK;kCACV,IAAI,CAAC,KAAK;;WAEjC,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AAtB4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCAA6B;AA9D5C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAoFrB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** One stat highlight in a strip. */\nexport interface StatStripItem {\n /** Large figure rendered verbatim, e.g. `\"54%\"` or `\"1.2M\"`. */\n value: string;\n /** Short caption rendered beneath the figure, e.g. `\"less code\"`. */\n label: string;\n}\n\n/**\n * A headless, presentational strip of headline stats — one large figure plus\n * one muted caption per `items` entry, wrapping across lines on narrow\n * viewports. Unlike `stat-meter`, this component does not compute percentages\n * or render a fill bar: callers pass preformatted figure strings as-is and\n * `stat-strip` only lays them out for marketing, benchmark, or dashboard\n * summary rows.\n *\n * @element stat-strip\n */\n@customElement(\"stat-strip\")\nexport class StatStrip extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n }\n\n .strip {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: 1rem 1.5rem;\n margin: 0;\n padding: 0;\n }\n\n .item {\n display: flex;\n flex: 1 1 8rem;\n flex-direction: column;\n gap: 0.25rem;\n min-width: 8rem;\n }\n\n .value {\n order: -1;\n margin: 0;\n color: var(--ui-primary, #4f46e5);\n /* The lg title tier, same as calendar-month/popover-panel/slide-panel's\n most prominent text — the shared scale is never themed for size, so\n this stays the largest available step rather than a literal. */\n font-size: var(--ui-font-size-lg, 1rem);\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-tight, 1.25);\n font-variant-numeric: var(--ui-numeric, normal);\n white-space: nowrap;\n }\n\n .label {\n margin: 0;\n color: var(--ui-text-muted, #64748b);\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n letter-spacing: var(--ui-tracking-wide, 0.04em);\n line-height: var(--ui-line-height-tight, 1.25);\n text-transform: var(--ui-label-transform, none);\n }\n `,\n ];\n\n /** Stats rendered in display order; each item is shown as a large figure with a caption beneath it. */\n @property({ type: Array }) items: StatStripItem[] = [];\n\n override render() {\n if (this.items.length === 0) return nothing;\n\n return html`\n <dl class=\"strip\">\n ${repeat(\n this.items,\n // Stat strips are short presentational rows with no intrinsic item IDs;\n // keying by index deliberately preserves caller-supplied display order.\n (_item, index) => index,\n (item) => html`\n <div class=\"item\">\n <dt class=\"label\">${item.label}</dt>\n <dd class=\"value\">${item.value}</dd>\n </div>\n `,\n )}\n </dl>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"stat-strip\": StatStrip;\n }\n}\n"]}
@@ -0,0 +1,46 @@
1
+ import { LitElement } from "lit";
2
+ /** One rung of a {@link StepLadder} in the data-driven `items` path. */
3
+ export interface StepLadderItem {
4
+ /** The bold step title, shown immediately after the ordinal. */
5
+ title: string;
6
+ /** The muted supporting line that explains the rung's fallback guidance. */
7
+ description: string;
8
+ }
9
+ /**
10
+ * A flat ordered ladder of fallback steps — an escalating "try this first,
11
+ * then move to the next rung only if it does not solve it" list. Each rung
12
+ * shows a zero-padded ordinal, a bold title, and a muted description, with a
13
+ * hairline rule between rows.
14
+ *
15
+ * Feed it the `items` array for the plain data path, where each
16
+ * {@link StepLadderItem} supplies a `title` and `description`, or slot bare
17
+ * `<li>` steps when a rung needs links, emphasis, or other richer markup.
18
+ * Slotted content takes precedence over `items`; with neither, nothing is
19
+ * rendered. As with `spec-list`, richer wrapper elements are accepted too, but
20
+ * those own their own inner markup.
21
+ *
22
+ * @element step-ladder
23
+ * @slot - Optional `<li>` rungs or richer step markup; when present, they
24
+ * replace the `items` path.
25
+ */
26
+ export declare class StepLadder extends LitElement {
27
+ /** The rungs for the data-driven path. Ignored when the default slot has content. */
28
+ items: StepLadderItem[];
29
+ /** Whether the default slot currently has assigned content. */
30
+ private _hasSlotted;
31
+ static styles: import("lit").CSSResult[];
32
+ /** Whether a slot node is real content, ignoring the whitespace ordinary indented markup leaves between children. */
33
+ private static _isContent;
34
+ /** Tracks whether the default slot has content so slotted markup can take precedence over `items`. */
35
+ private _onSlotChange;
36
+ connectedCallback(): void;
37
+ /** The rungs, defended against a non-array value assigned at runtime by a JS or HTML consumer. */
38
+ private _rows;
39
+ render(): import("lit-html").TemplateResult<1>;
40
+ }
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ "step-ladder": StepLadder;
44
+ }
45
+ }
46
+ //# sourceMappingURL=step-ladder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-ladder.d.ts","sourceRoot":"","sources":["../src/step-ladder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,UAAW,SAAQ,UAAU;IACxC,qFAAqF;IAC1D,KAAK,EAAE,cAAc,EAAE,CAAM;IAExD,+DAA+D;IACtD,OAAO,CAAC,WAAW,CAAS;IAErC,OAAgB,MAAM,4BA+EpB;IAEF,qHAAqH;IACrH,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,sGAAsG;IACtG,OAAO,CAAC,aAAa;IAKZ,iBAAiB,IAAI,IAAI,CAOjC;IAED,kGAAkG;IAClG,OAAO,CAAC,KAAK;IAIJ,MAAM,yCA4Bd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}