From 8597d753f95eea8b239fee888759bf713bbf8847 Mon Sep 17 00:00:00 2001 From: terra tauri Date: Thu, 28 May 2026 23:54:41 -0400 Subject: [PATCH 1/8] fix(kpi): wrap long values instead of bursting the card A long text value like "@bitcomplete.io" at 1.9rem monospace overflows the KPI card boundary in a grid track, because: - the value had no overflow-wrap setting - the card had no min-width: 0 (so grid couldn't shrink it) Add overflow-wrap: anywhere + word-break: break-word to the value/label/ trend, and min-width: 0 on the card so it actually participates in grid shrinking. Numeric values stay big and bold; text values wrap to 2 lines at the same size. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/styles.ts | 13 ++++++++++--- src/styles.css | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/components/styles.ts b/src/components/styles.ts index 1d5497f..93d326f 100644 --- a/src/components/styles.ts +++ b/src/components/styles.ts @@ -179,15 +179,22 @@ export const stylesheet = `/* @bitcomplete/mdx-components v0.1 */ padding: 1rem; border-radius: var(--bc-radius); border: 1px solid var(--bc-line); + /* In a grid track, content can otherwise refuse to shrink below its + * intrinsic width, which is what was bursting the cards on long + * text values. */ + min-width: 0; } .bc-kpi-value{ font-family: var(--bc-mono); font-size: 1.9rem; font-weight: 600; - line-height: 1; + line-height: 1.1; + /* Wrap rather than overflow when the value isn't a short number. */ + overflow-wrap: anywhere; + word-break: break-word; } -.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em} -.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted)} +.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em;overflow-wrap:anywhere} +.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted);overflow-wrap:anywhere} .bc-kpi-ok .bc-kpi-value{color:var(--bc-success)} .bc-kpi-warn .bc-kpi-value{color:var(--bc-warn)} .bc-kpi-err .bc-kpi-value{color:var(--bc-danger)} diff --git a/src/styles.css b/src/styles.css index 7648a7c..9e755cb 100644 --- a/src/styles.css +++ b/src/styles.css @@ -175,15 +175,22 @@ padding: 1rem; border-radius: var(--bc-radius); border: 1px solid var(--bc-line); + /* In a grid track, content can otherwise refuse to shrink below its + * intrinsic width, which is what was bursting the cards on long + * text values. */ + min-width: 0; } .bc-kpi-value{ font-family: var(--bc-mono); font-size: 1.9rem; font-weight: 600; - line-height: 1; + line-height: 1.1; + /* Wrap rather than overflow when the value isn't a short number. */ + overflow-wrap: anywhere; + word-break: break-word; } -.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em} -.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted)} +.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em;overflow-wrap:anywhere} +.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted);overflow-wrap:anywhere} .bc-kpi-ok .bc-kpi-value{color:var(--bc-success)} .bc-kpi-warn .bc-kpi-value{color:var(--bc-warn)} .bc-kpi-err .bc-kpi-value{color:var(--bc-danger)} From 4b2e8d22c25a8c820671b8808f56d487bb368255 Mon Sep 17 00:00:00 2001 From: terra tauri Date: Fri, 29 May 2026 09:19:36 -0400 Subject: [PATCH 2/8] feat: port to React + Tailwind v4 + Agentic Craft visuals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch from Preact static-HTML to React 19 + Tailwind v4 inside the v8go sandbox. Vendor agentic-craft's `tool-call` and `tool-tree` from their shadcn registry verbatim. Rewrite the remaining components (TLDR, KPI, Callout, Steps, Compare, Finding, Approval, Timeline, Tag, Status, Diff, Section, Quote, Code, Diagram) using Tailwind classes that mirror Agentic Craft's editorial visual language, with `data-slot` markers so each can be swapped for an upstream registry equivalent later. Build pipeline: - Tailwind v4 CLI compiles src/styles/tailwind.css → dist/styles.css - scripts/embed-css.mjs writes it as a TS string for tsup to inline - tsup bundles the IIFE with React + react-dom/server.edge - Polyfills (TextEncoder/TextDecoder/AbortController) for v8go Bundle: 512 KB → 760 KB. Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 22 +- pnpm-lock.yaml | 650 ++++++++++++++++++++++++++++++-- scripts/embed-css.mjs | 17 + src/bundle.ts | 2 + src/compile.ts | 54 +-- src/components/agent.tsx | 97 ----- src/components/blocks.tsx | 88 ----- src/components/data.tsx | 79 ---- src/components/index.ts | 10 - src/components/index.tsx | 166 ++++++++ src/components/layout.tsx | 73 ---- src/components/styles.ts | 423 +-------------------- src/components/timeline.tsx | 29 -- src/components/ui/approval.tsx | 72 ++++ src/components/ui/callout.tsx | 85 +++++ src/components/ui/code.tsx | 27 ++ src/components/ui/compare.tsx | 50 +++ src/components/ui/diagram.tsx | 22 ++ src/components/ui/diff.tsx | 39 ++ src/components/ui/finding.tsx | 82 ++++ src/components/ui/kpi.tsx | 80 ++++ src/components/ui/quote.tsx | 28 ++ src/components/ui/section.tsx | 28 ++ src/components/ui/steps.tsx | 94 +++++ src/components/ui/tag.tsx | 64 ++++ src/components/ui/timeline.tsx | 79 ++++ src/components/ui/tldr.tsx | 34 ++ src/components/ui/tool-call.tsx | 202 ++++++++++ src/components/ui/tool-tree.tsx | 151 ++++++++ src/lib/utils.ts | 6 + src/polyfills.ts | 129 +++++++ src/styles.css | 415 -------------------- src/styles/tailwind.css | 206 ++++++++++ tsconfig.json | 5 +- tsup.config.ts | 8 + 35 files changed, 2323 insertions(+), 1293 deletions(-) create mode 100644 scripts/embed-css.mjs delete mode 100644 src/components/agent.tsx delete mode 100644 src/components/blocks.tsx delete mode 100644 src/components/data.tsx delete mode 100644 src/components/index.ts create mode 100644 src/components/index.tsx delete mode 100644 src/components/layout.tsx delete mode 100644 src/components/timeline.tsx create mode 100644 src/components/ui/approval.tsx create mode 100644 src/components/ui/callout.tsx create mode 100644 src/components/ui/code.tsx create mode 100644 src/components/ui/compare.tsx create mode 100644 src/components/ui/diagram.tsx create mode 100644 src/components/ui/diff.tsx create mode 100644 src/components/ui/finding.tsx create mode 100644 src/components/ui/kpi.tsx create mode 100644 src/components/ui/quote.tsx create mode 100644 src/components/ui/section.tsx create mode 100644 src/components/ui/steps.tsx create mode 100644 src/components/ui/tag.tsx create mode 100644 src/components/ui/timeline.tsx create mode 100644 src/components/ui/tldr.tsx create mode 100644 src/components/ui/tool-call.tsx create mode 100644 src/components/ui/tool-tree.tsx create mode 100644 src/lib/utils.ts create mode 100644 src/polyfills.ts delete mode 100644 src/styles.css create mode 100644 src/styles/tailwind.css diff --git a/package.json b/package.json index 42f52b1..d0961fb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@bitcomplete/mdx-components", - "version": "0.1.0", - "description": "MDX components for agent-generated documents: plans, reports, session summaries. Static HTML output, no React runtime needed in the browser.", + "version": "0.2.0", + "description": "MDX components for agent-generated documents: plans, reports, session summaries. Static HTML output with Agentic Craft visuals, no React runtime needed in the browser.", "keywords": [ "mdx", "components", @@ -36,8 +36,10 @@ "LICENSE" ], "scripts": { - "build": "tsup && cp src/styles.css dist/styles.css", - "dev": "tsup --watch", + "build:css": "tailwindcss -i src/styles/tailwind.css -o dist/styles.css --minify && node scripts/embed-css.mjs", + "build:js": "tsup", + "build": "pnpm run build:css && pnpm run build:js", + "dev": "pnpm run build:css && tsup --watch", "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc --noEmit", @@ -45,12 +47,20 @@ "prepublishOnly": "pnpm run build" }, "dependencies": { + "@hugeicons/core-free-icons": "^4.0.0", + "@hugeicons/react": "^1.1.6", "@mdx-js/mdx": "^3.1.0", - "preact": "^10.25.0", - "preact-render-to-string": "^6.5.13" + "clsx": "^2.1.1", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "tailwind-merge": "^3.5.0" }, "devDependencies": { + "@tailwindcss/cli": "^4.2.1", "@types/node": "^22.10.0", + "@types/react": "^19.2.0", + "@types/react-dom": "^19.2.0", + "tailwindcss": "^4.2.1", "tsup": "^8.3.5", "typescript": "^5.7.2", "vitest": "^2.1.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c546e71..96e3cdc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,28 +8,52 @@ importers: .: dependencies: + '@hugeicons/core-free-icons': + specifier: ^4.0.0 + version: 4.2.0 + '@hugeicons/react': + specifier: ^1.1.6 + version: 1.1.6(react@19.2.6) '@mdx-js/mdx': specifier: ^3.1.0 version: 3.1.1 - preact: - specifier: ^10.25.0 - version: 10.29.2 - preact-render-to-string: - specifier: ^6.5.13 - version: 6.7.0(preact@10.29.2) + clsx: + specifier: ^2.1.1 + version: 2.1.1 + react: + specifier: ^19.2.0 + version: 19.2.6 + react-dom: + specifier: ^19.2.0 + version: 19.2.6(react@19.2.6) + tailwind-merge: + specifier: ^3.5.0 + version: 3.6.0 devDependencies: + '@tailwindcss/cli': + specifier: ^4.2.1 + version: 4.3.0 '@types/node': specifier: ^22.10.0 version: 22.19.19 + '@types/react': + specifier: ^19.2.0 + version: 19.2.15 + '@types/react-dom': + specifier: ^19.2.0 + version: 19.2.3(@types/react@19.2.15) + tailwindcss: + specifier: ^4.2.1 + version: 4.3.0 tsup: specifier: ^8.3.5 - version: 8.5.1(postcss@8.5.15)(typescript@5.9.3) + version: 8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@5.9.3) typescript: specifier: ^5.7.2 version: 5.9.3 vitest: specifier: ^2.1.8 - version: 2.1.9(@types/node@22.19.19) + version: 2.1.9(@types/node@22.19.19)(lightningcss@1.32.0) packages: @@ -327,9 +351,20 @@ packages: cpu: [x64] os: [win32] + '@hugeicons/core-free-icons@4.2.0': + resolution: {integrity: sha512-V1G/Ph9TbmEow+pKnupZRWQjdORR/TGGr3JVRZOWkomdJ/5N6GgLuKPgBDs7G0kZ0//9LL34AGOUzWe3K+umNA==} + + '@hugeicons/react@1.1.6': + resolution: {integrity: sha512-c2LhXJMAW5wN1pC/smBXG0YPqUON6ceR/ZdXHCjEI9KvB+hjtqYjmzIxok5hAQOeXGz0WtORgCQMzqewFKAZwg==} + peerDependencies: + react: '>=16.0.0' + '@jridgewell/gen-mapping@0.3.13': resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} + '@jridgewell/remapping@2.3.5': + resolution: {integrity: sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -343,6 +378,94 @@ packages: '@mdx-js/mdx@3.1.1': resolution: {integrity: sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==} + '@parcel/watcher-android-arm64@2.5.6': + resolution: {integrity: sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + + '@parcel/watcher-darwin-arm64@2.5.6': + resolution: {integrity: sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + + '@parcel/watcher-darwin-x64@2.5.6': + resolution: {integrity: sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + + '@parcel/watcher-freebsd-x64@2.5.6': + resolution: {integrity: sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + + '@parcel/watcher-linux-arm-glibc@2.5.6': + resolution: {integrity: sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm-musl@2.5.6': + resolution: {integrity: sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-arm64-glibc@2.5.6': + resolution: {integrity: sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-arm64-musl@2.5.6': + resolution: {integrity: sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@parcel/watcher-linux-x64-glibc@2.5.6': + resolution: {integrity: sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@parcel/watcher-linux-x64-musl@2.5.6': + resolution: {integrity: sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@parcel/watcher-win32-arm64@2.5.6': + resolution: {integrity: sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + + '@parcel/watcher-win32-ia32@2.5.6': + resolution: {integrity: sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + + '@parcel/watcher-win32-x64@2.5.6': + resolution: {integrity: sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + + '@parcel/watcher@2.5.6': + resolution: {integrity: sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==} + engines: {node: '>= 10.0.0'} + '@rollup/rollup-android-arm-eabi@4.60.4': resolution: {integrity: sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ==} cpu: [arm] @@ -481,6 +604,99 @@ packages: cpu: [x64] os: [win32] + '@tailwindcss/cli@4.3.0': + resolution: {integrity: sha512-X9kdlqyMopO9fewbgHsEeuy31YzMHbdZ9VsKt004tB+mxSg1CNbyhZYCzvhciN0AM4R4b5lvIprPjtNq7iQxpQ==} + hasBin: true + + '@tailwindcss/node@4.3.0': + resolution: {integrity: sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==} + + '@tailwindcss/oxide-android-arm64@4.3.0': + resolution: {integrity: sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [android] + + '@tailwindcss/oxide-darwin-arm64@4.3.0': + resolution: {integrity: sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [darwin] + + '@tailwindcss/oxide-darwin-x64@4.3.0': + resolution: {integrity: sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==} + engines: {node: '>= 20'} + cpu: [x64] + os: [darwin] + + '@tailwindcss/oxide-freebsd-x64@4.3.0': + resolution: {integrity: sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [freebsd] + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': + resolution: {integrity: sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==} + engines: {node: '>= 20'} + cpu: [arm] + os: [linux] + + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': + resolution: {integrity: sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': + resolution: {integrity: sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': + resolution: {integrity: sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@tailwindcss/oxide-linux-x64-musl@4.3.0': + resolution: {integrity: sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==} + engines: {node: '>= 20'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@tailwindcss/oxide-wasm32-wasi@4.3.0': + resolution: {integrity: sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + bundledDependencies: + - '@napi-rs/wasm-runtime' + - '@emnapi/core' + - '@emnapi/runtime' + - '@tybys/wasm-util' + - '@emnapi/wasi-threads' + - tslib + + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': + resolution: {integrity: sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==} + engines: {node: '>= 20'} + cpu: [arm64] + os: [win32] + + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': + resolution: {integrity: sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==} + engines: {node: '>= 20'} + cpu: [x64] + os: [win32] + + '@tailwindcss/oxide@4.3.0': + resolution: {integrity: sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==} + engines: {node: '>= 20'} + '@types/debug@4.1.13': resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} @@ -508,6 +724,14 @@ packages: '@types/node@22.19.19': resolution: {integrity: sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==} + '@types/react-dom@19.2.3': + resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} + peerDependencies: + '@types/react': ^19.2.0 + + '@types/react@19.2.15': + resolution: {integrity: sha512-eRwcGNHve+E8qtEQSSRl6urh+rFop4v8gm6O8rGv25CodbvFdLjA1vVQ1KkiFE0w0UPOnb8tDiFKL5lp0rtY5Q==} + '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} @@ -607,6 +831,10 @@ packages: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -624,6 +852,9 @@ packages: resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -644,9 +875,17 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + enhanced-resolve@5.22.1: + resolution: {integrity: sha512-6QEuw3zoX1SJQc7b87aBXke/no+mG2bTBgw29gWMQonLmpEkWoCAVkl+M49e48AZlWzxiDzDZzYdp6kobcyLww==} + engines: {node: '>=10.13.0'} + es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} @@ -711,6 +950,9 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + hast-util-to-estree@3.1.3: resolution: {integrity: sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==} @@ -732,6 +974,14 @@ packages: is-decimal@2.0.1: resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} @@ -739,10 +989,88 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} + jiti@2.7.0: + resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} + hasBin: true + joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} + engines: {node: '>= 12.0.0'} + lilconfig@3.1.3: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} @@ -881,6 +1209,10 @@ packages: mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} + mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -892,6 +1224,9 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + node-addon-api@7.1.1: + resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -945,17 +1280,18 @@ packages: resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} engines: {node: ^10 || ^12 || >=14} - preact-render-to-string@6.7.0: - resolution: {integrity: sha512-Z4WR8fmLMRpdYqJ9i7vrlXSsSrxVJydwrkEXHapexfARbWfGb7vGcnvNQnIzN0cXciMVOlz/XLoiMCi9gUsy9Q==} - peerDependencies: - preact: '>=10 || >= 11.0.0-0' - - preact@10.29.2: - resolution: {integrity: sha512-7tNmwg/7mzzAoB/8kSg6Hl37JraAZw3Z3A0JSY7VXlZwo82Xn0G7wKbNNs2qoF4ZEEsQGTwDAroNdqKs1ofJxQ==} - property-information@7.1.0: resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} + react-dom@19.2.6: + resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} + peerDependencies: + react: ^19.2.6 + + react@19.2.6: + resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} + engines: {node: '>=0.10.0'} + readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -995,6 +1331,9 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + scheduler@0.27.0: + resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} + siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -1029,6 +1368,16 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + tailwind-merge@3.6.0: + resolution: {integrity: sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==} + + tailwindcss@4.3.0: + resolution: {integrity: sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==} + + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} + engines: {node: '>=6'} + thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -1346,11 +1695,22 @@ snapshots: '@esbuild/win32-x64@0.27.7': optional: true + '@hugeicons/core-free-icons@4.2.0': {} + + '@hugeicons/react@1.1.6(react@19.2.6)': + dependencies: + react: 19.2.6 + '@jridgewell/gen-mapping@0.3.13': dependencies: '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/remapping@2.3.5': + dependencies: + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 + '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/sourcemap-codec@1.5.5': {} @@ -1390,6 +1750,66 @@ snapshots: transitivePeerDependencies: - supports-color + '@parcel/watcher-android-arm64@2.5.6': + optional: true + + '@parcel/watcher-darwin-arm64@2.5.6': + optional: true + + '@parcel/watcher-darwin-x64@2.5.6': + optional: true + + '@parcel/watcher-freebsd-x64@2.5.6': + optional: true + + '@parcel/watcher-linux-arm-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-arm-musl@2.5.6': + optional: true + + '@parcel/watcher-linux-arm64-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-arm64-musl@2.5.6': + optional: true + + '@parcel/watcher-linux-x64-glibc@2.5.6': + optional: true + + '@parcel/watcher-linux-x64-musl@2.5.6': + optional: true + + '@parcel/watcher-win32-arm64@2.5.6': + optional: true + + '@parcel/watcher-win32-ia32@2.5.6': + optional: true + + '@parcel/watcher-win32-x64@2.5.6': + optional: true + + '@parcel/watcher@2.5.6': + dependencies: + detect-libc: 2.1.2 + is-glob: 4.0.3 + node-addon-api: 7.1.1 + picomatch: 4.0.4 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.5.6 + '@parcel/watcher-darwin-arm64': 2.5.6 + '@parcel/watcher-darwin-x64': 2.5.6 + '@parcel/watcher-freebsd-x64': 2.5.6 + '@parcel/watcher-linux-arm-glibc': 2.5.6 + '@parcel/watcher-linux-arm-musl': 2.5.6 + '@parcel/watcher-linux-arm64-glibc': 2.5.6 + '@parcel/watcher-linux-arm64-musl': 2.5.6 + '@parcel/watcher-linux-x64-glibc': 2.5.6 + '@parcel/watcher-linux-x64-musl': 2.5.6 + '@parcel/watcher-win32-arm64': 2.5.6 + '@parcel/watcher-win32-ia32': 2.5.6 + '@parcel/watcher-win32-x64': 2.5.6 + '@rollup/rollup-android-arm-eabi@4.60.4': optional: true @@ -1465,6 +1885,77 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.60.4': optional: true + '@tailwindcss/cli@4.3.0': + dependencies: + '@parcel/watcher': 2.5.6 + '@tailwindcss/node': 4.3.0 + '@tailwindcss/oxide': 4.3.0 + enhanced-resolve: 5.22.1 + mri: 1.2.0 + picocolors: 1.1.1 + tailwindcss: 4.3.0 + + '@tailwindcss/node@4.3.0': + dependencies: + '@jridgewell/remapping': 2.3.5 + enhanced-resolve: 5.22.1 + jiti: 2.7.0 + lightningcss: 1.32.0 + magic-string: 0.30.21 + source-map-js: 1.2.1 + tailwindcss: 4.3.0 + + '@tailwindcss/oxide-android-arm64@4.3.0': + optional: true + + '@tailwindcss/oxide-darwin-arm64@4.3.0': + optional: true + + '@tailwindcss/oxide-darwin-x64@4.3.0': + optional: true + + '@tailwindcss/oxide-freebsd-x64@4.3.0': + optional: true + + '@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0': + optional: true + + '@tailwindcss/oxide-linux-arm64-gnu@4.3.0': + optional: true + + '@tailwindcss/oxide-linux-arm64-musl@4.3.0': + optional: true + + '@tailwindcss/oxide-linux-x64-gnu@4.3.0': + optional: true + + '@tailwindcss/oxide-linux-x64-musl@4.3.0': + optional: true + + '@tailwindcss/oxide-wasm32-wasi@4.3.0': + optional: true + + '@tailwindcss/oxide-win32-arm64-msvc@4.3.0': + optional: true + + '@tailwindcss/oxide-win32-x64-msvc@4.3.0': + optional: true + + '@tailwindcss/oxide@4.3.0': + optionalDependencies: + '@tailwindcss/oxide-android-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-arm64': 4.3.0 + '@tailwindcss/oxide-darwin-x64': 4.3.0 + '@tailwindcss/oxide-freebsd-x64': 4.3.0 + '@tailwindcss/oxide-linux-arm-gnueabihf': 4.3.0 + '@tailwindcss/oxide-linux-arm64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-arm64-musl': 4.3.0 + '@tailwindcss/oxide-linux-x64-gnu': 4.3.0 + '@tailwindcss/oxide-linux-x64-musl': 4.3.0 + '@tailwindcss/oxide-wasm32-wasi': 4.3.0 + '@tailwindcss/oxide-win32-arm64-msvc': 4.3.0 + '@tailwindcss/oxide-win32-x64-msvc': 4.3.0 + '@types/debug@4.1.13': dependencies: '@types/ms': 2.1.0 @@ -1493,6 +1984,14 @@ snapshots: dependencies: undici-types: 6.21.0 + '@types/react-dom@19.2.3(@types/react@19.2.15)': + dependencies: + '@types/react': 19.2.15 + + '@types/react@19.2.15': + dependencies: + csstype: 3.2.3 + '@types/unist@2.0.11': {} '@types/unist@3.0.3': {} @@ -1506,13 +2005,13 @@ snapshots: chai: 5.3.3 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.9(vite@5.4.21(@types/node@22.19.19))': + '@vitest/mocker@2.1.9(vite@5.4.21(@types/node@22.19.19)(lightningcss@1.32.0))': dependencies: '@vitest/spy': 2.1.9 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 5.4.21(@types/node@22.19.19) + vite: 5.4.21(@types/node@22.19.19)(lightningcss@1.32.0) '@vitest/pretty-format@2.1.9': dependencies: @@ -1584,6 +2083,8 @@ snapshots: dependencies: readdirp: 4.1.2 + clsx@2.1.1: {} + collapse-white-space@2.1.0: {} comma-separated-tokens@2.0.3: {} @@ -1594,6 +2095,8 @@ snapshots: consola@3.4.2: {} + csstype@3.2.3: {} + debug@4.4.3: dependencies: ms: 2.1.3 @@ -1606,10 +2109,17 @@ snapshots: dequal@2.0.3: {} + detect-libc@2.1.2: {} + devlop@1.1.0: dependencies: dequal: 2.0.3 + enhanced-resolve@5.22.1: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.3 + es-module-lexer@1.7.0: {} esast-util-from-estree@2.0.0: @@ -1731,6 +2241,8 @@ snapshots: fsevents@2.3.3: optional: true + graceful-fs@4.2.11: {} + hast-util-to-estree@3.1.3: dependencies: '@types/estree': 1.0.9 @@ -1787,12 +2299,69 @@ snapshots: is-decimal@2.0.1: {} + is-extglob@2.1.1: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + is-hexadecimal@2.0.1: {} is-plain-obj@4.1.0: {} + jiti@2.7.0: {} + joycon@3.1.1: {} + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + lightningcss-win32-arm64-msvc: 1.32.0 + lightningcss-win32-x64-msvc: 1.32.0 + lilconfig@3.1.3: {} lines-and-columns@1.2.4: {} @@ -2121,6 +2690,8 @@ snapshots: pkg-types: 1.3.1 ufo: 1.6.4 + mri@1.2.0: {} + ms@2.1.3: {} mz@2.7.0: @@ -2131,6 +2702,8 @@ snapshots: nanoid@3.3.12: {} + node-addon-api@7.1.1: {} + object-assign@4.1.1: {} parse-entities@4.0.2: @@ -2161,10 +2734,11 @@ snapshots: mlly: 1.8.2 pathe: 2.0.3 - postcss-load-config@6.0.1(postcss@8.5.15): + postcss-load-config@6.0.1(jiti@2.7.0)(postcss@8.5.15): dependencies: lilconfig: 3.1.3 optionalDependencies: + jiti: 2.7.0 postcss: 8.5.15 postcss@8.5.15: @@ -2173,13 +2747,14 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - preact-render-to-string@6.7.0(preact@10.29.2): - dependencies: - preact: 10.29.2 + property-information@7.1.0: {} - preact@10.29.2: {} + react-dom@19.2.6(react@19.2.6): + dependencies: + react: 19.2.6 + scheduler: 0.27.0 - property-information@7.1.0: {} + react@19.2.6: {} readdirp@4.1.2: {} @@ -2277,6 +2852,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.60.4 fsevents: 2.3.3 + scheduler@0.27.0: {} + siginfo@2.0.0: {} source-map-js@1.2.1: {} @@ -2312,6 +2889,12 @@ snapshots: tinyglobby: 0.2.16 ts-interface-checker: 0.1.13 + tailwind-merge@3.6.0: {} + + tailwindcss@4.3.0: {} + + tapable@2.3.3: {} + thenify-all@1.6.0: dependencies: thenify: 3.3.1 @@ -2343,7 +2926,7 @@ snapshots: ts-interface-checker@0.1.13: {} - tsup@8.5.1(postcss@8.5.15)(typescript@5.9.3): + tsup@8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@5.9.3): dependencies: bundle-require: 5.1.0(esbuild@0.27.7) cac: 6.7.14 @@ -2354,7 +2937,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(postcss@8.5.15) + postcss-load-config: 6.0.1(jiti@2.7.0)(postcss@8.5.15) resolve-from: 5.0.0 rollup: 4.60.4 source-map: 0.7.6 @@ -2424,13 +3007,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-node@2.1.9(@types/node@22.19.19): + vite-node@2.1.9(@types/node@22.19.19)(lightningcss@1.32.0): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 1.1.2 - vite: 5.4.21(@types/node@22.19.19) + vite: 5.4.21(@types/node@22.19.19)(lightningcss@1.32.0) transitivePeerDependencies: - '@types/node' - less @@ -2442,7 +3025,7 @@ snapshots: - supports-color - terser - vite@5.4.21(@types/node@22.19.19): + vite@5.4.21(@types/node@22.19.19)(lightningcss@1.32.0): dependencies: esbuild: 0.21.5 postcss: 8.5.15 @@ -2450,11 +3033,12 @@ snapshots: optionalDependencies: '@types/node': 22.19.19 fsevents: 2.3.3 + lightningcss: 1.32.0 - vitest@2.1.9(@types/node@22.19.19): + vitest@2.1.9(@types/node@22.19.19)(lightningcss@1.32.0): dependencies: '@vitest/expect': 2.1.9 - '@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@22.19.19)) + '@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@22.19.19)(lightningcss@1.32.0)) '@vitest/pretty-format': 2.1.9 '@vitest/runner': 2.1.9 '@vitest/snapshot': 2.1.9 @@ -2470,8 +3054,8 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.1.1 tinyrainbow: 1.2.0 - vite: 5.4.21(@types/node@22.19.19) - vite-node: 2.1.9(@types/node@22.19.19) + vite: 5.4.21(@types/node@22.19.19)(lightningcss@1.32.0) + vite-node: 2.1.9(@types/node@22.19.19)(lightningcss@1.32.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.19.19 diff --git a/scripts/embed-css.mjs b/scripts/embed-css.mjs new file mode 100644 index 0000000..1e85675 --- /dev/null +++ b/scripts/embed-css.mjs @@ -0,0 +1,17 @@ +// Read dist/styles.css and write src/components/styles.ts exporting it as a +// string literal. tsup picks the .ts up and inlines it into the IIFE so the +// compiled bundle ships its own stylesheet — no filesystem access at run +// time. + +import { readFileSync, writeFileSync } from "node:fs"; + +const css = readFileSync("dist/styles.css", "utf8"); +const escaped = "`" + css.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${") + "`"; + +writeFileSync( + "src/components/styles.ts", + `// AUTO-GENERATED by scripts/embed-css.mjs. Edit src/styles/tailwind.css instead.\n` + + `export const stylesheet = ${escaped};\n`, +); + +console.log(`embed-css: wrote ${css.length} bytes → src/components/styles.ts`); diff --git a/src/bundle.ts b/src/bundle.ts index d65bd01..76bf66c 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -3,6 +3,8 @@ // bundled in (tsup's `noExternal: [/.*/]`). Exposes a synchronous // `compileMDX(source)` on `globalThis` that returns `{ html, css }`. +// Polyfills first — must execute before React loads. See polyfills.ts. +import "./polyfills.js"; import { renderMDX } from "./compile.js"; import { stylesheet } from "./components/styles.js"; diff --git a/src/compile.ts b/src/compile.ts index dc43132..2b49e30 100644 --- a/src/compile.ts +++ b/src/compile.ts @@ -1,34 +1,23 @@ -// MDX → static HTML. -// -// We compile MDX *synchronously* so this works inside v8go (which has no -// event loop). `@mdx-js/mdx`'s `compileSync` produces an ES module source -// string that we then eval; the module exports a default function that -// returns a preact VNode when called with our components. +// MDX → static HTML, synchronously (works inside v8go which has no event +// loop). import { compileSync } from "@mdx-js/mdx"; -import { h, type ComponentChildren } from "preact"; -import { jsx, jsxs, Fragment } from "preact/jsx-runtime"; -import { renderToString } from "preact-render-to-string"; +import { createElement, type ReactNode } from "react"; +import { jsx, jsxs, Fragment } from "react/jsx-runtime"; +// `react-dom/server.edge` works in environments that have neither Node +// built-ins (stream / crypto / async_hooks) nor the DOM's MessageChannel. +// v8go is one of those. The other server entries fail to load. +import { renderToString } from "react-dom/server.edge"; import * as componentsImport from "./components/index.js"; import { stylesheet } from "./components/styles.js"; export interface CompileResult { - /** Rendered HTML *body* (no / wrapper). */ html: string; - /** Stylesheet to inline. Same value for every compile; safe to cache. */ css: string; - /** A self-contained HTML document wrapping html + css. */ document: string; } -/** - * Compile MDX source to static HTML. - * - * - The result includes a stylesheet you can either inline (via `document`) - * or serve as a separate file. - * - Pure function: no I/O, no network, deterministic given the same input. - */ export function compileMDX(source: string): CompileResult { const html = renderMDX(source); return { @@ -38,58 +27,39 @@ export function compileMDX(source: string): CompileResult { }; } -/** Render only — for embedding pieces into a larger page. */ export function renderMDX(source: string): string { - // Strip top-of-file ES `import` statements. MDX would otherwise turn - // them into `await import(...)`, which can't run inside `new Function` - // (no top-level await). All our components are auto-provided via the - // `components` prop, so authors don't actually need imports — but - // accept-and-ignore is friendlier than failing on them. const stripped = stripLeadingImports(source); const compiled = compileSync(stripped, { outputFormat: "function-body", development: false, - jsxImportSource: "preact", + jsxImportSource: "react", providerImportSource: undefined, }); - // The "function-body" output reads its JSX runtime from `arguments[0]` - // and returns `{ default: MDXContent }`. The runtime is the same object - // shape as preact/jsx-runtime. // eslint-disable-next-line @typescript-eslint/no-implied-eval const factory = new Function(String(compiled)); const mod = factory({ jsx, jsxs, Fragment }) as { default: (props: { components?: Record; - }) => ComponentChildren; + }) => ReactNode; }; - const tree = h(mod.default as never, { components: componentsImport }); - return renderToString(tree as never); + const tree = createElement(mod.default, { components: componentsImport }); + return renderToString(tree); } -/** - * Drop ESM `import` statements that appear before the first non-import, - * non-blank line. Preserves everything below (so an `import` lurking - * inside a code-block survives). Tolerates single-line and multi-line - * import forms (`import {\n A,\n B,\n} from '...'`). - */ function stripLeadingImports(src: string): string { const lines = src.split(/\r?\n/); let i = 0; while (i < lines.length) { const trimmed = lines[i].trim(); if (trimmed === "" || trimmed.startsWith("//")) { - // Skip blank / comment lines but don't write them either; markdown - // doesn't care about extra blank lines at the top. i++; continue; } if (trimmed.startsWith("import ")) { - // Consume until the line ends with a semicolon or a quote-then-EOL. while (i < lines.length && !/['"`];?\s*$/.test(lines[i])) i++; i++; continue; } - // First non-blank, non-import line: the rest of the file is content. break; } return lines.slice(i).join("\n"); diff --git a/src/components/agent.tsx b/src/components/agent.tsx deleted file mode 100644 index 5708871..0000000 --- a/src/components/agent.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import type { ComponentChildren } from "preact"; - -export type ToolStatus = "running" | "ok" | "fail" | "skip"; - -// Inspired by Agentic Craft's ToolCall — a visual record of an LLM -// tool invocation. Static (no spinners or live updates); the "status" -// is a snapshot at the time of share. -export function ToolCall({ - name, - status, - timing, - args, - children, -}: { - name: string; - status?: ToolStatus; - timing?: string; - args?: string; - children?: ComponentChildren; -}) { - const statusCls = status ? ` bc-tool-${status}` : ""; - return ( -
-
- {name} - {timing ? {timing} : null} - {status ? {status} : null} -
- {args ?
{args}
: null} - {children ?
{children}
: null} -
- ); -} - -// Tree visualization — ``s nested inside `` get L-connector -// styling. Style is delivered by CSS so we don't have to know the tree shape. -export function ToolTree({ children }: { children: ComponentChildren }) { - return
{children}
; -} - -export type Severity = "info" | "low" | "medium" | "high" | "critical"; - -export function Finding({ - code, - title, - severity = "medium", - children, -}: { - code?: string; - title: string; - severity?: Severity; - children?: ComponentChildren; -}) { - return ( -
-
- {code ? {code} : null} -

{title}

- {severity} -
- {children ?
{children}
: null} -
- ); -} - -// Static snapshot of an approval prompt. `approved` is true/false/undefined -// (undefined = "still pending"). The visual indicates which choice was made. -export function Approval({ - action, - approved, - by, - at, - children, -}: { - action: string; - approved?: boolean; - by?: string; - at?: string; - children?: ComponentChildren; -}) { - const state = approved === undefined ? "pending" : approved ? "approved" : "denied"; - return ( -
-
- {action} - {state} -
- {(by || at) ? ( -
- {by ? {by} : null} - {at ? {at} : null} -
- ) : null} - {children ?
{children}
: null} -
- ); -} diff --git a/src/components/blocks.tsx b/src/components/blocks.tsx deleted file mode 100644 index cb02461..0000000 --- a/src/components/blocks.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import type { ComponentChildren } from "preact"; - -export type CalloutType = "info" | "warning" | "danger" | "success" | "note"; - -export function Callout({ - type = "info", - title, - children, -}: { - type?: CalloutType; - title?: string; - children: ComponentChildren; -}) { - return ( -
- -
- {title ?
{title}
: null} -
{children}
-
-
- ); -} - -function iconFor(t: CalloutType): string { - switch (t) { - case "warning": - return "▲"; - case "danger": - return "✕"; - case "success": - return "✓"; - case "note": - return "✎"; - default: - return "ⓘ"; - } -} - -export function Quote({ - author, - children, -}: { - author?: string; - children: ComponentChildren; -}) { - return ( -
-
{children}
- {author ?
— {author}
: null} -
- ); -} - -// No syntax highlighting in v0.1 — the output is a plain
 with
-// a language class. Consumers who want highlighting can run prism.js
-// client-side; whether that's allowed depends on the host's CSP.
-export function Code({
-  language,
-  children,
-}: {
-  language?: string;
-  children: ComponentChildren;
-}) {
-  const lang = (language ?? "").toLowerCase();
-  return (
-    
-      {children}
-    
- ); -} - -// Authors pass raw SVG (or any block content) as children. The component -// just provides the figure / caption frame so it looks intentional. -export function Diagram({ - caption, - children, -}: { - caption?: string; - children: ComponentChildren; -}) { - return ( -
-
{children}
- {caption ?
{caption}
: null} -
- ); -} diff --git a/src/components/data.tsx b/src/components/data.tsx deleted file mode 100644 index fe11016..0000000 --- a/src/components/data.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import type { ComponentChildren } from "preact"; - -export type StatusState = "ok" | "warn" | "err" | "info"; - -export function KPIGroup({ children }: { children: ComponentChildren }) { - return
{children}
; -} - -export function KPI({ - value, - label, - trend, - tone, -}: { - value: string | number; - label: string; - trend?: string; - tone?: StatusState; -}) { - const toneCls = tone ? ` bc-kpi-${tone}` : ""; - return ( -
-
{value}
-
{label}
- {trend ?
{trend}
: null} -
- ); -} - -export function Tag({ - color, - children, -}: { - color?: string; - children: ComponentChildren; -}) { - const cls = color ? `bc-tag bc-tag-${color}` : "bc-tag"; - return {children}; -} - -export function Status({ - state, - children, -}: { - state: StatusState; - children?: ComponentChildren; -}) { - return ( - - - ); -} - -export function Diff({ - before, - after, - beforeLabel = "Before", - afterLabel = "After", -}: { - before: ComponentChildren; - after: ComponentChildren; - beforeLabel?: string; - afterLabel?: string; -}) { - return ( -
-
-
{beforeLabel}
-
{before}
-
-
-
{afterLabel}
-
{after}
-
-
- ); -} diff --git a/src/components/index.ts b/src/components/index.ts deleted file mode 100644 index 5d7f833..0000000 --- a/src/components/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Every component MDX is allowed to use is re-exported from this file. -// The compile path passes this module as the `components` prop to -// MDXContent so authors can write , , etc. without any -// import statements in their .mdx files. - -export { Section, TLDR, Compare, Option, Steps, Step } from "./layout.js"; -export { Callout, Quote, Code, Diagram } from "./blocks.js"; -export { KPI, KPIGroup, Tag, Status, Diff } from "./data.js"; -export { ToolCall, ToolTree, Finding, Approval } from "./agent.js"; -export { Timeline, Event } from "./timeline.js"; diff --git a/src/components/index.tsx b/src/components/index.tsx new file mode 100644 index 0000000..483a19d --- /dev/null +++ b/src/components/index.tsx @@ -0,0 +1,166 @@ +// MDX-facing component registry. Names here are the JSX tags authors +// write in `.mdx` files. The compile path passes this module as +// `components` to MDXContent so authors don't need import statements. +// +// Structure mirrors the shadcn registry layout (`ui/`): components are +// imported from `./ui/`. Two of them (tool-call, tool-tree) are +// vendored verbatim from agentic-craft's registry. The rest are local +// implementations that mimic agentic-craft's editorial visual language +// — they are intended to be replaced by registry components when (if) +// the upstream project publishes them. + +import * as React from "react"; +import { + CommandLineIcon, + CodeIcon, + PencilEdit01Icon, + File01Icon, + Search01Icon, + GlobeIcon, + Settings01Icon, + GitBranchIcon, + Database01Icon, +} from "@hugeicons/core-free-icons"; +import type { IconSvgElement } from "@hugeicons/react"; + +// Vendored from agentic-craft registry — +// https://github.com/arielconti10/agentic-craft/tree/main/registry/base-nova/ui +export { + ToolCall as ToolCallPrimitive, + ToolCallLabel, + ToolCallContent, +} from "./ui/tool-call.js"; +export { + ToolTree as ToolTreePrimitive, + ToolTreeTrigger, + ToolTreeContent, +} from "./ui/tool-tree.js"; + +import { + ToolCall as ToolCallPrimitive, + ToolCallLabel, + ToolCallContent, +} from "./ui/tool-call.js"; +import { + ToolTree as ToolTreePrimitive, + ToolTreeTrigger, + ToolTreeContent, +} from "./ui/tool-tree.js"; + +export { TLDR } from "./ui/tldr.js"; +export { Callout } from "./ui/callout.js"; +export { KPI, KPIGroup } from "./ui/kpi.js"; +export { Steps, Step } from "./ui/steps.js"; +export { Compare, Option } from "./ui/compare.js"; +export { Finding } from "./ui/finding.js"; +export { Approval } from "./ui/approval.js"; +export { Timeline, Event } from "./ui/timeline.js"; +export { Tag, Status } from "./ui/tag.js"; +export { Diff } from "./ui/diff.js"; +export { Section } from "./ui/section.js"; +export { Quote } from "./ui/quote.js"; +export { Code } from "./ui/code.js"; +export { Diagram } from "./ui/diagram.js"; + +// ── ToolCall MDX wrapper ───────────────────────────────────────────── +// Our MDX API is flat: ``. The vendored primitive expects a hugeicons `icon`, +// ``, and ``. This wrapper translates. +// status: "ok"|"fail"|"running"|"skip" maps to "completed"|"failed"| +// "running"|"completed" (skip = quiet completed). + +const iconByName: Record = { + bash: CommandLineIcon, + shell: CommandLineIcon, + sh: CommandLineIcon, + zsh: CommandLineIcon, + edit: PencilEdit01Icon, + write: PencilEdit01Icon, + read: File01Icon, + file: File01Icon, + grep: Search01Icon, + search: Search01Icon, + webfetch: GlobeIcon, + webview: GlobeIcon, + git: GitBranchIcon, + db: Database01Icon, + database: Database01Icon, + code: CodeIcon, +}; + +type ToolStatus = "running" | "ok" | "fail" | "skip"; + +export function ToolCall({ + name, + status, + timing, + args, + children, +}: { + name: string; + status?: ToolStatus; + timing?: string; + args?: string; + children?: React.ReactNode; +}) { + const icon: IconSvgElement = + iconByName[name.toLowerCase()] ?? Settings01Icon; + const upstream: "running" | "completed" | "failed" = + status === "running" + ? "running" + : status === "fail" + ? "failed" + : "completed"; + const hasBody = !!(args || children); + return ( + + + {name} + {args ? ( + {args} + ) : null} + + {hasBody ? ( + + {args ? ( +
+              {args}
+            
+ ) : null} + {children ? ( +
+ {children} +
+ ) : null} +
+ ) : null} +
+ ); +} + +// ── ToolTree MDX wrapper ───────────────────────────────────────────── +// MDX usage: `…ToolCalls…`. +// The vendored primitive wants explicit Trigger + Content children; the +// wrapper supplies them. + +export function ToolTree({ + label = "Running tools", + defaultOpen = true, + children, +}: { + label?: string; + defaultOpen?: boolean; + children?: React.ReactNode; +}) { + return ( + + {label} + {children} + + ); +} diff --git a/src/components/layout.tsx b/src/components/layout.tsx deleted file mode 100644 index 2369cf8..0000000 --- a/src/components/layout.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import type { ComponentChildren } from "preact"; - -export function Section({ - title, - id, - children, -}: { - title?: string; - id?: string; - children: ComponentChildren; -}) { - return ( -
- {title ?

{title}

: null} -
{children}
-
- ); -} - -export function TLDR({ children }: { children: ComponentChildren }) { - return ( - - ); -} - -export function Compare({ children }: { children: ComponentChildren }) { - return
{children}
; -} - -export function Option({ - label, - children, -}: { - label: string; - children: ComponentChildren; -}) { - return ( -
-
{label}
-
{children}
-
- ); -} - -export function Steps({ children }: { children: ComponentChildren }) { - return
    {children}
; -} - -export type StepStatus = "todo" | "doing" | "done" | "blocked"; - -export function Step({ - title, - status, - children, -}: { - title: string; - status?: StepStatus; - children?: ComponentChildren; -}) { - const cls = `bc-step${status ? ` bc-step-${status}` : ""}`; - return ( -
  • -
    - {title} - {status ? {status} : null} -
    - {children ?
    {children}
    : null} -
  • - ); -} diff --git a/src/components/styles.ts b/src/components/styles.ts index 93d326f..9da6086 100644 --- a/src/components/styles.ts +++ b/src/components/styles.ts @@ -1,420 +1,3 @@ -// The stylesheet is co-authored in styles.css and synced here as a string -// literal so the IIFE bundle can ship CSS without filesystem access. -// If you edit styles.css, run `pnpm sync-styles` to regenerate this file. - -export const stylesheet = `/* @bitcomplete/mdx-components v0.1 */ - -:root{ - --bc-bg: #ffffff; - --bc-fg: #1c1c1f; - --bc-muted: #6b6b73; - --bc-line: #e8e8ec; - --bc-line-soft: #f1f1f4; - --bc-accent: #5b6cff; - --bc-info: #4f7ed8; - --bc-info-bg: #eef3fc; - --bc-warn: #c47900; - --bc-warn-bg: #fdf3e0; - --bc-danger: #cd2b3a; - --bc-danger-bg: #fce8eb; - --bc-success: #2a8b56; - --bc-success-bg: #e5f5ec; - --bc-note: #6f6f78; - --bc-note-bg: #f3f3f5; - --bc-radius: 8px; - --bc-radius-sm: 5px; - --bc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; - --bc-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; -} - -@media (prefers-color-scheme: dark){ - :root{ - --bc-bg: #15161a; - --bc-fg: #ebebef; - --bc-muted: #9f9faa; - --bc-line: #2a2c33; - --bc-line-soft: #1e2026; - --bc-info-bg: #15263f; - --bc-warn-bg: #3a2d10; - --bc-danger-bg: #3a1419; - --bc-success-bg: #133123; - --bc-note-bg: #232428; - } -} - -.bc-doc{ - font-family: var(--bc-font); - color: var(--bc-fg); - background: var(--bc-bg); - font-size: 15px; - line-height: 1.6; - max-width: 56rem; - margin: 0 auto; - padding: 3rem 1.5rem 6rem; - /* Long URLs / hashes shouldn't blow out the column. */ - overflow-wrap: anywhere; -} -.bc-doc *, -.bc-doc *::before, -.bc-doc *::after{box-sizing:border-box} - -.bc-doc h1{font-size:1.9rem;margin:1.2em 0 .4em;line-height:1.2} -.bc-doc h2{font-size:1.45rem;margin:1.5em 0 .4em;line-height:1.25} -.bc-doc h3{font-size:1.15rem;margin:1.2em 0 .3em} -.bc-doc p{margin:.7em 0} -.bc-doc a{color:var(--bc-accent);text-decoration:none} -.bc-doc a:hover{text-decoration:underline} -.bc-doc code{font-family:var(--bc-mono);font-size:.92em;background:var(--bc-line-soft);padding:.1em .3em;border-radius:3px;overflow-wrap:anywhere} -.bc-doc hr{border:0;border-top:1px solid var(--bc-line);margin:2em 0} - -/* Default blockquote — user messages in transcripts land here. */ -.bc-doc blockquote{ - margin:.8em 0; - padding:.6em 1em; - border-left:3px solid var(--bc-line); - background:var(--bc-line-soft); - color:var(--bc-fg); - border-radius:0 var(--bc-radius-sm) var(--bc-radius-sm) 0; -} -.bc-doc blockquote > :first-child{margin-top:0} -.bc-doc blockquote > :last-child{margin-bottom:0} - -/* Markdown tables — narrow viewports get a horizontal scrollbar instead - * of cells collapsing. */ -.bc-doc table{ - display:block; - max-width:100%; - overflow-x:auto; - border-collapse:collapse; - margin:1em 0; -} -.bc-doc th, -.bc-doc td{ - padding:.4em .7em; - border:1px solid var(--bc-line); - text-align:left; -} -.bc-doc th{background:var(--bc-line-soft);font-weight:600} - -/* Any
     in the document — including the bare ones authors drop in —
    - * wraps long lines instead of forcing horizontal scroll. The override on
    - * .bc-code below keeps the look consistent. */
    -.bc-doc pre{
    -  background:var(--bc-line-soft);
    -  border-radius:var(--bc-radius);
    -  padding:.75rem 1rem;
    -  margin:1em 0;
    -  font-family:var(--bc-mono);
    -  font-size:.85rem;
    -  line-height:1.5;
    -  white-space:pre-wrap;
    -  word-break:break-word;
    -  overflow-wrap:anywhere;
    -  max-width:100%;
    -}
    -.bc-doc pre code{background:none;padding:0;font-size:inherit}
    -
    -/* Section */
    -.bc-section{margin:2em 0}
    -.bc-section-title{font-size:1.45rem;font-weight:600}
    -
    -/* TLDR */
    -.bc-tldr{
    -  display:grid;
    -  grid-template-columns: auto 1fr;
    -  gap: .9rem 1.1rem;
    -  background: var(--bc-line-soft);
    -  border-left: 3px solid var(--bc-accent);
    -  padding: 1rem 1.2rem;
    -  border-radius: var(--bc-radius);
    -  margin: 1.5em 0;
    -}
    -.bc-tldr-label{
    -  font-weight:700;
    -  font-size:.75rem;
    -  letter-spacing:.08em;
    -  text-transform:uppercase;
    -  color:var(--bc-muted);
    -  align-self:start;
    -  padding-top:.2em;
    -}
    -.bc-tldr-body > :first-child{margin-top:0}
    -.bc-tldr-body > :last-child{margin-bottom:0}
    -
    -/* Callout */
    -.bc-callout{
    -  display:grid;
    -  grid-template-columns: auto 1fr;
    -  gap: .25rem .75rem;
    -  border-radius: var(--bc-radius);
    -  padding: .9rem 1rem;
    -  margin: 1.2em 0;
    -  font-size: .95em;
    -}
    -.bc-callout-icon{font-size:1.05rem;line-height:1.4;padding-top:.05em}
    -.bc-callout-title{font-weight:600;margin-bottom:.25em}
    -.bc-callout-body > :first-child{margin-top:0}
    -.bc-callout-body > :last-child{margin-bottom:0}
    -.bc-callout-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-callout-info .bc-callout-icon{color:var(--bc-info)}
    -.bc-callout-info .bc-callout-body, .bc-callout-info .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-warning{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-callout-warning .bc-callout-body, .bc-callout-warning .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-danger{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-callout-danger .bc-callout-body, .bc-callout-danger .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-success{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-callout-success .bc-callout-body, .bc-callout-success .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-note{background:var(--bc-note-bg);color:var(--bc-note)}
    -.bc-callout-note .bc-callout-body, .bc-callout-note .bc-callout-title{color:var(--bc-fg)}
    -
    -/* KPI */
    -.bc-kpi-group{
    -  display:grid;
    -  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    -  gap: 1rem;
    -  margin: 1.5em 0;
    -}
    -.bc-kpi{
    -  background: var(--bc-line-soft);
    -  padding: 1rem;
    -  border-radius: var(--bc-radius);
    -  border: 1px solid var(--bc-line);
    -  /* In a grid track, content can otherwise refuse to shrink below its
    -   * intrinsic width, which is what was bursting the cards on long
    -   * text values. */
    -  min-width: 0;
    -}
    -.bc-kpi-value{
    -  font-family: var(--bc-mono);
    -  font-size: 1.9rem;
    -  font-weight: 600;
    -  line-height: 1.1;
    -  /* Wrap rather than overflow when the value isn't a short number. */
    -  overflow-wrap: anywhere;
    -  word-break: break-word;
    -}
    -.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em;overflow-wrap:anywhere}
    -.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted);overflow-wrap:anywhere}
    -.bc-kpi-ok .bc-kpi-value{color:var(--bc-success)}
    -.bc-kpi-warn .bc-kpi-value{color:var(--bc-warn)}
    -.bc-kpi-err .bc-kpi-value{color:var(--bc-danger)}
    -.bc-kpi-info .bc-kpi-value{color:var(--bc-info)}
    -
    -/* Steps */
    -.bc-steps{list-style:none;padding:0;margin:1.5em 0;display:flex;flex-direction:column;gap:.6rem}
    -.bc-step{
    -  border:1px solid var(--bc-line);
    -  border-radius: var(--bc-radius);
    -  padding: .8rem 1rem;
    -  background: var(--bc-bg);
    -}
    -.bc-step-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}
    -.bc-step-title{font-weight:600}
    -.bc-step-status{
    -  font-size:.7rem;
    -  text-transform:uppercase;
    -  letter-spacing:.06em;
    -  padding:.15em .55em;
    -  border-radius: 999px;
    -  background: var(--bc-line-soft);
    -  color: var(--bc-muted);
    -}
    -.bc-step-status-doing{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-step-status-done{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-step-status-blocked{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-step-body{margin-top:.4em;color:var(--bc-fg)}
    -.bc-step-body > :first-child{margin-top:0}
    -.bc-step-body > :last-child{margin-bottom:0}
    -
    -/* Compare */
    -.bc-compare{
    -  display:grid;
    -  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    -  gap: 1rem;
    -  margin: 1.5em 0;
    -}
    -.bc-compare-option{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:1rem;
    -}
    -.bc-compare-label{font-weight:600;margin-bottom:.5em}
    -
    -/* Quote */
    -.bc-quote{margin:1.5em 0;padding:0 0 0 1rem;border-left:3px solid var(--bc-line)}
    -.bc-quote-body{margin:0;font-style:italic;color:var(--bc-fg)}
    -.bc-quote-author{margin-top:.5em;color:var(--bc-muted);font-size:.9em}
    -
    -/* Code */
    -.bc-code{
    -  background: var(--bc-line-soft);
    -  border-radius: var(--bc-radius);
    -  padding: .85rem 1rem;
    -  font-family: var(--bc-mono);
    -  font-size: .85rem;
    -  line-height: 1.5;
    -  margin: 1em 0;
    -  white-space: pre-wrap;
    -  word-break: break-word;
    -  overflow-wrap: anywhere;
    -  max-width: 100%;
    -}
    -.bc-code code{background:none;padding:0;font-size:inherit}
    -
    -/* Diagram */
    -.bc-diagram{margin:1.5em 0}
    -.bc-diagram-body{display:flex;justify-content:center}
    -.bc-diagram-body svg{max-width:100%;height:auto}
    -.bc-diagram-caption{margin-top:.5em;color:var(--bc-muted);font-size:.9em;text-align:center}
    -
    -/* Tag + Status */
    -.bc-tag{
    -  display:inline-block;
    -  font-size:.75rem;
    -  padding:.18em .55em;
    -  border-radius:999px;
    -  background:var(--bc-line-soft);
    -  color:var(--bc-muted);
    -  font-weight:500;
    -}
    -.bc-tag-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-tag-warning{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-tag-danger{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-tag-success{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-status{display:inline-flex;align-items:center;gap:.4em;font-size:.85rem}
    -.bc-status-dot{width:.55em;height:.55em;border-radius:50%;background:var(--bc-muted)}
    -.bc-status-ok .bc-status-dot{background:var(--bc-success)}
    -.bc-status-warn .bc-status-dot{background:var(--bc-warn)}
    -.bc-status-err .bc-status-dot{background:var(--bc-danger)}
    -.bc-status-info .bc-status-dot{background:var(--bc-info)}
    -
    -/* Diff */
    -.bc-diff{display:grid;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));gap:1rem;margin:1.5em 0}
    -.bc-diff-side{border:1px solid var(--bc-line);border-radius:var(--bc-radius);padding:1rem}
    -.bc-diff-before{background:var(--bc-danger-bg)}
    -.bc-diff-after{background:var(--bc-success-bg)}
    -.bc-diff-label{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--bc-muted);margin-bottom:.5em;font-weight:600}
    -
    -/* ToolCall + ToolTree */
    -.bc-tool{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:.8rem 1rem;
    -  margin:.6em 0;
    -  font-size:.92rem;
    -  max-width:100%;
    -  min-width:0;
    -  overflow:hidden;
    -}
    -.bc-tool-head{
    -  display:flex;
    -  align-items:center;
    -  gap:.8em;
    -  justify-content:space-between;
    -  flex-wrap:wrap;
    -}
    -.bc-tool-name{font-family:var(--bc-mono);font-weight:600;color:var(--bc-accent);overflow-wrap:anywhere;min-width:0}
    -.bc-tool-timing{color:var(--bc-muted);font-size:.85em}
    -.bc-tool-status{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.15em .55em;border-radius:999px;background:var(--bc-line-soft);color:var(--bc-muted);flex-shrink:0}
    -.bc-tool-status-running{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-tool-status-ok{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-tool-status-fail{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-tool-args{
    -  margin:.5em 0 0;
    -  font-size:.8rem;
    -  background:var(--bc-line-soft);
    -  padding:.5em .75em;
    -  border-radius:var(--bc-radius-sm);
    -  font-family:var(--bc-mono);
    -  line-height:1.45;
    -  white-space:pre-wrap;
    -  word-break:break-word;
    -  overflow-wrap:anywhere;
    -  max-width:100%;
    -}
    -.bc-tool-body{margin-top:.5em;min-width:0}
    -.bc-tool-body pre{margin:.4em 0;font-size:.8rem;line-height:1.45;background:var(--bc-line-soft)}
    -.bc-tool-tree{padding-left:1.25rem;border-left:1px dashed var(--bc-line);margin:.6em 0;min-width:0}
    -.bc-tool-tree > .bc-tool{position:relative}
    -.bc-tool-tree > .bc-tool::before{
    -  content:"";
    -  position:absolute;
    -  left:-1.25rem;
    -  top:1rem;
    -  width:1rem;
    -  border-top:1px dashed var(--bc-line);
    -}
    -
    -/* Finding */
    -.bc-finding{
    -  border:1px solid var(--bc-line);
    -  border-left-width: 4px;
    -  border-radius:var(--bc-radius);
    -  padding:.9rem 1rem;
    -  margin:.8em 0;
    -}
    -.bc-finding-info{border-left-color:var(--bc-info)}
    -.bc-finding-low{border-left-color:var(--bc-muted)}
    -.bc-finding-medium{border-left-color:var(--bc-warn)}
    -.bc-finding-high{border-left-color:var(--bc-danger)}
    -.bc-finding-critical{border-left-color:var(--bc-danger);background:var(--bc-danger-bg)}
    -.bc-finding-head{display:flex;align-items:baseline;gap:.7em;flex-wrap:wrap}
    -.bc-finding-code{font-family:var(--bc-mono);color:var(--bc-muted);font-size:.85em;background:none;padding:0}
    -.bc-finding-title{margin:0;font-size:1rem;flex:1}
    -.bc-finding-sev{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.15em .55em;border-radius:999px;background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-finding-sev-high,.bc-finding-sev-critical{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-finding-sev-medium{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-finding-sev-low{background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-finding-sev-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-finding-body{margin-top:.5em;color:var(--bc-fg);font-size:.95em}
    -
    -/* Approval */
    -.bc-approval{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:.9rem 1rem;
    -  margin:.8em 0;
    -  display:flex;
    -  flex-direction:column;
    -  gap:.5em;
    -}
    -.bc-approval-head{display:flex;justify-content:space-between;align-items:center;gap:1em}
    -.bc-approval-action{font-family:var(--bc-mono);font-size:.92em}
    -.bc-approval-badge{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.18em .65em;border-radius:999px}
    -.bc-approval-badge-approved{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-approval-badge-denied{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-approval-badge-pending{background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-approval-meta{color:var(--bc-muted);font-size:.85em;display:flex;gap:1em}
    -
    -/* Timeline */
    -.bc-timeline{list-style:none;padding:0;margin:1.5em 0;position:relative}
    -.bc-timeline::before{
    -  content:"";
    -  position:absolute;
    -  left:.45rem;
    -  top:.4rem;
    -  bottom:.4rem;
    -  width:1px;
    -  background:var(--bc-line);
    -}
    -.bc-event{position:relative;padding:0 0 1em 2rem}
    -.bc-event-marker{
    -  position:absolute;
    -  left:0;
    -  top:.45rem;
    -  width:1rem;
    -  height:1rem;
    -  border-radius:50%;
    -  background:var(--bc-bg);
    -  border:2px solid var(--bc-muted);
    -}
    -.bc-event-ok .bc-event-marker{border-color:var(--bc-success)}
    -.bc-event-warn .bc-event-marker{border-color:var(--bc-warn)}
    -.bc-event-err .bc-event-marker{border-color:var(--bc-danger)}
    -.bc-event-info .bc-event-marker{border-color:var(--bc-info)}
    -.bc-event-time{font-family:var(--bc-mono);font-size:.8em;color:var(--bc-muted)}
    -.bc-event-title{font-weight:600;margin-top:.1em}
    -.bc-event-body{margin-top:.3em;color:var(--bc-fg);font-size:.95em}
    -.bc-event-body > :first-child{margin-top:0}
    -.bc-event-body > :last-child{margin-bottom:0}
    -`;
    +// AUTO-GENERATED by scripts/embed-css.mjs. Edit src/styles/tailwind.css instead.
    +export const stylesheet = `/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
    +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-outline-style:solid;--tw-duration:initial;--tw-content:"";--tw-divide-x-reverse:0}}}@layer theme{:root,:host{--font-sans:"Albert Sans", ui-sans-serif, system-ui, sans-serif;--font-serif:"Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;--font-mono:ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-500:oklch(69.6% .17 162.48);--color-sky-500:oklch(68.5% .169 237.323);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.bc-doc{background:var(--color-background);color:var(--color-foreground);font-family:var(--font-sans);font-synthesis:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:anywhere;max-width:720px;margin:0 auto;padding:3rem 1.5rem 6rem}.bc-doc *,.bc-doc :before,.bc-doc :after{box-sizing:border-box}.bc-doc>h1:first-child,.bc-doc h1{font-family:var(--font-serif);letter-spacing:-.02em;text-wrap:balance;margin:0 0 1rem;font-size:2.5rem;font-weight:300;line-height:1.1}.bc-doc h2{font-family:var(--font-serif);letter-spacing:-.015em;text-wrap:balance;margin:2.5rem 0 1rem;font-size:1.75rem;font-weight:300;line-height:1.2}.bc-doc h3{font-family:var(--font-serif);text-wrap:balance;margin:2rem 0 .75rem;font-size:1.25rem;font-weight:400;line-height:1.3}.bc-doc h4{font-family:var(--font-sans);margin:1.5rem 0 .5rem;font-size:1rem;font-weight:600}.bc-doc p{font-family:var(--font-serif);color:var(--color-foreground);text-wrap:pretty;margin:.75rem 0;font-size:1rem;line-height:1.7}.bc-doc a{color:var(--color-foreground);text-decoration:underline;-webkit-text-decoration-color:var(--color-foreground);-webkit-text-decoration-color:var(--color-foreground);text-decoration-color:var(--color-foreground)}@supports (color:color-mix(in lab, red, red)){.bc-doc a{-webkit-text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent);-webkit-text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent);text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent)}}.bc-doc a{text-underline-offset:.2em;transition:text-decoration-color .15s}.bc-doc a:hover{-webkit-text-decoration-color:var(--color-foreground);-webkit-text-decoration-color:var(--color-foreground);text-decoration-color:var(--color-foreground)}.bc-doc strong{font-weight:600}.bc-doc em{font-style:italic}.bc-doc hr{border:0;border-top:1px solid var(--color-border);margin:3rem 0}.bc-doc>ul,.bc-doc>ol,.bc-doc :where(p,li)+ul,.bc-doc :where(p,li)+ol{font-family:var(--font-serif);margin:.75rem 0;padding-left:1.5rem;font-size:1rem;line-height:1.7}.bc-doc :is(ul,ol) li{margin:.25rem 0}.bc-doc>ul,.bc-doc :where(p,li)+ul{list-style:outside}.bc-doc>ol,.bc-doc :where(p,li)+ol{list-style:decimal}.bc-doc :not(pre)>code{font-family:var(--font-mono);background:var(--color-muted);font-size:.875em}@supports (color:color-mix(in lab, red, red)){.bc-doc :not(pre)>code{background:color-mix(in oklch, var(--color-muted) 80%, transparent)}}.bc-doc :not(pre)>code{overflow-wrap:anywhere;border-radius:3px;padding:.1em .35em}.bc-doc pre:not([data-slot]){font-family:var(--font-mono);background:var(--color-muted);font-size:.85rem;line-height:1.5}@supports (color:color-mix(in lab, red, red)){.bc-doc pre:not([data-slot]){background:color-mix(in oklch, var(--color-muted) 70%, transparent)}}.bc-doc pre:not([data-slot]){border:1px solid var(--color-border);white-space:pre-wrap;word-break:break-word;border-radius:.5rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.bc-doc pre:not([data-slot]) code{background:0 0;padding:0}.bc-doc blockquote{border-left:2px solid var(--color-border);font-family:var(--font-serif);color:var(--color-foreground);margin:1.5rem 0;padding:0 0 0 1.25rem;font-style:italic}@supports (color:color-mix(in lab, red, red)){.bc-doc blockquote{color:color-mix(in oklch, var(--color-foreground) 85%, transparent)}}.bc-doc table{font-family:var(--font-sans);border-collapse:collapse;width:100%;margin:1rem 0;font-size:.9rem}.bc-doc th,.bc-doc td{border:1px solid var(--color-border);text-align:left;padding:.4rem .7rem}.bc-doc th{background:var(--color-muted);font-weight:600}@supports (color:color-mix(in lab, red, red)){.bc-doc th{background:color-mix(in oklch, var(--color-muted) 50%, transparent)}}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-1{inset:calc(var(--spacing) * 1)}.inset-1\\/2{inset:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\\[6px\\]{top:6px}.-left-\\[26px\\]{left:-26px}.left-0{left:calc(var(--spacing) * 0)}.m-0{margin:calc(var(--spacing) * 0)}.my-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-8{margin-block:calc(var(--spacing) * 8)}.my-10{margin-block:calc(var(--spacing) * 10)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1{width:calc(var(--spacing) * 1);height:calc(var(--spacing) * 1)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.w-fit{width:fit-content}.w-px{width:1px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-bl-lg{border-bottom-left-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-amber-500{border-color:var(--color-amber-500)}.border-emerald-500{border-color:var(--color-emerald-500)}.border-red-500{border-color:var(--color-red-500)}.border-sky-500{border-color:var(--color-sky-500)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-amber-500\\/70{border-left-color:#f99c00b3}@supports (color:color-mix(in lab, red, red)){.border-l-amber-500\\/70{border-left-color:color-mix(in oklab, var(--color-amber-500) 70%, transparent)}}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-emerald-500\\/50{border-left-color:#00bb7f80}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/50{border-left-color:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.border-l-emerald-500\\/70{border-left-color:#00bb7fb3}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/70{border-left-color:color-mix(in oklab, var(--color-emerald-500) 70%, transparent)}}.border-l-red-500{border-left-color:var(--color-red-500)}.border-l-red-500\\/40{border-left-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/40{border-left-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-l-red-500\\/70{border-left-color:#fb2c36b3}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/70{border-left-color:color-mix(in oklab, var(--color-red-500) 70%, transparent)}}.border-l-red-600{border-left-color:var(--color-red-600)}.border-l-red-600\\/80{border-left-color:#e40014cc}@supports (color:color-mix(in lab, red, red)){.border-l-red-600\\/80{border-left-color:color-mix(in oklab, var(--color-red-600) 80%, transparent)}}.border-l-sky-500{border-left-color:var(--color-sky-500)}.border-l-sky-500\\/60{border-left-color:#00a5ef99}@supports (color:color-mix(in lab, red, red)){.border-l-sky-500\\/60{border-left-color:color-mix(in oklab, var(--color-sky-500) 60%, transparent)}}.border-l-sky-500\\/70{border-left-color:#00a5efb3}@supports (color:color-mix(in lab, red, red)){.border-l-sky-500\\/70{border-left-color:color-mix(in oklab, var(--color-sky-500) 70%, transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-red-600\\/15{background-color:#e4001426}@supports (color:color-mix(in lab, red, red)){.bg-red-600\\/15{background-color:color-mix(in oklab, var(--color-red-600) 15%, transparent)}}.bg-sky-500{background-color:var(--color-sky-500)}.bg-sky-500\\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/10{background-color:color-mix(in oklab, var(--color-sky-500) 10%, transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-\\[28px\\]{padding-left:28px}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-emerald-500{color:var(--color-emerald-500)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-sky-500{color:var(--color-sky-500)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\/tool-wrapper\\:opacity-100:is(:where(.group\\/tool-wrapper):hover *){opacity:1}}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-2:before{content:var(--tw-content);top:calc(var(--spacing) * 2)}.before\\:bottom-2:before{content:var(--tw-content);bottom:calc(var(--spacing) * 2)}.before\\:left-\\[6px\\]:before{content:var(--tw-content);left:6px}.before\\:w-px:before{content:var(--tw-content);width:1px}@media (min-width:40rem){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-\\[repeat\\(auto-fit\\,minmax\\(140px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}:where(.sm\\:divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.sm\\:pl-6{padding-left:calc(var(--spacing) * 6)}.sm\\:first\\:pl-0:first-child{padding-left:calc(var(--spacing) * 0)}}@media (min-width:48rem){.md\\:block{display:block}}}.bc-doc{--color-background:oklch(100% 0 0);--color-foreground:oklch(14.5% 0 0);--color-card:oklch(100% 0 0);--color-card-foreground:oklch(14.5% 0 0);--color-popover:oklch(100% 0 0);--color-popover-foreground:oklch(14.5% 0 0);--color-primary:oklch(20.5% 0 0);--color-primary-foreground:oklch(98.5% 0 0);--color-secondary:oklch(97% 0 0);--color-secondary-foreground:oklch(20.5% 0 0);--color-muted:oklch(97% 0 0);--color-muted-foreground:oklch(55.6% 0 0);--color-accent:oklch(97% 0 0);--color-accent-foreground:oklch(20.5% 0 0);--color-destructive:oklch(57.7% .245 27.325);--color-border:oklch(92.2% 0 0);--color-input:oklch(92.2% 0 0);--color-ring:oklch(70.8% 0 0);--radius:.625rem}@media (prefers-color-scheme:dark){.bc-doc{--color-background:oklch(14.5% 0 0);--color-foreground:oklch(98.5% 0 0);--color-card:oklch(20.5% 0 0);--color-card-foreground:oklch(98.5% 0 0);--color-popover:oklch(20.5% 0 0);--color-popover-foreground:oklch(98.5% 0 0);--color-primary:oklch(92.2% 0 0);--color-primary-foreground:oklch(20.5% 0 0);--color-secondary:oklch(26.9% 0 0);--color-secondary-foreground:oklch(98.5% 0 0);--color-muted:oklch(26.9% 0 0);--color-muted-foreground:oklch(70.8% 0 0);--color-accent:oklch(26.9% 0 0);--color-accent-foreground:oklch(98.5% 0 0);--color-destructive:oklch(70.4% .191 22.216);--color-border:oklch(100% 0 0/.1);--color-input:oklch(100% 0 0/.15);--color-ring:oklch(55.6% 0 0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}`;
    diff --git a/src/components/timeline.tsx b/src/components/timeline.tsx
    deleted file mode 100644
    index fed8d4d..0000000
    --- a/src/components/timeline.tsx
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -import type { ComponentChildren } from "preact";
    -
    -export function Timeline({ children }: { children: ComponentChildren }) {
    -  return 
      {children}
    ; -} - -export function Event({ - time, - tone, - title, - children, -}: { - time?: string; - tone?: "ok" | "warn" | "err" | "info"; - title?: string; - children?: ComponentChildren; -}) { - const toneCls = tone ? ` bc-event-${tone}` : ""; - return ( -
  • -
  • - ); -} diff --git a/src/components/ui/approval.tsx b/src/components/ui/approval.tsx new file mode 100644 index 0000000..e748c57 --- /dev/null +++ b/src/components/ui/approval.tsx @@ -0,0 +1,72 @@ +// Snapshot of an approval prompt — action + state pill, optional meta. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type ApprovalState = "approved" | "denied" | "pending"; + +const stateClass: Record = { + approved: "bg-emerald-500/10 text-emerald-500", + denied: "bg-red-500/10 text-red-500", + pending: "bg-muted text-muted-foreground", +}; + +function Approval({ + action, + approved, + by, + at, + className, + children, + ...props +}: React.ComponentProps<"div"> & { + action: string; + approved?: boolean; + by?: string; + at?: string; +}) { + const state: ApprovalState = + approved === undefined ? "pending" : approved ? "approved" : "denied"; + return ( +
    +
    + + {action} + + + {state} + +
    + {by || at ? ( +
    + {by ? {by} : null} + {at ? {at} : null} +
    + ) : null} + {children ? ( +
    + {children} +
    + ) : null} +
    + ); +} + +export { Approval }; diff --git a/src/components/ui/callout.tsx b/src/components/ui/callout.tsx new file mode 100644 index 0000000..ff25818 --- /dev/null +++ b/src/components/ui/callout.tsx @@ -0,0 +1,85 @@ +// Our component, styled to match agentic-craft's editorial look — a thin +// left rule with a small icon, no heavy panel background. + +import * as React from "react"; +import { HugeiconsIcon } from "@hugeicons/react"; +import { + InformationCircleIcon, + Alert02Icon, + CheckmarkCircle02Icon, + Cancel01Icon, + Note01Icon, +} from "@hugeicons/core-free-icons"; +import { cn } from "@/lib/utils"; + +type CalloutType = "info" | "warning" | "danger" | "success" | "note"; + +const iconMap = { + info: InformationCircleIcon, + warning: Alert02Icon, + danger: Cancel01Icon, + success: CheckmarkCircle02Icon, + note: Note01Icon, +} as const; + +const toneClass: Record = { + info: "border-l-sky-500/60", + warning: "border-l-amber-500/70", + danger: "border-l-red-500/70", + success: "border-l-emerald-500/70", + note: "border-l-border", +}; + +const iconClass: Record = { + info: "text-sky-500", + warning: "text-amber-500", + danger: "text-red-500", + success: "text-emerald-500", + note: "text-muted-foreground", +}; + +function Callout({ + type = "info", + title, + className, + children, + ...props +}: React.ComponentProps<"div"> & { + type?: CalloutType; + title?: string; +}) { + return ( +
    + +
    + {title ? ( +
    + {title} +
    + ) : null} +
    {children}
    +
    +
    + ); +} + +export { Callout }; +export type { CalloutType }; diff --git a/src/components/ui/code.tsx b/src/components/ui/code.tsx new file mode 100644 index 0000000..92e46c1 --- /dev/null +++ b/src/components/ui/code.tsx @@ -0,0 +1,27 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Code({ + language, + className, + children, + ...props +}: React.ComponentProps<"pre"> & { language?: string }) { + const lang = (language ?? "").toLowerCase(); + return ( +
    +      {children}
    +    
    + ); +} + +export { Code }; diff --git a/src/components/ui/compare.tsx b/src/components/ui/compare.tsx new file mode 100644 index 0000000..ecd5691 --- /dev/null +++ b/src/components/ui/compare.tsx @@ -0,0 +1,50 @@ +// Side-by-side options, no card boxes — just labels above each column +// with a thin vertical rule between. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Compare({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
    + {children} +
    + ); +} + +function Option({ + label, + className, + children, + ...props +}: React.ComponentProps<"div"> & { label: string }) { + return ( +
    +
    + {label} +
    +
    + {children} +
    +
    + ); +} + +export { Compare, Option }; diff --git a/src/components/ui/diagram.tsx b/src/components/ui/diagram.tsx new file mode 100644 index 0000000..bc8b99f --- /dev/null +++ b/src/components/ui/diagram.tsx @@ -0,0 +1,22 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Diagram({ + caption, + className, + children, + ...props +}: React.ComponentProps<"figure"> & { caption?: string }) { + return ( +
    +
    {children}
    + {caption ? ( +
    + {caption} +
    + ) : null} +
    + ); +} + +export { Diagram }; diff --git a/src/components/ui/diff.tsx b/src/components/ui/diff.tsx new file mode 100644 index 0000000..934a48c --- /dev/null +++ b/src/components/ui/diff.tsx @@ -0,0 +1,39 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Diff({ + before, + after, + beforeLabel = "Before", + afterLabel = "After", + className, + ...props +}: React.ComponentProps<"div"> & { + before: React.ReactNode; + after: React.ReactNode; + beforeLabel?: string; + afterLabel?: string; +}) { + return ( +
    +
    +
    + {beforeLabel} +
    +
    {before}
    +
    +
    +
    + {afterLabel} +
    +
    {after}
    +
    +
    + ); +} + +export { Diff }; diff --git a/src/components/ui/finding.tsx b/src/components/ui/finding.tsx new file mode 100644 index 0000000..efe01b7 --- /dev/null +++ b/src/components/ui/finding.tsx @@ -0,0 +1,82 @@ +// Editorial finding card: severity pill + mono code + serif title, with +// a thin coloured left rule. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type Severity = "info" | "low" | "medium" | "high" | "critical"; + +const sevBar: Record = { + info: "border-l-sky-500/70", + low: "border-l-border", + medium: "border-l-amber-500/70", + high: "border-l-red-500/70", + critical: "border-l-red-600/80", +}; + +const sevPill: Record = { + info: "bg-sky-500/10 text-sky-500", + low: "bg-muted text-muted-foreground", + medium: "bg-amber-500/10 text-amber-500", + high: "bg-red-500/10 text-red-500", + critical: "bg-red-600/15 text-red-600", +}; + +function Finding({ + code, + title, + severity = "medium", + className, + children, + ...props +}: React.ComponentProps<"article"> & { + code?: string; + title: string; + severity?: Severity; +}) { + return ( +
    +
    + {code ? ( + + {code} + + ) : null} +

    + {title} +

    + + {severity} + +
    + {children ? ( +
    + {children} +
    + ) : null} +
    + ); +} + +export { Finding }; +export type { Severity }; diff --git a/src/components/ui/kpi.tsx b/src/components/ui/kpi.tsx new file mode 100644 index 0000000..8301ce1 --- /dev/null +++ b/src/components/ui/kpi.tsx @@ -0,0 +1,80 @@ +// Big-number display, agentic-craft style: large light-serif numerals, +// uppercase sans-serif label below, no card. Group lays them out in a +// responsive row. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type KPITone = "default" | "ok" | "warn" | "err" | "info"; + +const toneClass: Record = { + default: "text-foreground", + ok: "text-emerald-500", + warn: "text-amber-500", + err: "text-red-500", + info: "text-sky-500", +}; + +function KPIGroup({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
    + {children} +
    + ); +} + +function KPI({ + value, + label, + trend, + tone = "default", + className, + ...props +}: React.ComponentProps<"div"> & { + value: string | number; + label: string; + trend?: string; + tone?: KPITone; +}) { + return ( +
    +
    + {value} +
    +
    + {label} +
    + {trend ? ( +
    + {trend} +
    + ) : null} +
    + ); +} + +export { KPI, KPIGroup }; +export type { KPITone }; diff --git a/src/components/ui/quote.tsx b/src/components/ui/quote.tsx new file mode 100644 index 0000000..9454b31 --- /dev/null +++ b/src/components/ui/quote.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Quote({ + author, + className, + children, + ...props +}: React.ComponentProps<"figure"> & { author?: string }) { + return ( +
    +
    + {children} +
    + {author ? ( +
    + — {author} +
    + ) : null} +
    + ); +} + +export { Quote }; diff --git a/src/components/ui/section.tsx b/src/components/ui/section.tsx new file mode 100644 index 0000000..4badea1 --- /dev/null +++ b/src/components/ui/section.tsx @@ -0,0 +1,28 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function Section({ + title, + id, + className, + children, + ...props +}: React.ComponentProps<"section"> & { title?: string }) { + return ( +
    + {title ? ( +

    + {title} +

    + ) : null} + {children} +
    + ); +} + +export { Section }; diff --git a/src/components/ui/steps.tsx b/src/components/ui/steps.tsx new file mode 100644 index 0000000..b38f2e9 --- /dev/null +++ b/src/components/ui/steps.tsx @@ -0,0 +1,94 @@ +// Editorial step list: serif title + status pill on the right, bullet +// rule on the left. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type StepStatus = "todo" | "doing" | "done" | "blocked"; + +const statusClass: Record = { + todo: "bg-muted text-muted-foreground", + doing: "bg-sky-500/10 text-sky-500", + done: "bg-emerald-500/10 text-emerald-500", + blocked: "bg-red-500/10 text-red-500", +}; + +function Steps({ + className, + children, + ...props +}: React.ComponentProps<"ol">) { + return ( +
      + {children} +
    + ); +} + +function Step({ + title, + status, + className, + children, + ...props +}: React.ComponentProps<"li"> & { + title: string; + status?: StepStatus; +}) { + return ( +
  • + +
    +
    + {title} +
    + {status ? ( + + {status} + + ) : null} +
    + {children ? ( +
    + {children} +
    + ) : null} +
  • + ); +} + +export { Steps, Step }; +export type { StepStatus }; diff --git a/src/components/ui/tag.tsx b/src/components/ui/tag.tsx new file mode 100644 index 0000000..f6c6edf --- /dev/null +++ b/src/components/ui/tag.tsx @@ -0,0 +1,64 @@ +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type TagColor = "default" | "info" | "warning" | "danger" | "success"; + +const colorClass: Record = { + default: "bg-muted text-muted-foreground", + info: "bg-sky-500/10 text-sky-500", + warning: "bg-amber-500/10 text-amber-500", + danger: "bg-red-500/10 text-red-500", + success: "bg-emerald-500/10 text-emerald-500", +}; + +function Tag({ + color = "default", + className, + children, + ...props +}: React.ComponentProps<"span"> & { color?: TagColor }) { + return ( + + {children} + + ); +} + +function Status({ + state, + className, + children, + ...props +}: React.ComponentProps<"span"> & { state: "ok" | "warn" | "err" | "info" }) { + const dotClass = { + ok: "bg-emerald-500", + warn: "bg-amber-500", + err: "bg-red-500", + info: "bg-sky-500", + }[state]; + return ( + + + {children ?? state} + + ); +} + +export { Tag, Status }; +export type { TagColor }; diff --git a/src/components/ui/timeline.tsx b/src/components/ui/timeline.tsx new file mode 100644 index 0000000..bb6475d --- /dev/null +++ b/src/components/ui/timeline.tsx @@ -0,0 +1,79 @@ +// Vertical timeline with spine + marker dots. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +type EventTone = "ok" | "warn" | "err" | "info"; + +const markerClass: Record = { + default: "border-foreground/30", + ok: "border-emerald-500", + warn: "border-amber-500", + err: "border-red-500", + info: "border-sky-500", +}; + +function Timeline({ + className, + children, + ...props +}: React.ComponentProps<"ol">) { + return ( +
      + {children} +
    + ); +} + +function Event({ + time, + tone, + title, + className, + children, + ...props +}: React.ComponentProps<"li"> & { + time?: string; + tone?: EventTone; + title?: string; +}) { + return ( +
  • + + {time ? ( + + ) : null} + {title ? ( +
    + {title} +
    + ) : null} + {children ? ( +
    + {children} +
    + ) : null} +
  • + ); +} + +export { Timeline, Event }; +export type { EventTone }; diff --git a/src/components/ui/tldr.tsx b/src/components/ui/tldr.tsx new file mode 100644 index 0000000..8a5153e --- /dev/null +++ b/src/components/ui/tldr.tsx @@ -0,0 +1,34 @@ +// Our component. If agentic-craft publishes a registry TLDR later, drop +// it in here and adjust the MDX wrapper in components/index.ts. + +import * as React from "react"; +import { cn } from "@/lib/utils"; + +function TLDR({ + className, + children, + ...props +}: React.ComponentProps<"aside">) { + return ( + + ); +} + +export { TLDR }; diff --git a/src/components/ui/tool-call.tsx b/src/components/ui/tool-call.tsx new file mode 100644 index 0000000..b8baed4 --- /dev/null +++ b/src/components/ui/tool-call.tsx @@ -0,0 +1,202 @@ +"use client" + +import * as React from "react" +import { cn } from "@/lib/utils" +import { HugeiconsIcon } from "@hugeicons/react" +import type { IconSvgElement } from "@hugeicons/react" +import { ArrowRight01Icon } from "@hugeicons/core-free-icons" + +/* ── Types ── */ + +type ToolCallStatus = "running" | "completed" | "failed" + +/* ── Context ── */ + +interface ToolCallContextValue { + expanded: boolean + onExpandedChange: (expanded: boolean) => void + status: ToolCallStatus +} + +const ToolCallContext = React.createContext(null) + +function useToolCall(): ToolCallContextValue { + const ctx = React.useContext(ToolCallContext) + if (!ctx) throw new Error("useToolCall must be used within a ") + return ctx +} + +/* ── ToolCall ── */ + +function ToolCall({ + icon, + status = "completed", + timestamp, + error, + onRetry, + defaultExpanded = false, + className, + children, + ...props +}: React.ComponentProps<"div"> & { + icon: IconSvgElement + status?: ToolCallStatus + timestamp?: string + error?: string + onRetry?: () => void + defaultExpanded?: boolean +}) { + const [expanded, setExpanded] = React.useState( + defaultExpanded || status === "failed", + ) + const [hover, setHover] = React.useState(false) + + const hasContent = React.Children.toArray(children).some( + (child) => React.isValidElement(child) && child.type === ToolCallContent, + ) + + const canExpand = status !== "running" && (hasContent || !!error) + + const ctx = React.useMemo( + () => ({ expanded, onExpandedChange: setExpanded, status }), + [expanded, status], + ) + + return ( + +
    setHover(true)} + onMouseLeave={() => setHover(false)} + {...props} + > +
    + + {timestamp && hover && ( + + {timestamp} + + )} +
    + + {/* Expanded content */} + {expanded && hasContent && ( +
    + {React.Children.map(children, (child) => + React.isValidElement(child) && child.type === ToolCallContent + ? child + : null, + )} +
    + )} + + {/* Error state */} + {expanded && error && ( +
    +

    {error}

    + {onRetry && ( + + )} +
    + )} +
    +
    + ) +} + +/* ── ToolCallLabel ── */ + +function ToolCallLabel({ + className, + children, + ...props +}: React.ComponentProps<"span">) { + const { status } = useToolCall() + + return ( + + {children} + + ) +} + +/* ── ToolCallContent ── */ + +function ToolCallContent({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
    + {children} +
    + ) +} + +export { ToolCall, ToolCallLabel, ToolCallContent, useToolCall } +export type { ToolCallStatus } diff --git a/src/components/ui/tool-tree.tsx b/src/components/ui/tool-tree.tsx new file mode 100644 index 0000000..5276b25 --- /dev/null +++ b/src/components/ui/tool-tree.tsx @@ -0,0 +1,151 @@ +"use client" + +import * as React from "react" +import { cn } from "@/lib/utils" +import { HugeiconsIcon } from "@hugeicons/react" +import type { IconSvgElement } from "@hugeicons/react" +import { ArrowDown01Icon } from "@hugeicons/core-free-icons" + +/* ── Context ── */ + +interface ToolTreeContextValue { + open: boolean + onOpenChange: (open: boolean) => void +} + +const ToolTreeContext = React.createContext(null) + +function useToolTree(): ToolTreeContextValue { + const ctx = React.useContext(ToolTreeContext) + if (!ctx) throw new Error("useToolTree must be used within a ") + return ctx +} + +/* ── ToolTree (root) ── */ + +function ToolTree({ + defaultOpen = true, + open: openProp, + onOpenChange: onOpenChangeProp, + className, + children, + ...props +}: React.ComponentProps<"div"> & { + defaultOpen?: boolean + open?: boolean + onOpenChange?: (open: boolean) => void +}) { + const [_open, _setOpen] = React.useState(defaultOpen) + const open = openProp ?? _open + const onOpenChange = React.useCallback( + (v: boolean) => { + if (onOpenChangeProp) onOpenChangeProp(v) + else _setOpen(v) + }, + [onOpenChangeProp], + ) + + const ctx = React.useMemo(() => ({ open, onOpenChange }), [open, onOpenChange]) + + return ( + +
    + {/* Spine: first child so trigger paints on top (DOM order) */} + {open && ( + + )} + {children} +
    +
    + ) +} + +/* ── ToolTreeTrigger ── */ + +function ToolTreeTrigger({ + icon, + timestamp, + className, + children, + ...props +}: React.ComponentProps<"button"> & { + icon?: IconSvgElement + timestamp?: string +}) { + const { open, onOpenChange } = useToolTree() + + return ( +
    + + {timestamp && ( + + {timestamp} + + )} +
    + ) +} + +/* ── ToolTreeContent ── + Wraps each child (ToolCall) with L-connector and spine mask for the last item. */ + +function ToolTreeContent({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + const { open } = useToolTree() + if (!open) return null + + const items = React.Children.toArray(children) + + return ( +
    +
    + {items.map((child, i) => { + const isLast = i === items.length - 1 + return ( +
    + {/* Last-child: mask FIRST so connector paints on top */} + {isLast && ( +
    + )} + {/* L-connector with rounded bottom-left corner */} +
    + {child} +
    + ) + })} +
    +
    + ) +} + +export { + ToolTree, + ToolTreeTrigger, + ToolTreeContent, + useToolTree, +} diff --git a/src/lib/utils.ts b/src/lib/utils.ts new file mode 100644 index 0000000..a5ef193 --- /dev/null +++ b/src/lib/utils.ts @@ -0,0 +1,6 @@ +import { clsx, type ClassValue } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..ae69ec2 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,129 @@ +// Minimal Web-API shims for sandboxed JS engines (e.g. v8go) that ship +// only ECMAScript built-ins. react-dom/server.edge calls into these at +// module-init time, so this file must execute before the React import. +// Imported first in bundle.ts. + +const g = globalThis as Record; + +if (typeof g.TextEncoder === "undefined") { + class TextEncoderShim { + readonly encoding = "utf-8"; + encode(str = ""): Uint8Array { + // Encode via well-formed UTF-8 manually so we don't depend on + // decodeURIComponent's surrogate handling. + const out: number[] = []; + for (let i = 0; i < str.length; i++) { + let c = str.charCodeAt(i); + if (c >= 0xd800 && c <= 0xdbff && i + 1 < str.length) { + const c2 = str.charCodeAt(i + 1); + if (c2 >= 0xdc00 && c2 <= 0xdfff) { + c = 0x10000 + (((c - 0xd800) << 10) | (c2 - 0xdc00)); + i++; + } + } + if (c < 0x80) { + out.push(c); + } else if (c < 0x800) { + out.push(0xc0 | (c >> 6), 0x80 | (c & 0x3f)); + } else if (c < 0x10000) { + out.push(0xe0 | (c >> 12), 0x80 | ((c >> 6) & 0x3f), 0x80 | (c & 0x3f)); + } else { + out.push( + 0xf0 | (c >> 18), + 0x80 | ((c >> 12) & 0x3f), + 0x80 | ((c >> 6) & 0x3f), + 0x80 | (c & 0x3f), + ); + } + } + return new Uint8Array(out); + } + encodeInto(str: string, dest: Uint8Array) { + const bytes = this.encode(str); + const n = Math.min(bytes.length, dest.length); + dest.set(bytes.subarray(0, n)); + return { read: str.length, written: n }; + } + } + g.TextEncoder = TextEncoderShim; +} + +if (typeof g.TextDecoder === "undefined") { + class TextDecoderShim { + readonly encoding = "utf-8"; + readonly fatal = false; + readonly ignoreBOM = false; + decode(input?: BufferSource): string { + if (!input) return ""; + const view = + input instanceof Uint8Array + ? input + : new Uint8Array(input instanceof ArrayBuffer ? input : (input as ArrayBufferView).buffer); + let out = ""; + for (let i = 0; i < view.length; ) { + const b1 = view[i++]; + if (b1 < 0x80) { + out += String.fromCharCode(b1); + } else if (b1 < 0xc0) { + out += "�"; + } else if (b1 < 0xe0) { + out += String.fromCharCode(((b1 & 0x1f) << 6) | (view[i++] & 0x3f)); + } else if (b1 < 0xf0) { + out += String.fromCharCode( + ((b1 & 0x0f) << 12) | ((view[i++] & 0x3f) << 6) | (view[i++] & 0x3f), + ); + } else { + let cp = + ((b1 & 0x07) << 18) | + ((view[i++] & 0x3f) << 12) | + ((view[i++] & 0x3f) << 6) | + (view[i++] & 0x3f); + cp -= 0x10000; + out += String.fromCharCode(0xd800 | (cp >> 10), 0xdc00 | (cp & 0x3ff)); + } + } + return out; + } + } + g.TextDecoder = TextDecoderShim; +} + +// React's scheduler probes for `performance.now()`. Provide a Date-based +// fallback. Cheap; never called in our synchronous render path. +if (typeof g.performance === "undefined") { + g.performance = { now: () => Date.now() }; +} + +// Used by react-dom-server in its abort signal plumbing. The render +// path we take never aborts, but it dereferences `AbortController` +// at module init time. +if (typeof g.AbortController === "undefined") { + class AbortSignalShim { + aborted = false; + reason: unknown = undefined; + onabort: (() => void) | null = null; + addEventListener() {} + removeEventListener() {} + dispatchEvent() { + return true; + } + throwIfAborted() {} + } + class AbortControllerShim { + signal = new AbortSignalShim(); + abort(reason?: unknown) { + this.signal.aborted = true; + this.signal.reason = reason; + } + } + g.AbortController = AbortControllerShim; + g.AbortSignal = AbortSignalShim; +} + +// react-dom-server.edge uses queueMicrotask. v8 provides it as a +// built-in (ECMA-262 jobs queue) but expose it as a global if missing. +if (typeof g.queueMicrotask === "undefined") { + g.queueMicrotask = (cb: () => void) => Promise.resolve().then(cb); +} + +export {}; diff --git a/src/styles.css b/src/styles.css deleted file mode 100644 index 9e755cb..0000000 --- a/src/styles.css +++ /dev/null @@ -1,415 +0,0 @@ -/* @bitcomplete/mdx-components v0.1 */ - -:root{ - --bc-bg: #ffffff; - --bc-fg: #1c1c1f; - --bc-muted: #6b6b73; - --bc-line: #e8e8ec; - --bc-line-soft: #f1f1f4; - --bc-accent: #5b6cff; - --bc-info: #4f7ed8; - --bc-info-bg: #eef3fc; - --bc-warn: #c47900; - --bc-warn-bg: #fdf3e0; - --bc-danger: #cd2b3a; - --bc-danger-bg: #fce8eb; - --bc-success: #2a8b56; - --bc-success-bg: #e5f5ec; - --bc-note: #6f6f78; - --bc-note-bg: #f3f3f5; - --bc-radius: 8px; - --bc-radius-sm: 5px; - --bc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; - --bc-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace; -} - -@media (prefers-color-scheme: dark){ - :root{ - --bc-bg: #15161a; - --bc-fg: #ebebef; - --bc-muted: #9f9faa; - --bc-line: #2a2c33; - --bc-line-soft: #1e2026; - --bc-info-bg: #15263f; - --bc-warn-bg: #3a2d10; - --bc-danger-bg: #3a1419; - --bc-success-bg: #133123; - --bc-note-bg: #232428; - } -} - -.bc-doc{ - font-family: var(--bc-font); - color: var(--bc-fg); - background: var(--bc-bg); - font-size: 15px; - line-height: 1.6; - max-width: 56rem; - margin: 0 auto; - padding: 3rem 1.5rem 6rem; - /* Long URLs / hashes shouldn't blow out the column. */ - overflow-wrap: anywhere; -} -.bc-doc *, -.bc-doc *::before, -.bc-doc *::after{box-sizing:border-box} - -.bc-doc h1{font-size:1.9rem;margin:1.2em 0 .4em;line-height:1.2} -.bc-doc h2{font-size:1.45rem;margin:1.5em 0 .4em;line-height:1.25} -.bc-doc h3{font-size:1.15rem;margin:1.2em 0 .3em} -.bc-doc p{margin:.7em 0} -.bc-doc a{color:var(--bc-accent);text-decoration:none} -.bc-doc a:hover{text-decoration:underline} -.bc-doc code{font-family:var(--bc-mono);font-size:.92em;background:var(--bc-line-soft);padding:.1em .3em;border-radius:3px;overflow-wrap:anywhere} -.bc-doc hr{border:0;border-top:1px solid var(--bc-line);margin:2em 0} - -/* Default blockquote — user messages in transcripts land here. */ -.bc-doc blockquote{ - margin:.8em 0; - padding:.6em 1em; - border-left:3px solid var(--bc-line); - background:var(--bc-line-soft); - color:var(--bc-fg); - border-radius:0 var(--bc-radius-sm) var(--bc-radius-sm) 0; -} -.bc-doc blockquote > :first-child{margin-top:0} -.bc-doc blockquote > :last-child{margin-bottom:0} - -/* Markdown tables — narrow viewports get a horizontal scrollbar instead - * of cells collapsing. */ -.bc-doc table{ - display:block; - max-width:100%; - overflow-x:auto; - border-collapse:collapse; - margin:1em 0; -} -.bc-doc th, -.bc-doc td{ - padding:.4em .7em; - border:1px solid var(--bc-line); - text-align:left; -} -.bc-doc th{background:var(--bc-line-soft);font-weight:600} - -/* Any
     in the document — including the bare ones authors drop in —
    - * wraps long lines instead of forcing horizontal scroll. The override on
    - * .bc-code below keeps the look consistent. */
    -.bc-doc pre{
    -  background:var(--bc-line-soft);
    -  border-radius:var(--bc-radius);
    -  padding:.75rem 1rem;
    -  margin:1em 0;
    -  font-family:var(--bc-mono);
    -  font-size:.85rem;
    -  line-height:1.5;
    -  white-space:pre-wrap;
    -  word-break:break-word;
    -  overflow-wrap:anywhere;
    -  max-width:100%;
    -}
    -.bc-doc pre code{background:none;padding:0;font-size:inherit}
    -
    -/* Section */
    -.bc-section{margin:2em 0}
    -.bc-section-title{font-size:1.45rem;font-weight:600}
    -
    -/* TLDR */
    -.bc-tldr{
    -  display:grid;
    -  grid-template-columns: auto 1fr;
    -  gap: .9rem 1.1rem;
    -  background: var(--bc-line-soft);
    -  border-left: 3px solid var(--bc-accent);
    -  padding: 1rem 1.2rem;
    -  border-radius: var(--bc-radius);
    -  margin: 1.5em 0;
    -}
    -.bc-tldr-label{
    -  font-weight:700;
    -  font-size:.75rem;
    -  letter-spacing:.08em;
    -  text-transform:uppercase;
    -  color:var(--bc-muted);
    -  align-self:start;
    -  padding-top:.2em;
    -}
    -.bc-tldr-body > :first-child{margin-top:0}
    -.bc-tldr-body > :last-child{margin-bottom:0}
    -
    -/* Callout */
    -.bc-callout{
    -  display:grid;
    -  grid-template-columns: auto 1fr;
    -  gap: .25rem .75rem;
    -  border-radius: var(--bc-radius);
    -  padding: .9rem 1rem;
    -  margin: 1.2em 0;
    -  font-size: .95em;
    -}
    -.bc-callout-icon{font-size:1.05rem;line-height:1.4;padding-top:.05em}
    -.bc-callout-title{font-weight:600;margin-bottom:.25em}
    -.bc-callout-body > :first-child{margin-top:0}
    -.bc-callout-body > :last-child{margin-bottom:0}
    -.bc-callout-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-callout-info .bc-callout-icon{color:var(--bc-info)}
    -.bc-callout-info .bc-callout-body, .bc-callout-info .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-warning{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-callout-warning .bc-callout-body, .bc-callout-warning .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-danger{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-callout-danger .bc-callout-body, .bc-callout-danger .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-success{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-callout-success .bc-callout-body, .bc-callout-success .bc-callout-title{color:var(--bc-fg)}
    -.bc-callout-note{background:var(--bc-note-bg);color:var(--bc-note)}
    -.bc-callout-note .bc-callout-body, .bc-callout-note .bc-callout-title{color:var(--bc-fg)}
    -
    -/* KPI */
    -.bc-kpi-group{
    -  display:grid;
    -  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    -  gap: 1rem;
    -  margin: 1.5em 0;
    -}
    -.bc-kpi{
    -  background: var(--bc-line-soft);
    -  padding: 1rem;
    -  border-radius: var(--bc-radius);
    -  border: 1px solid var(--bc-line);
    -  /* In a grid track, content can otherwise refuse to shrink below its
    -   * intrinsic width, which is what was bursting the cards on long
    -   * text values. */
    -  min-width: 0;
    -}
    -.bc-kpi-value{
    -  font-family: var(--bc-mono);
    -  font-size: 1.9rem;
    -  font-weight: 600;
    -  line-height: 1.1;
    -  /* Wrap rather than overflow when the value isn't a short number. */
    -  overflow-wrap: anywhere;
    -  word-break: break-word;
    -}
    -.bc-kpi-label{font-size:.85rem;color:var(--bc-muted);margin-top:.4em;text-transform:uppercase;letter-spacing:.05em;overflow-wrap:anywhere}
    -.bc-kpi-trend{font-size:.85rem;margin-top:.4em;color:var(--bc-muted);overflow-wrap:anywhere}
    -.bc-kpi-ok .bc-kpi-value{color:var(--bc-success)}
    -.bc-kpi-warn .bc-kpi-value{color:var(--bc-warn)}
    -.bc-kpi-err .bc-kpi-value{color:var(--bc-danger)}
    -.bc-kpi-info .bc-kpi-value{color:var(--bc-info)}
    -
    -/* Steps */
    -.bc-steps{list-style:none;padding:0;margin:1.5em 0;display:flex;flex-direction:column;gap:.6rem}
    -.bc-step{
    -  border:1px solid var(--bc-line);
    -  border-radius: var(--bc-radius);
    -  padding: .8rem 1rem;
    -  background: var(--bc-bg);
    -}
    -.bc-step-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}
    -.bc-step-title{font-weight:600}
    -.bc-step-status{
    -  font-size:.7rem;
    -  text-transform:uppercase;
    -  letter-spacing:.06em;
    -  padding:.15em .55em;
    -  border-radius: 999px;
    -  background: var(--bc-line-soft);
    -  color: var(--bc-muted);
    -}
    -.bc-step-status-doing{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-step-status-done{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-step-status-blocked{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-step-body{margin-top:.4em;color:var(--bc-fg)}
    -.bc-step-body > :first-child{margin-top:0}
    -.bc-step-body > :last-child{margin-bottom:0}
    -
    -/* Compare */
    -.bc-compare{
    -  display:grid;
    -  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    -  gap: 1rem;
    -  margin: 1.5em 0;
    -}
    -.bc-compare-option{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:1rem;
    -}
    -.bc-compare-label{font-weight:600;margin-bottom:.5em}
    -
    -/* Quote */
    -.bc-quote{margin:1.5em 0;padding:0 0 0 1rem;border-left:3px solid var(--bc-line)}
    -.bc-quote-body{margin:0;font-style:italic;color:var(--bc-fg)}
    -.bc-quote-author{margin-top:.5em;color:var(--bc-muted);font-size:.9em}
    -
    -/* Code */
    -.bc-code{
    -  background: var(--bc-line-soft);
    -  border-radius: var(--bc-radius);
    -  padding: .85rem 1rem;
    -  font-family: var(--bc-mono);
    -  font-size: .85rem;
    -  line-height: 1.5;
    -  margin: 1em 0;
    -  white-space: pre-wrap;
    -  word-break: break-word;
    -  overflow-wrap: anywhere;
    -  max-width: 100%;
    -}
    -.bc-code code{background:none;padding:0;font-size:inherit}
    -
    -/* Diagram */
    -.bc-diagram{margin:1.5em 0}
    -.bc-diagram-body{display:flex;justify-content:center}
    -.bc-diagram-body svg{max-width:100%;height:auto}
    -.bc-diagram-caption{margin-top:.5em;color:var(--bc-muted);font-size:.9em;text-align:center}
    -
    -/* Tag + Status */
    -.bc-tag{
    -  display:inline-block;
    -  font-size:.75rem;
    -  padding:.18em .55em;
    -  border-radius:999px;
    -  background:var(--bc-line-soft);
    -  color:var(--bc-muted);
    -  font-weight:500;
    -}
    -.bc-tag-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-tag-warning{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-tag-danger{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-tag-success{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-status{display:inline-flex;align-items:center;gap:.4em;font-size:.85rem}
    -.bc-status-dot{width:.55em;height:.55em;border-radius:50%;background:var(--bc-muted)}
    -.bc-status-ok .bc-status-dot{background:var(--bc-success)}
    -.bc-status-warn .bc-status-dot{background:var(--bc-warn)}
    -.bc-status-err .bc-status-dot{background:var(--bc-danger)}
    -.bc-status-info .bc-status-dot{background:var(--bc-info)}
    -
    -/* Diff */
    -.bc-diff{display:grid;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));gap:1rem;margin:1.5em 0}
    -.bc-diff-side{border:1px solid var(--bc-line);border-radius:var(--bc-radius);padding:1rem}
    -.bc-diff-before{background:var(--bc-danger-bg)}
    -.bc-diff-after{background:var(--bc-success-bg)}
    -.bc-diff-label{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--bc-muted);margin-bottom:.5em;font-weight:600}
    -
    -/* ToolCall + ToolTree */
    -.bc-tool{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:.8rem 1rem;
    -  margin:.6em 0;
    -  font-size:.92rem;
    -  max-width:100%;
    -  min-width:0;
    -  overflow:hidden;
    -}
    -.bc-tool-head{
    -  display:flex;
    -  align-items:center;
    -  gap:.8em;
    -  justify-content:space-between;
    -  flex-wrap:wrap;
    -}
    -.bc-tool-name{font-family:var(--bc-mono);font-weight:600;color:var(--bc-accent);overflow-wrap:anywhere;min-width:0}
    -.bc-tool-timing{color:var(--bc-muted);font-size:.85em}
    -.bc-tool-status{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.15em .55em;border-radius:999px;background:var(--bc-line-soft);color:var(--bc-muted);flex-shrink:0}
    -.bc-tool-status-running{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-tool-status-ok{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-tool-status-fail{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-tool-args{
    -  margin:.5em 0 0;
    -  font-size:.8rem;
    -  background:var(--bc-line-soft);
    -  padding:.5em .75em;
    -  border-radius:var(--bc-radius-sm);
    -  font-family:var(--bc-mono);
    -  line-height:1.45;
    -  white-space:pre-wrap;
    -  word-break:break-word;
    -  overflow-wrap:anywhere;
    -  max-width:100%;
    -}
    -.bc-tool-body{margin-top:.5em;min-width:0}
    -.bc-tool-body pre{margin:.4em 0;font-size:.8rem;line-height:1.45;background:var(--bc-line-soft)}
    -.bc-tool-tree{padding-left:1.25rem;border-left:1px dashed var(--bc-line);margin:.6em 0;min-width:0}
    -.bc-tool-tree > .bc-tool{position:relative}
    -.bc-tool-tree > .bc-tool::before{
    -  content:"";
    -  position:absolute;
    -  left:-1.25rem;
    -  top:1rem;
    -  width:1rem;
    -  border-top:1px dashed var(--bc-line);
    -}
    -
    -/* Finding */
    -.bc-finding{
    -  border:1px solid var(--bc-line);
    -  border-left-width: 4px;
    -  border-radius:var(--bc-radius);
    -  padding:.9rem 1rem;
    -  margin:.8em 0;
    -}
    -.bc-finding-info{border-left-color:var(--bc-info)}
    -.bc-finding-low{border-left-color:var(--bc-muted)}
    -.bc-finding-medium{border-left-color:var(--bc-warn)}
    -.bc-finding-high{border-left-color:var(--bc-danger)}
    -.bc-finding-critical{border-left-color:var(--bc-danger);background:var(--bc-danger-bg)}
    -.bc-finding-head{display:flex;align-items:baseline;gap:.7em;flex-wrap:wrap}
    -.bc-finding-code{font-family:var(--bc-mono);color:var(--bc-muted);font-size:.85em;background:none;padding:0}
    -.bc-finding-title{margin:0;font-size:1rem;flex:1}
    -.bc-finding-sev{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.15em .55em;border-radius:999px;background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-finding-sev-high,.bc-finding-sev-critical{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-finding-sev-medium{background:var(--bc-warn-bg);color:var(--bc-warn)}
    -.bc-finding-sev-low{background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-finding-sev-info{background:var(--bc-info-bg);color:var(--bc-info)}
    -.bc-finding-body{margin-top:.5em;color:var(--bc-fg);font-size:.95em}
    -
    -/* Approval */
    -.bc-approval{
    -  border:1px solid var(--bc-line);
    -  border-radius:var(--bc-radius);
    -  padding:.9rem 1rem;
    -  margin:.8em 0;
    -  display:flex;
    -  flex-direction:column;
    -  gap:.5em;
    -}
    -.bc-approval-head{display:flex;justify-content:space-between;align-items:center;gap:1em}
    -.bc-approval-action{font-family:var(--bc-mono);font-size:.92em}
    -.bc-approval-badge{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;padding:.18em .65em;border-radius:999px}
    -.bc-approval-badge-approved{background:var(--bc-success-bg);color:var(--bc-success)}
    -.bc-approval-badge-denied{background:var(--bc-danger-bg);color:var(--bc-danger)}
    -.bc-approval-badge-pending{background:var(--bc-line-soft);color:var(--bc-muted)}
    -.bc-approval-meta{color:var(--bc-muted);font-size:.85em;display:flex;gap:1em}
    -
    -/* Timeline */
    -.bc-timeline{list-style:none;padding:0;margin:1.5em 0;position:relative}
    -.bc-timeline::before{
    -  content:"";
    -  position:absolute;
    -  left:.45rem;
    -  top:.4rem;
    -  bottom:.4rem;
    -  width:1px;
    -  background:var(--bc-line);
    -}
    -.bc-event{position:relative;padding:0 0 1em 2rem}
    -.bc-event-marker{
    -  position:absolute;
    -  left:0;
    -  top:.45rem;
    -  width:1rem;
    -  height:1rem;
    -  border-radius:50%;
    -  background:var(--bc-bg);
    -  border:2px solid var(--bc-muted);
    -}
    -.bc-event-ok .bc-event-marker{border-color:var(--bc-success)}
    -.bc-event-warn .bc-event-marker{border-color:var(--bc-warn)}
    -.bc-event-err .bc-event-marker{border-color:var(--bc-danger)}
    -.bc-event-info .bc-event-marker{border-color:var(--bc-info)}
    -.bc-event-time{font-family:var(--bc-mono);font-size:.8em;color:var(--bc-muted)}
    -.bc-event-title{font-weight:600;margin-top:.1em}
    -.bc-event-body{margin-top:.3em;color:var(--bc-fg);font-size:.95em}
    -.bc-event-body > :first-child{margin-top:0}
    -.bc-event-body > :last-child{margin-bottom:0}
    diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css
    new file mode 100644
    index 0000000..f6991b3
    --- /dev/null
    +++ b/src/styles/tailwind.css
    @@ -0,0 +1,206 @@
    +@import "tailwindcss";
    +
    +/* Scan source files for utility classes. */
    +@source "../components/**/*.{ts,tsx}";
    +@source "../lib/**/*.{ts,tsx}";
    +
    +/* Webfonts: Source Serif 4 for prose + headings, Albert Sans for UI metadata. */
    +@import url("https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600&display=swap");
    +
    +@theme {
    +  --font-sans: "Albert Sans", ui-sans-serif, system-ui, sans-serif;
    +  --font-serif: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
    +  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
    +}
    +
    +/* Theme tokens. Light by default; dark via prefers-color-scheme. Variables
    + * are scoped to .bc-doc so this stylesheet never leaks into the host page
    + * when inlined alongside other content. */
    +.bc-doc {
    +  --color-background: oklch(1 0 0);
    +  --color-foreground: oklch(0.145 0 0);
    +  --color-card: oklch(1 0 0);
    +  --color-card-foreground: oklch(0.145 0 0);
    +  --color-popover: oklch(1 0 0);
    +  --color-popover-foreground: oklch(0.145 0 0);
    +  --color-primary: oklch(0.205 0 0);
    +  --color-primary-foreground: oklch(0.985 0 0);
    +  --color-secondary: oklch(0.97 0 0);
    +  --color-secondary-foreground: oklch(0.205 0 0);
    +  --color-muted: oklch(0.97 0 0);
    +  --color-muted-foreground: oklch(0.556 0 0);
    +  --color-accent: oklch(0.97 0 0);
    +  --color-accent-foreground: oklch(0.205 0 0);
    +  --color-destructive: oklch(0.577 0.245 27.325);
    +  --color-border: oklch(0.922 0 0);
    +  --color-input: oklch(0.922 0 0);
    +  --color-ring: oklch(0.708 0 0);
    +  --radius: 0.625rem;
    +}
    +
    +@media (prefers-color-scheme: dark) {
    +  .bc-doc {
    +    --color-background: oklch(0.145 0 0);
    +    --color-foreground: oklch(0.985 0 0);
    +    --color-card: oklch(0.205 0 0);
    +    --color-card-foreground: oklch(0.985 0 0);
    +    --color-popover: oklch(0.205 0 0);
    +    --color-popover-foreground: oklch(0.985 0 0);
    +    --color-primary: oklch(0.922 0 0);
    +    --color-primary-foreground: oklch(0.205 0 0);
    +    --color-secondary: oklch(0.269 0 0);
    +    --color-secondary-foreground: oklch(0.985 0 0);
    +    --color-muted: oklch(0.269 0 0);
    +    --color-muted-foreground: oklch(0.708 0 0);
    +    --color-accent: oklch(0.269 0 0);
    +    --color-accent-foreground: oklch(0.985 0 0);
    +    --color-destructive: oklch(0.704 0.191 22.216);
    +    --color-border: oklch(1 0 0 / 10%);
    +    --color-input: oklch(1 0 0 / 15%);
    +    --color-ring: oklch(0.556 0 0);
    +  }
    +}
    +
    +@layer base {
    +  .bc-doc {
    +    background: var(--color-background);
    +    color: var(--color-foreground);
    +    font-family: var(--font-sans);
    +    font-synthesis: none;
    +    -webkit-font-smoothing: antialiased;
    +    -moz-osx-font-smoothing: grayscale;
    +    max-width: 720px;
    +    margin: 0 auto;
    +    padding: 3rem 1.5rem 6rem;
    +    overflow-wrap: anywhere;
    +  }
    +  .bc-doc *,
    +  .bc-doc *::before,
    +  .bc-doc *::after { box-sizing: border-box; }
    +
    +  /* Markdown-emitted typography. Components are styled inline with
    +   * Tailwind utilities; these rules cover raw 

    /

    /

      /etc. that + * fall through from plain markdown. */ + .bc-doc > h1:first-child, + .bc-doc h1 { + font-family: var(--font-serif); + font-weight: 300; + font-size: 2.5rem; + line-height: 1.1; + letter-spacing: -0.02em; + margin: 0 0 1rem; + text-wrap: balance; + } + .bc-doc h2 { + font-family: var(--font-serif); + font-weight: 300; + font-size: 1.75rem; + line-height: 1.2; + letter-spacing: -0.015em; + margin: 2.5rem 0 1rem; + text-wrap: balance; + } + .bc-doc h3 { + font-family: var(--font-serif); + font-weight: 400; + font-size: 1.25rem; + line-height: 1.3; + margin: 2rem 0 .75rem; + text-wrap: balance; + } + .bc-doc h4 { + font-family: var(--font-sans); + font-weight: 600; + font-size: 1rem; + margin: 1.5rem 0 .5rem; + } + .bc-doc p { + font-family: var(--font-serif); + font-size: 1rem; + line-height: 1.7; + margin: .75rem 0; + color: var(--color-foreground); + text-wrap: pretty; + } + .bc-doc a { + color: var(--color-foreground); + text-decoration: underline; + text-decoration-color: color-mix(in oklch, var(--color-foreground) 30%, transparent); + text-underline-offset: 0.2em; + transition: text-decoration-color 0.15s ease; + } + .bc-doc a:hover { + text-decoration-color: var(--color-foreground); + } + .bc-doc strong { font-weight: 600; } + .bc-doc em { font-style: italic; } + .bc-doc hr { + border: 0; + border-top: 1px solid var(--color-border); + margin: 3rem 0; + } + + /* Lists in markdown prose */ + .bc-doc > ul, + .bc-doc > ol, + .bc-doc :where(p, li) + ul, + .bc-doc :where(p, li) + ol { + font-family: var(--font-serif); + font-size: 1rem; + line-height: 1.7; + padding-left: 1.5rem; + margin: .75rem 0; + } + .bc-doc :is(ul, ol) li { margin: .25rem 0; } + .bc-doc > ul, .bc-doc :where(p, li) + ul { list-style: disc; } + .bc-doc > ol, .bc-doc :where(p, li) + ol { list-style: decimal; } + + /* Inline code in markdown prose */ + .bc-doc :not(pre) > code { + font-family: var(--font-mono); + font-size: 0.875em; + background: color-mix(in oklch, var(--color-muted) 80%, transparent); + padding: 0.1em 0.35em; + border-radius: 3px; + overflow-wrap: anywhere; + } + + /* Bare
       blocks emitted by markdown code fences */
      +  .bc-doc pre:not([data-slot]) {
      +    font-family: var(--font-mono);
      +    font-size: 0.85rem;
      +    line-height: 1.5;
      +    background: color-mix(in oklch, var(--color-muted) 70%, transparent);
      +    border: 1px solid var(--color-border);
      +    border-radius: 0.5rem;
      +    padding: 0.85rem 1rem;
      +    margin: 1rem 0;
      +    overflow-x: auto;
      +    white-space: pre-wrap;
      +    word-break: break-word;
      +  }
      +  .bc-doc pre:not([data-slot]) code { background: none; padding: 0; }
      +
      +  .bc-doc blockquote {
      +    margin: 1.5rem 0;
      +    padding: 0 0 0 1.25rem;
      +    border-left: 2px solid var(--color-border);
      +    font-family: var(--font-serif);
      +    font-style: italic;
      +    color: color-mix(in oklch, var(--color-foreground) 85%, transparent);
      +  }
      +
      +  .bc-doc table {
      +    font-family: var(--font-sans);
      +    font-size: 0.9rem;
      +    border-collapse: collapse;
      +    width: 100%;
      +    margin: 1rem 0;
      +  }
      +  .bc-doc th, .bc-doc td {
      +    border: 1px solid var(--color-border);
      +    padding: .4rem .7rem;
      +    text-align: left;
      +  }
      +  .bc-doc th { font-weight: 600; background: color-mix(in oklch, var(--color-muted) 50%, transparent); }
      +}
      diff --git a/tsconfig.json b/tsconfig.json
      index 8391d82..573e57b 100644
      --- a/tsconfig.json
      +++ b/tsconfig.json
      @@ -5,7 +5,6 @@
           "moduleResolution": "Bundler",
           "lib": ["ES2022", "DOM", "DOM.Iterable"],
           "jsx": "react-jsx",
      -    "jsxImportSource": "preact",
           "strict": true,
           "esModuleInterop": true,
           "skipLibCheck": true,
      @@ -15,6 +14,10 @@
           "noUnusedLocals": true,
           "noUnusedParameters": true,
           "noImplicitOverride": true,
      +    "baseUrl": ".",
      +    "paths": {
      +      "@/*": ["src/*"]
      +    },
           "outDir": "./dist"
         },
         "include": ["src", "test"]
      diff --git a/tsup.config.ts b/tsup.config.ts
      index 27032db..f19cebe 100644
      --- a/tsup.config.ts
      +++ b/tsup.config.ts
      @@ -26,5 +26,13 @@ export default defineConfig([
           minify: true,
           noExternal: [/.*/],
           platform: "neutral",
      +    // Replace process.env.NODE_ENV at build time so React's production
      +    // bundle doesn't reference `process` (undefined inside v8go).
      +    define: {
      +      "process.env.NODE_ENV": '"production"',
      +      "process.env.NODE_DEBUG": "undefined",
      +      "process.platform": '"browser"',
      +      "process.version": '"v0.0.0"',
      +    },
         },
       ]);
      
      From 582d94d25a09d60ce3be72c078f751efcecb7afe Mon Sep 17 00:00:00 2001
      From: terra tauri 
      Date: Sun, 31 May 2026 07:07:16 -0700
      Subject: [PATCH 3/8] feat: conversation + tool-call expansion + finding/steps
       refinements
      
      Catch-up commit covering the UX audit + tool-call work that shipped
      to pin (tags 16-18) and the conversation components needed by the
      share-session rewrite. Bundle is already deployed; this just commits
      the source-of-truth alongside.
      
      - New  /  /  /
         /  (src/components/ui/conversation.tsx)
      - ToolCall expanded panel: JSON args parse into a 
      definition list under an ARGS label; output gets its own OUTPUT label; status="fail" turns ERROR - Steps: rounded card frame + colored dot per status, no line-through (status="done" means "verified", not "obsolete") - Finding: bulleted prose format, severity-colored dot - Theme tokens moved into @theme so Tailwind v4 actually generates bg-card / bg-muted / text-foreground utilities Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/index.tsx | 334 ++++++++++++++++++++++++----- src/components/styles.ts | 2 +- src/components/ui/conversation.tsx | 128 +++++++++++ src/components/ui/finding.tsx | 114 +++++----- src/components/ui/steps.tsx | 87 +++++--- src/styles/tailwind.css | 95 ++++---- 6 files changed, 583 insertions(+), 177 deletions(-) create mode 100644 src/components/ui/conversation.tsx diff --git a/src/components/index.tsx b/src/components/index.tsx index 483a19d..224a0fb 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -10,6 +10,7 @@ // the upstream project publishes them. import * as React from "react"; +import { HugeiconsIcon } from "@hugeicons/react"; import { CommandLineIcon, CodeIcon, @@ -20,8 +21,10 @@ import { Settings01Icon, GitBranchIcon, Database01Icon, + ArrowRight01Icon, } from "@hugeicons/core-free-icons"; import type { IconSvgElement } from "@hugeicons/react"; +import { cn } from "@/lib/utils.js"; // Vendored from agentic-craft registry — // https://github.com/arielconti10/agentic-craft/tree/main/registry/base-nova/ui @@ -36,23 +39,12 @@ export { ToolTreeContent, } from "./ui/tool-tree.js"; -import { - ToolCall as ToolCallPrimitive, - ToolCallLabel, - ToolCallContent, -} from "./ui/tool-call.js"; -import { - ToolTree as ToolTreePrimitive, - ToolTreeTrigger, - ToolTreeContent, -} from "./ui/tool-tree.js"; - export { TLDR } from "./ui/tldr.js"; export { Callout } from "./ui/callout.js"; export { KPI, KPIGroup } from "./ui/kpi.js"; export { Steps, Step } from "./ui/steps.js"; export { Compare, Option } from "./ui/compare.js"; -export { Finding } from "./ui/finding.js"; +export { Finding, Findings } from "./ui/finding.js"; export { Approval } from "./ui/approval.js"; export { Timeline, Event } from "./ui/timeline.js"; export { Tag, Status } from "./ui/tag.js"; @@ -61,6 +53,13 @@ export { Section } from "./ui/section.js"; export { Quote } from "./ui/quote.js"; export { Code } from "./ui/code.js"; export { Diagram } from "./ui/diagram.js"; +export { + Conversation, + UserMessage, + AssistantMessage, + SystemMessage, + Thinking, +} from "./ui/conversation.js"; // ── ToolCall MDX wrapper ───────────────────────────────────────────── // Our MDX API is flat: ` = { type ToolStatus = "running" | "ok" | "fail" | "skip"; +// We render
      / rather than the vendored React +// ToolCall/ToolTree from agentic-craft. Their primitives use +// React.useState for expand/collapse — that works in their Next.js +// app but pin ships static HTML with no React runtime in the browser, +// so the click handlers never fire.
      gets the same UX for +// free with no JS. We keep the same visual language and `data-slot` +// markers so a future client-hydrated swap-in is mechanical. +// +// Following the agentic-craft Actions spec +// (https://agentic-craft.vercel.app/actions): +// - Label is 14px sans, weight 400 — never bold, never function +// signature +// - Icons are monochrome muted; only `fail` switches to red +// - Duration is right-aligned in muted text. Failed calls prefix +// it with "failed ·" +// - Args + children are hidden until the row is expanded — only +// the label is visible by default +// - `fail` rows open by default so the error is immediately visible + +const statusIconClass: Record = { + running: "text-sky-500", + ok: "text-muted-foreground", + fail: "text-red-500", + skip: "text-muted-foreground/50", +}; + export function ToolCall({ name, - status, + label, + status = "ok", timing, args, children, }: { name: string; + /** Human-readable label override. Falls back to `name`. */ + label?: string; status?: ToolStatus; timing?: string; args?: string; @@ -105,52 +133,225 @@ export function ToolCall({ }) { const icon: IconSvgElement = iconByName[name.toLowerCase()] ?? Settings01Icon; - const upstream: "running" | "completed" | "failed" = - status === "running" - ? "running" - : status === "fail" - ? "failed" - : "completed"; const hasBody = !!(args || children); + const displayLabel = label ?? name; + const isFail = status === "fail"; + + const timingText = timing + ? isFail + ? `failed · ${timing}` + : timing + : isFail + ? "failed" + : undefined; + + const summary = ( + <> + + + + + {displayLabel} + + {timingText ? ( + + {timingText} + + ) : null} + {hasBody ? ( + + ) : null} + + ); + + if (!hasBody) { + // Non-expandable row — still aligned with the others. + return ( +
      + {summary} +
      + ); + } + return ( - - - {name} - {args ? ( - {args} + + {summary} + +
      + {args ? : null} + {children ? ( + {children} ) : null} - - {hasBody ? ( - - {args ? ( -
      -              {args}
      -            
      - ) : null} - {children ? ( -
      - {children} -
      - ) : null} -
      - ) : null} - +
      +
      + ); +} + +// Args panel. If `args` parses as a JSON object, render as a definition +// list (mono keys aligned, values wrap). Otherwise render the raw +// string in a single mono code block. Both variants sit under a small +// uppercase ARGS label. +function ToolCallArgs({ args }: { args: string }) { + const kv = parseArgsAsKV(args); + return ( +
      + args + {kv ? ( +
      + {kv.map(([k, v]) => ( + +
      {k}
      +
      + {v} +
      +
      + ))} +
      + ) : ( +
      +          {args}
      +        
      + )} +
      + ); +} + +function ToolCallOutput({ + isFail, + children, +}: { + isFail: boolean; + children: React.ReactNode; +}) { + return ( +
      + + {isFail ? "error" : "output"} + +
      + {children} +
      +
      + ); +} + +function SectionLabel({ + tone, + children, +}: { + tone?: "fail"; + children: React.ReactNode; +}) { + return ( +
      + {children} +
      + ); +} + +// Try to detect "{...}" object-shaped JSON and return [key, valueString] +// pairs. Values that aren't strings are JSON-stringified two-space +// pretty so they wrap nicely in the dl. Returns null for anything we +// can't safely treat as a key/value record. +function parseArgsAsKV(args: string): Array<[string, string]> | null { + const trimmed = args.trim(); + if (!(trimmed.startsWith("{") && trimmed.endsWith("}"))) return null; + try { + const parsed = JSON.parse(trimmed); + if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) { + return null; + } + const entries = Object.entries(parsed as Record); + if (entries.length === 0) return null; + return entries.map(([k, v]) => [ + k, + typeof v === "string" ? v : JSON.stringify(v, null, 2), + ]); + } catch { + return null; + } +} + +// ── ToolCallGroup MDX wrapper ──────────────────────────────────────── +// AC's "Grouped" pattern: wrap N adjacent ToolCalls in a single +// rounded card frame. No header, no toggle — the group exists purely +// to visually associate the calls. Each child
      still +// toggles independently. + +export function ToolCallGroup({ + className, + children, +}: { + className?: string; + children?: React.ReactNode; +}) { + return ( +
      + {children} +
      ); } // ── ToolTree MDX wrapper ───────────────────────────────────────────── -// MDX usage: `…ToolCalls…`. -// The vendored primitive wants explicit Trigger + Content children; the -// wrapper supplies them. +// Grouped tool calls with an explicit header — AC's "Running N tasks +// in parallel" pattern. Children are indented with an L-connector +// spine. Default collapsed. export function ToolTree({ label = "Running tools", - defaultOpen = true, children, }: { label?: string; @@ -158,9 +359,38 @@ export function ToolTree({ children?: React.ReactNode; }) { return ( - - {label} - {children} - +
      + + + + + + {label} + + + +
      *]:relative", + "[&>*]:before:absolute [&>*]:before:left-[-20px] [&>*]:before:top-[15px] [&>*]:before:w-4 [&>*]:before:h-px [&>*]:before:bg-border", + )} + > + {children} +
      +
      ); } diff --git a/src/components/styles.ts b/src/components/styles.ts index 9da6086..1afa3f8 100644 --- a/src/components/styles.ts +++ b/src/components/styles.ts @@ -1,3 +1,3 @@ // AUTO-GENERATED by scripts/embed-css.mjs. Edit src/styles/tailwind.css instead. export const stylesheet = `/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-outline-style:solid;--tw-duration:initial;--tw-content:"";--tw-divide-x-reverse:0}}}@layer theme{:root,:host{--font-sans:"Albert Sans", ui-sans-serif, system-ui, sans-serif;--font-serif:"Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;--font-mono:ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-500:oklch(69.6% .17 162.48);--color-sky-500:oklch(68.5% .169 237.323);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.bc-doc{background:var(--color-background);color:var(--color-foreground);font-family:var(--font-sans);font-synthesis:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:anywhere;max-width:720px;margin:0 auto;padding:3rem 1.5rem 6rem}.bc-doc *,.bc-doc :before,.bc-doc :after{box-sizing:border-box}.bc-doc>h1:first-child,.bc-doc h1{font-family:var(--font-serif);letter-spacing:-.02em;text-wrap:balance;margin:0 0 1rem;font-size:2.5rem;font-weight:300;line-height:1.1}.bc-doc h2{font-family:var(--font-serif);letter-spacing:-.015em;text-wrap:balance;margin:2.5rem 0 1rem;font-size:1.75rem;font-weight:300;line-height:1.2}.bc-doc h3{font-family:var(--font-serif);text-wrap:balance;margin:2rem 0 .75rem;font-size:1.25rem;font-weight:400;line-height:1.3}.bc-doc h4{font-family:var(--font-sans);margin:1.5rem 0 .5rem;font-size:1rem;font-weight:600}.bc-doc p{font-family:var(--font-serif);color:var(--color-foreground);text-wrap:pretty;margin:.75rem 0;font-size:1rem;line-height:1.7}.bc-doc a{color:var(--color-foreground);text-decoration:underline;-webkit-text-decoration-color:var(--color-foreground);-webkit-text-decoration-color:var(--color-foreground);text-decoration-color:var(--color-foreground)}@supports (color:color-mix(in lab, red, red)){.bc-doc a{-webkit-text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent);-webkit-text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent);text-decoration-color:color-mix(in oklch, var(--color-foreground) 30%, transparent)}}.bc-doc a{text-underline-offset:.2em;transition:text-decoration-color .15s}.bc-doc a:hover{-webkit-text-decoration-color:var(--color-foreground);-webkit-text-decoration-color:var(--color-foreground);text-decoration-color:var(--color-foreground)}.bc-doc strong{font-weight:600}.bc-doc em{font-style:italic}.bc-doc hr{border:0;border-top:1px solid var(--color-border);margin:3rem 0}.bc-doc>ul,.bc-doc>ol,.bc-doc :where(p,li)+ul,.bc-doc :where(p,li)+ol{font-family:var(--font-serif);margin:.75rem 0;padding-left:1.5rem;font-size:1rem;line-height:1.7}.bc-doc :is(ul,ol) li{margin:.25rem 0}.bc-doc>ul,.bc-doc :where(p,li)+ul{list-style:outside}.bc-doc>ol,.bc-doc :where(p,li)+ol{list-style:decimal}.bc-doc :not(pre)>code{font-family:var(--font-mono);background:var(--color-muted);font-size:.875em}@supports (color:color-mix(in lab, red, red)){.bc-doc :not(pre)>code{background:color-mix(in oklch, var(--color-muted) 80%, transparent)}}.bc-doc :not(pre)>code{overflow-wrap:anywhere;border-radius:3px;padding:.1em .35em}.bc-doc pre:not([data-slot]){font-family:var(--font-mono);background:var(--color-muted);font-size:.85rem;line-height:1.5}@supports (color:color-mix(in lab, red, red)){.bc-doc pre:not([data-slot]){background:color-mix(in oklch, var(--color-muted) 70%, transparent)}}.bc-doc pre:not([data-slot]){border:1px solid var(--color-border);white-space:pre-wrap;word-break:break-word;border-radius:.5rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.bc-doc pre:not([data-slot]) code{background:0 0;padding:0}.bc-doc blockquote{border-left:2px solid var(--color-border);font-family:var(--font-serif);color:var(--color-foreground);margin:1.5rem 0;padding:0 0 0 1.25rem;font-style:italic}@supports (color:color-mix(in lab, red, red)){.bc-doc blockquote{color:color-mix(in oklch, var(--color-foreground) 85%, transparent)}}.bc-doc table{font-family:var(--font-sans);border-collapse:collapse;width:100%;margin:1rem 0;font-size:.9rem}.bc-doc th,.bc-doc td{border:1px solid var(--color-border);text-align:left;padding:.4rem .7rem}.bc-doc th{background:var(--color-muted);font-weight:600}@supports (color:color-mix(in lab, red, red)){.bc-doc th{background:color-mix(in oklch, var(--color-muted) 50%, transparent)}}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-1{inset:calc(var(--spacing) * 1)}.inset-1\\/2{inset:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\\[6px\\]{top:6px}.-left-\\[26px\\]{left:-26px}.left-0{left:calc(var(--spacing) * 0)}.m-0{margin:calc(var(--spacing) * 0)}.my-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-8{margin-block:calc(var(--spacing) * 8)}.my-10{margin-block:calc(var(--spacing) * 10)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1{width:calc(var(--spacing) * 1);height:calc(var(--spacing) * 1)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.w-fit{width:fit-content}.w-px{width:1px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-bl-lg{border-bottom-left-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-amber-500{border-color:var(--color-amber-500)}.border-emerald-500{border-color:var(--color-emerald-500)}.border-red-500{border-color:var(--color-red-500)}.border-sky-500{border-color:var(--color-sky-500)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-amber-500\\/70{border-left-color:#f99c00b3}@supports (color:color-mix(in lab, red, red)){.border-l-amber-500\\/70{border-left-color:color-mix(in oklab, var(--color-amber-500) 70%, transparent)}}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-emerald-500\\/50{border-left-color:#00bb7f80}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/50{border-left-color:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.border-l-emerald-500\\/70{border-left-color:#00bb7fb3}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/70{border-left-color:color-mix(in oklab, var(--color-emerald-500) 70%, transparent)}}.border-l-red-500{border-left-color:var(--color-red-500)}.border-l-red-500\\/40{border-left-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/40{border-left-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-l-red-500\\/70{border-left-color:#fb2c36b3}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/70{border-left-color:color-mix(in oklab, var(--color-red-500) 70%, transparent)}}.border-l-red-600{border-left-color:var(--color-red-600)}.border-l-red-600\\/80{border-left-color:#e40014cc}@supports (color:color-mix(in lab, red, red)){.border-l-red-600\\/80{border-left-color:color-mix(in oklab, var(--color-red-600) 80%, transparent)}}.border-l-sky-500{border-left-color:var(--color-sky-500)}.border-l-sky-500\\/60{border-left-color:#00a5ef99}@supports (color:color-mix(in lab, red, red)){.border-l-sky-500\\/60{border-left-color:color-mix(in oklab, var(--color-sky-500) 60%, transparent)}}.border-l-sky-500\\/70{border-left-color:#00a5efb3}@supports (color:color-mix(in lab, red, red)){.border-l-sky-500\\/70{border-left-color:color-mix(in oklab, var(--color-sky-500) 70%, transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-red-600\\/15{background-color:#e4001426}@supports (color:color-mix(in lab, red, red)){.bg-red-600\\/15{background-color:color-mix(in oklab, var(--color-red-600) 15%, transparent)}}.bg-sky-500{background-color:var(--color-sky-500)}.bg-sky-500\\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/10{background-color:color-mix(in oklab, var(--color-sky-500) 10%, transparent)}}.p-0{padding:calc(var(--spacing) * 0)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-\\[28px\\]{padding-left:28px}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-emerald-500{color:var(--color-emerald-500)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-sky-500{color:var(--color-sky-500)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\/tool-wrapper\\:opacity-100:is(:where(.group\\/tool-wrapper):hover *){opacity:1}}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-2:before{content:var(--tw-content);top:calc(var(--spacing) * 2)}.before\\:bottom-2:before{content:var(--tw-content);bottom:calc(var(--spacing) * 2)}.before\\:left-\\[6px\\]:before{content:var(--tw-content);left:6px}.before\\:w-px:before{content:var(--tw-content);width:1px}@media (min-width:40rem){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-\\[repeat\\(auto-fit\\,minmax\\(140px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}:where(.sm\\:divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.sm\\:pl-6{padding-left:calc(var(--spacing) * 6)}.sm\\:first\\:pl-0:first-child{padding-left:calc(var(--spacing) * 0)}}@media (min-width:48rem){.md\\:block{display:block}}}.bc-doc{--color-background:oklch(100% 0 0);--color-foreground:oklch(14.5% 0 0);--color-card:oklch(100% 0 0);--color-card-foreground:oklch(14.5% 0 0);--color-popover:oklch(100% 0 0);--color-popover-foreground:oklch(14.5% 0 0);--color-primary:oklch(20.5% 0 0);--color-primary-foreground:oklch(98.5% 0 0);--color-secondary:oklch(97% 0 0);--color-secondary-foreground:oklch(20.5% 0 0);--color-muted:oklch(97% 0 0);--color-muted-foreground:oklch(55.6% 0 0);--color-accent:oklch(97% 0 0);--color-accent-foreground:oklch(20.5% 0 0);--color-destructive:oklch(57.7% .245 27.325);--color-border:oklch(92.2% 0 0);--color-input:oklch(92.2% 0 0);--color-ring:oklch(70.8% 0 0);--radius:.625rem}@media (prefers-color-scheme:dark){.bc-doc{--color-background:oklch(14.5% 0 0);--color-foreground:oklch(98.5% 0 0);--color-card:oklch(20.5% 0 0);--color-card-foreground:oklch(98.5% 0 0);--color-popover:oklch(20.5% 0 0);--color-popover-foreground:oklch(98.5% 0 0);--color-primary:oklch(92.2% 0 0);--color-primary-foreground:oklch(20.5% 0 0);--color-secondary:oklch(26.9% 0 0);--color-secondary-foreground:oklch(98.5% 0 0);--color-muted:oklch(26.9% 0 0);--color-muted-foreground:oklch(70.8% 0 0);--color-accent:oklch(26.9% 0 0);--color-accent-foreground:oklch(98.5% 0 0);--color-destructive:oklch(70.4% .191 22.216);--color-border:oklch(100% 0 0/.1);--color-input:oklch(100% 0 0/.15);--color-ring:oklch(55.6% 0 0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}`; +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-outline-style:solid;--tw-duration:initial;--tw-content:"";--tw-divide-x-reverse:0}}}@layer theme{:root,:host{--font-sans:"Albert Sans", ui-sans-serif, system-ui, sans-serif;--font-serif:"Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;--font-mono:ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--tracking-tight:-.025em;--tracking-wider:.05em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--radius:.625rem;--color-background:oklch(100% 0 0);--color-foreground:oklch(14.5% 0 0);--color-card:oklch(100% 0 0);--color-card-foreground:oklch(14.5% 0 0);--color-popover:oklch(100% 0 0);--color-popover-foreground:oklch(14.5% 0 0);--color-primary:oklch(20.5% 0 0);--color-primary-foreground:oklch(98.5% 0 0);--color-secondary:oklch(97% 0 0);--color-secondary-foreground:oklch(20.5% 0 0);--color-muted:oklch(97% 0 0);--color-muted-foreground:oklch(55.6% 0 0);--color-accent:oklch(97% 0 0);--color-accent-foreground:oklch(20.5% 0 0);--color-destructive:oklch(57.7% .245 27.325);--color-border:oklch(92.2% 0 0);--color-input:oklch(92.2% 0 0);--color-ring:oklch(70.8% 0 0)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}.bc-doc{background:var(--color-background);color:var(--color-foreground);font-family:var(--font-sans);font-synthesis:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:anywhere;max-width:860px;margin:0 auto;padding:3rem 1.5rem 6rem}.bc-doc *,.bc-doc :before,.bc-doc :after{box-sizing:border-box}.bc-doc>h1:first-child,.bc-doc h1{font-family:var(--font-serif);letter-spacing:-.025em;text-wrap:balance;margin:0 0 1rem;font-size:2.25rem;font-weight:300;line-height:1.15}.bc-doc h2{font-family:var(--font-serif);letter-spacing:-.015em;text-wrap:balance;margin:3rem 0 1rem;font-size:1.75rem;font-weight:300;line-height:1.2}.bc-doc h3{font-family:var(--font-sans);text-wrap:balance;margin:2rem 0 .5rem;font-size:1rem;font-weight:600;line-height:1.4}.bc-doc h4{font-family:var(--font-sans);margin:1.5rem 0 .5rem;font-size:1rem;font-weight:600}.bc-doc p{font-family:var(--font-serif);color:var(--color-foreground);text-wrap:pretty;margin:.75rem 0;font-size:1rem;line-height:1.7}.bc-doc a{color:var(--color-muted-foreground);text-decoration:none;transition:color .15s}.bc-doc a:hover{color:var(--color-foreground)}.bc-doc strong{font-weight:600}.bc-doc em{font-style:italic}.bc-doc hr{border:0;border-top:1px solid var(--color-border);margin:3rem 0}.bc-doc :where(ul,ol):not([data-slot]){font-family:var(--font-serif);margin:.75rem 0;padding-left:1.5rem;font-size:1rem;line-height:1.7}.bc-doc :where(ul,ol):not([data-slot]) li{margin:.25rem 0}.bc-doc ul:not([data-slot]){list-style:outside}.bc-doc ol:not([data-slot]){list-style:decimal}.bc-doc :where(p,li,blockquote,h1,h2,h3,h4,td,th) code,.bc-doc [data-slot$=-body] code,.bc-doc [data-slot$=-title] code{font-family:var(--font-mono);color:var(--color-foreground);background:#f5f5f580;font-size:.85em}@supports (color:color-mix(in lab, red, red)){.bc-doc :where(p,li,blockquote,h1,h2,h3,h4,td,th) code,.bc-doc [data-slot$=-body] code,.bc-doc [data-slot$=-title] code{background:color-mix(in oklch, var(--color-muted) 50%, transparent)}}.bc-doc :where(p,li,blockquote,h1,h2,h3,h4,td,th) code,.bc-doc [data-slot$=-body] code,.bc-doc [data-slot$=-title] code{overflow-wrap:anywhere;border-radius:3px;padding:.08em .3em}.bc-doc pre:not([data-slot]){font-family:var(--font-mono);background:#f5f5f5b3;font-size:.85rem;line-height:1.5}@supports (color:color-mix(in lab, red, red)){.bc-doc pre:not([data-slot]){background:color-mix(in oklch, var(--color-muted) 70%, transparent)}}.bc-doc pre:not([data-slot]){border:1px solid var(--color-border);white-space:pre-wrap;word-break:break-word;border-radius:.5rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.bc-doc pre:not([data-slot]) code{background:0 0;padding:0}.bc-doc blockquote{border-left:2px solid var(--color-border);font-family:var(--font-serif);color:#0a0a0ad9;margin:1.5rem 0;padding:0 0 0 1.25rem;font-style:italic}@supports (color:color-mix(in lab, red, red)){.bc-doc blockquote{color:color-mix(in oklch, var(--color-foreground) 85%, transparent)}}.bc-doc table{font-family:var(--font-sans);border-collapse:collapse;width:100%;margin:1rem 0;font-size:.9rem}.bc-doc th,.bc-doc td{border:1px solid var(--color-border);text-align:left;padding:.4rem .7rem}.bc-doc th{background:#f5f5f580;font-weight:600}@supports (color:color-mix(in lab, red, red)){.bc-doc th{background:color-mix(in oklch, var(--color-muted) 50%, transparent)}}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-1{inset:calc(var(--spacing) * 1)}.inset-1\\/2{inset:50%}.top-2{top:calc(var(--spacing) * 2)}.top-\\[6px\\]{top:6px}.top-\\[7px\\]{top:7px}.top-\\[10px\\]{top:10px}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.my-4{margin-block:calc(var(--spacing) * 4)}.my-6{margin-block:calc(var(--spacing) * 6)}.my-8{margin-block:calc(var(--spacing) * 8)}.my-10{margin-block:calc(var(--spacing) * 10)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0{margin-top:calc(var(--spacing) * 0)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-1{width:calc(var(--spacing) * 1);height:calc(var(--spacing) * 1)}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[75\\%\\]{max-width:75%}.max-w-\\[85\\%\\]{max-width:85%}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[max-content_1fr\\]{grid-template-columns:max-content 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-6{row-gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border\\/50>:not(:last-child)){border-color:#e5e5e580}@supports (color:color-mix(in lab, red, red)){:where(.divide-border\\/50>:not(:last-child)){border-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:var(--radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[2px\\]{border-radius:2px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-bl-lg{border-bottom-left-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-amber-500{border-color:var(--color-amber-500)}.border-border{border-color:var(--color-border)}.border-emerald-500{border-color:var(--color-emerald-500)}.border-foreground\\/30{border-color:#0a0a0a4d}@supports (color:color-mix(in lab, red, red)){.border-foreground\\/30{border-color:color-mix(in oklab, var(--color-foreground) 30%, transparent)}}.border-red-500{border-color:var(--color-red-500)}.border-sky-500{border-color:var(--color-sky-500)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-amber-500\\/70{border-left-color:#f99c00b3}@supports (color:color-mix(in lab, red, red)){.border-l-amber-500\\/70{border-left-color:color-mix(in oklab, var(--color-amber-500) 70%, transparent)}}.border-l-border{border-left-color:var(--color-border)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-emerald-500\\/50{border-left-color:#00bb7f80}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/50{border-left-color:color-mix(in oklab, var(--color-emerald-500) 50%, transparent)}}.border-l-emerald-500\\/70{border-left-color:#00bb7fb3}@supports (color:color-mix(in lab, red, red)){.border-l-emerald-500\\/70{border-left-color:color-mix(in oklab, var(--color-emerald-500) 70%, transparent)}}.border-l-red-500{border-left-color:var(--color-red-500)}.border-l-red-500\\/40{border-left-color:#fb2c3666}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/40{border-left-color:color-mix(in oklab, var(--color-red-500) 40%, transparent)}}.border-l-red-500\\/70{border-left-color:#fb2c36b3}@supports (color:color-mix(in lab, red, red)){.border-l-red-500\\/70{border-left-color:color-mix(in oklab, var(--color-red-500) 70%, transparent)}}.border-l-red-600{border-left-color:var(--color-red-600)}.border-l-sky-500{border-left-color:var(--color-sky-500)}.border-l-sky-500\\/60{border-left-color:#00a5ef99}@supports (color:color-mix(in lab, red, red)){.border-l-sky-500\\/60{border-left-color:color-mix(in oklab, var(--color-sky-500) 60%, transparent)}}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-background{background-color:var(--color-background)}.bg-card{background-color:var(--color-card)}.bg-card\\/30{background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.bg-card\\/30{background-color:color-mix(in oklab, var(--color-card) 30%, transparent)}}.bg-card\\/40{background-color:#fff6}@supports (color:color-mix(in lab, red, red)){.bg-card\\/40{background-color:color-mix(in oklab, var(--color-card) 40%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\\/10{background-color:color-mix(in oklab, var(--color-emerald-500) 10%, transparent)}}.bg-emerald-500\\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.bg-emerald-500\\/15{background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.bg-foreground\\/10{background-color:#0a0a0a1a}@supports (color:color-mix(in lab, red, red)){.bg-foreground\\/10{background-color:color-mix(in oklab, var(--color-foreground) 10%, transparent)}}.bg-muted{background-color:var(--color-muted)}.bg-muted-foreground\\/40{background-color:#73737366}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/40{background-color:color-mix(in oklab, var(--color-muted-foreground) 40%, transparent)}}.bg-muted-foreground\\/50{background-color:#73737380}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\\/50{background-color:color-mix(in oklab, var(--color-muted-foreground) 50%, transparent)}}.bg-muted\\/40{background-color:#f5f5f566}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/40{background-color:color-mix(in oklab, var(--color-muted) 40%, transparent)}}.bg-muted\\/50{background-color:#f5f5f580}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/50{background-color:color-mix(in oklab, var(--color-muted) 50%, transparent)}}.bg-muted\\/60{background-color:#f5f5f599}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--color-muted) 60%, transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab, red, red)){.bg-red-500\\/15{background-color:color-mix(in oklab, var(--color-red-500) 15%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-sky-500{background-color:var(--color-sky-500)}.bg-sky-500\\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/10{background-color:color-mix(in oklab, var(--color-sky-500) 10%, transparent)}}.bg-sky-500\\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.bg-sky-500\\/15{background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-7{padding-left:calc(var(--spacing) * 7)}.pl-\\[28px\\]{padding-left:28px}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-500{color:var(--color-amber-500)}.text-destructive{color:var(--color-destructive)}.text-destructive\\/80{color:#e40014cc}@supports (color:color-mix(in lab, red, red)){.text-destructive\\/80{color:color-mix(in oklab, var(--color-destructive) 80%, transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-500{color:var(--color-emerald-500)}.text-foreground{color:var(--color-foreground)}.text-foreground\\/80{color:#0a0a0acc}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/80{color:color-mix(in oklab, var(--color-foreground) 80%, transparent)}}.text-foreground\\/85{color:#0a0a0ad9}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/85{color:color-mix(in oklab, var(--color-foreground) 85%, transparent)}}.text-foreground\\/90{color:#0a0a0ae6}@supports (color:color-mix(in lab, red, red)){.text-foreground\\/90{color:color-mix(in oklab, var(--color-foreground) 90%, transparent)}}.text-muted-foreground{color:var(--color-muted-foreground)}.text-muted-foreground\\/50{color:#73737380}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/50{color:color-mix(in oklab, var(--color-muted-foreground) 50%, transparent)}}.text-muted-foreground\\/60{color:#73737399}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\\/60{color:color-mix(in oklab, var(--color-muted-foreground) 60%, transparent)}}.text-red-400{color:var(--color-red-400)}.text-red-400\\/80{color:#ff6568cc}@supports (color:color-mix(in lab, red, red)){.text-red-400\\/80{color:color-mix(in oklab, var(--color-red-400) 80%, transparent)}}.text-red-400\\/90{color:#ff6568e6}@supports (color:color-mix(in lab, red, red)){.text-red-400\\/90{color:color-mix(in oklab, var(--color-red-400) 90%, transparent)}}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-sky-400{color:var(--color-sky-400)}.text-sky-500{color:var(--color-sky-500)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\/tool-wrapper\\:text-foreground:is(:where(.group\\/tool-wrapper):hover *){color:var(--color-foreground)}.group-hover\\/tool-wrapper\\:opacity-100:is(:where(.group\\/tool-wrapper):hover *){opacity:1}}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-1:before{content:var(--tw-content);top:calc(var(--spacing) * 1)}.before\\:top-2:before{content:var(--tw-content);top:calc(var(--spacing) * 2)}.before\\:bottom-2:before{content:var(--tw-content);bottom:calc(var(--spacing) * 2)}.before\\:bottom-3:before{content:var(--tw-content);bottom:calc(var(--spacing) * 3)}.before\\:left-2:before{content:var(--tw-content);left:calc(var(--spacing) * 2)}.before\\:left-\\[6px\\]:before{content:var(--tw-content);left:6px}.before\\:w-px:before{content:var(--tw-content);width:1px}.before\\:bg-border:before{content:var(--tw-content);background-color:var(--color-border)}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--color-accent)}}@media (min-width:40rem){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:grid-cols-\\[repeat\\(auto-fit\\,minmax\\(140px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}:where(.sm\\:divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.sm\\:divide-border>:not(:last-child)){border-color:var(--color-border)}.sm\\:pl-6{padding-left:calc(var(--spacing) * 6)}.sm\\:first\\:pl-0:first-child{padding-left:calc(var(--spacing) * 0)}}@media (min-width:48rem){.md\\:block{display:block}}.\\[\\&_p\\]\\:m-0 p{margin:calc(var(--spacing) * 0)}.\\[\\&_p\\]\\:font-mono p{font-family:var(--font-mono)}.\\[\\&_p\\]\\:font-sans p{font-family:var(--font-sans)}.\\[\\&_p\\]\\:font-serif p{font-family:var(--font-serif)}.\\[\\&_p\\]\\:text-base p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.\\[\\&_p\\]\\:text-sm p{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.\\[\\&_p\\]\\:text-xs p{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&_p\\+p\\]\\:mt-1\\.5 p+p{margin-top:calc(var(--spacing) * 1.5)}.\\[\\&\\:\\:-webkit-details-marker\\]\\:hidden::-webkit-details-marker{display:none}.\\[\\&\\>\\*\\]\\:relative>*{position:relative}.\\[\\&\\>\\*\\]\\:my-0>*{margin-block:calc(var(--spacing) * 0)}.\\[\\&\\>\\*\\]\\:before\\:absolute>:before{content:var(--tw-content);position:absolute}.\\[\\&\\>\\*\\]\\:before\\:top-\\[15px\\]>:before{content:var(--tw-content);top:15px}.\\[\\&\\>\\*\\]\\:before\\:left-\\[-20px\\]>:before{content:var(--tw-content);left:-20px}.\\[\\&\\>\\*\\]\\:before\\:h-px>:before{content:var(--tw-content);height:1px}.\\[\\&\\>\\*\\]\\:before\\:w-4>:before{content:var(--tw-content);width:calc(var(--spacing) * 4)}.\\[\\&\\>\\*\\]\\:before\\:bg-border>:before{content:var(--tw-content);background-color:var(--color-border)}.\\[\\&\\>\\*\\+\\*\\]\\:mt-2>*+*{margin-top:calc(var(--spacing) * 2)}.\\[\\&\\>\\*\\:first-child\\]\\:mt-0>:first-child{margin-top:calc(var(--spacing) * 0)}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:calc(var(--spacing) * 0)}details[open] .\\[details\\[open\\]_\\&\\]\\:rotate-90{rotate:90deg}}@media (prefers-color-scheme:dark){:root{--color-background:oklch(4% 0 0);--color-foreground:oklch(98.5% 0 0);--color-card:oklch(8% 0 0);--color-card-foreground:oklch(98.5% 0 0);--color-popover:oklch(8% 0 0);--color-popover-foreground:oklch(98.5% 0 0);--color-primary:oklch(92.2% 0 0);--color-primary-foreground:oklch(20.5% 0 0);--color-secondary:oklch(16% 0 0);--color-secondary-foreground:oklch(98.5% 0 0);--color-muted:oklch(16% 0 0);--color-muted-foreground:oklch(65% 0 0);--color-accent:oklch(16% 0 0);--color-accent-foreground:oklch(98.5% 0 0);--color-destructive:oklch(70.4% .191 22.216);--color-border:oklch(100% 0 0/.08);--color-input:oklch(100% 0 0/.12);--color-ring:oklch(55.6% 0 0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes pulse{50%{opacity:.5}}`; diff --git a/src/components/ui/conversation.tsx b/src/components/ui/conversation.tsx new file mode 100644 index 0000000..d74474c --- /dev/null +++ b/src/components/ui/conversation.tsx @@ -0,0 +1,128 @@ +// Conversation patterns — Agentic Craft's messages-&-prose model +// (https://agentic-craft.vercel.app/conversation). +// +// - wraps the whole transcript in a single rounded +// container so it reads as one unit even when other content +// appears nearby. +// - right-aligned bubble, sans, 75% max width +// - left-aligned, no bubble, serif, 85% max +// width — signals "AI-authored prose" +// - centered pill, sans muted — system notices +// ("Agent connected to document repository") +// - small italic "Thinking" indent above an +// assistant message +// +// Markdown inside any message renders normally (our base CSS scopes +// prose styles to

      /

        //etc. so they pick up the right +// typography automatically). + +import * as React from "react"; +import { cn } from "@/lib/utils.js"; + +function Conversation({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
        + {children} +
        + ); +} + +function UserMessage({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
        +
        *]:my-0 [&>*+*]:mt-2 [&_p]:font-sans [&_p]:text-sm [&_p]:m-0", + )} + > + {children} +
        +
        + ); +} + +function AssistantMessage({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
        +
        *:first-child]:mt-0 [&>*:last-child]:mb-0 [&_p]:font-serif [&_p]:text-base", + )} + > + {children} +
        +
        + ); +} + +function SystemMessage({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
        +
        + {children} +
        +
        + ); +} + +function Thinking({ + className, + children = "Thinking", + ...props +}: React.ComponentProps<"div">) { + return ( +
        + {children} +
        + ); +} + +export { Conversation, UserMessage, AssistantMessage, SystemMessage, Thinking }; diff --git a/src/components/ui/finding.tsx b/src/components/ui/finding.tsx index efe01b7..efe80b4 100644 --- a/src/components/ui/finding.tsx +++ b/src/components/ui/finding.tsx @@ -1,25 +1,22 @@ -// Editorial finding card: severity pill + mono code + serif title, with -// a thin coloured left rule. +// Agentic Craft renders findings as plain bulleted prose, not boxed +// cards. Format: `• CODE — title: body`. +// Severity is signalled by a colored dot, not a pill. +// +// A free-standing is wrapped in an
      • + spacing so it can +// be mixed with markdown prose. A `` collection groups them +// in a tight list (the standard MDX form). import * as React from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@/lib/utils.js"; type Severity = "info" | "low" | "medium" | "high" | "critical"; -const sevBar: Record = { - info: "border-l-sky-500/70", - low: "border-l-border", - medium: "border-l-amber-500/70", - high: "border-l-red-500/70", - critical: "border-l-red-600/80", -}; - -const sevPill: Record = { - info: "bg-sky-500/10 text-sky-500", - low: "bg-muted text-muted-foreground", - medium: "bg-amber-500/10 text-amber-500", - high: "bg-red-500/10 text-red-500", - critical: "bg-red-600/15 text-red-600", +const sevDotClass: Record = { + info: "bg-sky-500", + low: "bg-muted-foreground/50", + medium: "bg-amber-500", + high: "bg-red-500", + critical: "bg-red-600", }; function Finding({ @@ -29,54 +26,73 @@ function Finding({ className, children, ...props -}: React.ComponentProps<"article"> & { +}: React.ComponentProps<"div"> & { code?: string; title: string; severity?: Severity; }) { + // Render as
        so a bare outside any + //
          /
            doesn't pick up the browser's default list marker. return ( -
            -
            - {code ? ( + + {code ? ( + <> {code} - - ) : null} -

            - {title} -

            - - {severity} - -
            +
            {" "} + —{" "} + + ) : null} + {title} {children ? ( -
            - {children} -
            + <> + :{" "} + + {children} + + ) : null} -
            +
        + ); +} + +// Optional wrapper — pulls a group of findings into a tighter +// `role="list"` container with less surrounding spacing. +function Findings({ + className, + children, + ...props +}: React.ComponentProps<"div">) { + return ( +
        + {children} +
        ); } -export { Finding }; +export { Finding, Findings }; export type { Severity }; diff --git a/src/components/ui/steps.tsx b/src/components/ui/steps.tsx index b38f2e9..2e9214b 100644 --- a/src/components/ui/steps.tsx +++ b/src/components/ui/steps.tsx @@ -1,31 +1,64 @@ -// Editorial step list: serif title + status pill on the right, bullet -// rule on the left. +// Step list — Agentic Craft plan-card visual frame, but adapted for +// static MDX. AC's pattern uses line-through on "done" steps because +// the card shows live progress; pin authors use status="done" to mean +// "this step is required / verified", not "completed and superseded", +// so we don't strike through. State is signalled by a small colored +// dot plus an optional status pill on the right. import * as React from "react"; -import { cn } from "@/lib/utils"; +import { HugeiconsIcon } from "@hugeicons/react"; +import { TaskDone01Icon } from "@hugeicons/core-free-icons"; +import { cn } from "@/lib/utils.js"; type StepStatus = "todo" | "doing" | "done" | "blocked"; -const statusClass: Record = { - todo: "bg-muted text-muted-foreground", - doing: "bg-sky-500/10 text-sky-500", - done: "bg-emerald-500/10 text-emerald-500", - blocked: "bg-red-500/10 text-red-500", +const dotClass: Record = { + todo: "bg-muted-foreground/40", + doing: "bg-sky-500 animate-pulse", + done: "bg-emerald-500", + blocked: "bg-red-500", +}; + +const pillClass: Record = { + todo: "bg-muted/60 text-muted-foreground", + doing: "bg-sky-500/15 text-sky-400", + done: "bg-emerald-500/15 text-emerald-400", + blocked: "bg-red-500/15 text-red-400", }; function Steps({ + title, className, children, ...props -}: React.ComponentProps<"ol">) { +}: React.ComponentProps<"div"> & { title?: string }) { return ( -
          - {children} -
        + {title ? ( +
        + + {title} +
        + ) : null} +
          + {children} +
        +

    ); } @@ -39,39 +72,31 @@ function Step({ title: string; status?: StepStatus; }) { + const s = status ?? "todo"; return (
  • -
    -
    +
    + {title} -
    + {status ? ( {status} @@ -81,7 +106,7 @@ function Step({ {children ? (
    {children}
    diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index f6991b3..c8479ee 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -7,16 +7,16 @@ /* Webfonts: Source Serif 4 for prose + headings, Albert Sans for UI metadata. */ @import url("https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,500;8..60,600&display=swap"); +/* Theme tokens. Defined in `@theme` so Tailwind v4 generates utilities + * (bg-card, text-foreground, etc) for every token. Dark mode overrides + * cascade via prefers-color-scheme below. Tokens at :root means the + * stylesheet does leak when embedded — pin always serves the full + * document, so that's fine for us. */ @theme { --font-sans: "Albert Sans", ui-sans-serif, system-ui, sans-serif; --font-serif: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif; --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace; -} -/* Theme tokens. Light by default; dark via prefers-color-scheme. Variables - * are scoped to .bc-doc so this stylesheet never leaks into the host page - * when inlined alongside other content. */ -.bc-doc { --color-background: oklch(1 0 0); --color-foreground: oklch(0.145 0 0); --color-card: oklch(1 0 0); @@ -35,28 +35,30 @@ --color-border: oklch(0.922 0 0); --color-input: oklch(0.922 0 0); --color-ring: oklch(0.708 0 0); + --radius: 0.625rem; } @media (prefers-color-scheme: dark) { - .bc-doc { - --color-background: oklch(0.145 0 0); + :root { + /* Match Agentic Craft's near-black background and muted body. */ + --color-background: oklch(0.04 0 0); --color-foreground: oklch(0.985 0 0); - --color-card: oklch(0.205 0 0); + --color-card: oklch(0.08 0 0); --color-card-foreground: oklch(0.985 0 0); - --color-popover: oklch(0.205 0 0); + --color-popover: oklch(0.08 0 0); --color-popover-foreground: oklch(0.985 0 0); --color-primary: oklch(0.922 0 0); --color-primary-foreground: oklch(0.205 0 0); - --color-secondary: oklch(0.269 0 0); + --color-secondary: oklch(0.16 0 0); --color-secondary-foreground: oklch(0.985 0 0); - --color-muted: oklch(0.269 0 0); - --color-muted-foreground: oklch(0.708 0 0); - --color-accent: oklch(0.269 0 0); + --color-muted: oklch(0.16 0 0); + --color-muted-foreground: oklch(0.65 0 0); + --color-accent: oklch(0.16 0 0); --color-accent-foreground: oklch(0.985 0 0); --color-destructive: oklch(0.704 0.191 22.216); - --color-border: oklch(1 0 0 / 10%); - --color-input: oklch(1 0 0 / 15%); + --color-border: oklch(1 0 0 / 8%); + --color-input: oklch(1 0 0 / 12%); --color-ring: oklch(0.556 0 0); } } @@ -69,7 +71,7 @@ font-synthesis: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - max-width: 720px; + max-width: 860px; margin: 0 auto; padding: 3rem 1.5rem 6rem; overflow-wrap: anywhere; @@ -81,13 +83,16 @@ /* Markdown-emitted typography. Components are styled inline with * Tailwind utilities; these rules cover raw

    /

    /

      /etc. that * fall through from plain markdown. */ + /* H1 / H2 use Source Serif 4 light to match Agentic Craft's section + * headings. H3 / H4 use sans-serif for sub-section headings (matches + * AC's pattern of serif-for-major / sans-for-sub). */ .bc-doc > h1:first-child, .bc-doc h1 { font-family: var(--font-serif); font-weight: 300; - font-size: 2.5rem; - line-height: 1.1; - letter-spacing: -0.02em; + font-size: 2.25rem; + line-height: 1.15; + letter-spacing: -0.025em; margin: 0 0 1rem; text-wrap: balance; } @@ -97,15 +102,15 @@ font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.015em; - margin: 2.5rem 0 1rem; + margin: 3rem 0 1rem; text-wrap: balance; } .bc-doc h3 { - font-family: var(--font-serif); - font-weight: 400; - font-size: 1.25rem; - line-height: 1.3; - margin: 2rem 0 .75rem; + font-family: var(--font-sans); + font-weight: 600; + font-size: 1rem; + line-height: 1.4; + margin: 2rem 0 .5rem; text-wrap: balance; } .bc-doc h4 { @@ -123,14 +128,12 @@ text-wrap: pretty; } .bc-doc a { - color: var(--color-foreground); - text-decoration: underline; - text-decoration-color: color-mix(in oklch, var(--color-foreground) 30%, transparent); - text-underline-offset: 0.2em; - transition: text-decoration-color 0.15s ease; + color: var(--color-muted-foreground); + text-decoration: none; + transition: color 0.15s ease; } .bc-doc a:hover { - text-decoration-color: var(--color-foreground); + color: var(--color-foreground); } .bc-doc strong { font-weight: 600; } .bc-doc em { font-style: italic; } @@ -140,27 +143,31 @@ margin: 3rem 0; } - /* Lists in markdown prose */ - .bc-doc > ul, - .bc-doc > ol, - .bc-doc :where(p, li) + ul, - .bc-doc :where(p, li) + ol { + /* Lists in markdown prose. We only style lists that don't carry a + * data-slot — our component-owned
        /
          (Steps, Timeline) own + * their own bullets and padding. Markdown lists nested inside a + * component still inherit serif typography from the component body. */ + .bc-doc :where(ul, ol):not([data-slot]) { font-family: var(--font-serif); font-size: 1rem; line-height: 1.7; padding-left: 1.5rem; margin: .75rem 0; } - .bc-doc :is(ul, ol) li { margin: .25rem 0; } - .bc-doc > ul, .bc-doc :where(p, li) + ul { list-style: disc; } - .bc-doc > ol, .bc-doc :where(p, li) + ol { list-style: decimal; } + .bc-doc :where(ul, ol):not([data-slot]) li { margin: .25rem 0; } + .bc-doc ul:not([data-slot]) { list-style: disc; } + .bc-doc ol:not([data-slot]) { list-style: decimal; } - /* Inline code in markdown prose */ - .bc-doc :not(pre) > code { + /* Inline code in markdown prose. AC uses a subtler mono treatment + * with no pill background — same approach here. */ + .bc-doc :where(p, li, blockquote, h1, h2, h3, h4, td, th) code, + .bc-doc [data-slot$="-body"] code, + .bc-doc [data-slot$="-title"] code { font-family: var(--font-mono); - font-size: 0.875em; - background: color-mix(in oklch, var(--color-muted) 80%, transparent); - padding: 0.1em 0.35em; + font-size: 0.85em; + color: var(--color-foreground); + background: color-mix(in oklch, var(--color-muted) 50%, transparent); + padding: 0.08em 0.3em; border-radius: 3px; overflow-wrap: anywhere; } From d26525b5b51ff5e8c9de4a01c1f255aa801385a9 Mon Sep 17 00:00:00 2001 From: terra tauri Date: Sun, 31 May 2026 07:26:06 -0700 Subject: [PATCH 4/8] feat(manifest): extract component manifest from JSDoc + TS types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each exported component now carries a JSDoc with summary, @category, and @example. scripts/extract-manifest.mjs walks every export via ts-morph, pulls description + type + JSDoc tags + parameter defaults, and emits dist/manifest.json + src/components/manifest.ts. The IIFE bundle exposes the manifest at globalThis.componentManifest so pin can serve it through /api/library at runtime. Type aliases (CalloutType, KPITone, Severity, …) expand to their literal unions in the output so agents reading `pin components` get the actual permitted values, not opaque names. Built-in types (boolean, React.ReactNode) are kept as-is to avoid bloating the output with synthetic unions. Build wire-up: pnpm build:manifest runs first in pnpm build, before the CSS+JS passes. CI catches missing JSDoc because the extractor exits non-zero with a clear pointer at the offending file — no silent fallback to derived metadata. Tests: - manifest.test.ts validates 28 components, Callout shape, no internal primitives leak in - compile.test.ts switched from `bc-*` class checks to data-slot checks (carry-over from the agentic-craft port that hadn't been updated) - vitest.config.ts adds the @/ → src/ alias that vitest needs Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 6 +- pnpm-lock.yaml | 52 +++ scripts/extract-manifest.mjs | 337 ++++++++++++++++ src/bundle.ts | 9 +- src/components/index.tsx | 41 ++ src/components/manifest.ts | 604 +++++++++++++++++++++++++++++ src/components/styles.ts | 2 +- src/components/ui/approval.tsx | 18 + src/components/ui/callout.tsx | 13 + src/components/ui/code.tsx | 16 +- src/components/ui/compare.tsx | 27 +- src/components/ui/conversation.tsx | 50 +++ src/components/ui/diagram.tsx | 16 +- src/components/ui/diff.tsx | 16 + src/components/ui/finding.tsx | 28 +- src/components/ui/kpi.tsx | 23 ++ src/components/ui/quote.tsx | 16 +- src/components/ui/section.tsx | 16 +- src/components/ui/steps.tsx | 31 +- src/components/ui/tag.tsx | 28 +- src/components/ui/timeline.tsx | 25 ++ src/components/ui/tldr.tsx | 12 + test/compile.test.ts | 27 +- test/manifest.test.ts | 45 +++ vitest.config.ts | 10 + 25 files changed, 1442 insertions(+), 26 deletions(-) create mode 100644 scripts/extract-manifest.mjs create mode 100644 src/components/manifest.ts create mode 100644 test/manifest.test.ts create mode 100644 vitest.config.ts diff --git a/package.json b/package.json index d0961fb..9a8e6e4 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,10 @@ ], "scripts": { "build:css": "tailwindcss -i src/styles/tailwind.css -o dist/styles.css --minify && node scripts/embed-css.mjs", + "build:manifest": "node scripts/extract-manifest.mjs", "build:js": "tsup", - "build": "pnpm run build:css && pnpm run build:js", - "dev": "pnpm run build:css && tsup --watch", + "build": "pnpm run build:manifest && pnpm run build:css && pnpm run build:js", + "dev": "pnpm run build:manifest && pnpm run build:css && tsup --watch", "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc --noEmit", @@ -61,6 +62,7 @@ "@types/react": "^19.2.0", "@types/react-dom": "^19.2.0", "tailwindcss": "^4.2.1", + "ts-morph": "^28.0.0", "tsup": "^8.3.5", "typescript": "^5.7.2", "vitest": "^2.1.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96e3cdc..31bd664 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,6 +45,9 @@ importers: tailwindcss: specifier: ^4.2.1 version: 4.3.0 + ts-morph: + specifier: ^28.0.0 + version: 28.0.0 tsup: specifier: ^8.3.5 version: 8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@5.9.3) @@ -697,6 +700,9 @@ packages: resolution: {integrity: sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==} engines: {node: '>= 20'} + '@ts-morph/common@0.29.0': + resolution: {integrity: sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==} + '@types/debug@4.1.13': resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} @@ -794,6 +800,14 @@ packages: bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + balanced-match@4.0.4: + resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} + engines: {node: 18 || 20 || >=22} + + brace-expansion@5.0.6: + resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} + engines: {node: 18 || 20 || >=22} + bundle-require@5.1.0: resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -835,6 +849,9 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} + code-block-writer@13.0.3: + resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==} + collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -1206,6 +1223,10 @@ packages: micromark@4.0.2: resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} + minimatch@10.2.5: + resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} + engines: {node: 18 || 20 || >=22} + mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} @@ -1234,6 +1255,9 @@ packages: parse-entities@4.0.2: resolution: {integrity: sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==} + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} @@ -1420,6 +1444,9 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-morph@28.0.0: + resolution: {integrity: sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g==} + tsup@8.5.1: resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==} engines: {node: '>=18'} @@ -1956,6 +1983,12 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.3.0 '@tailwindcss/oxide-win32-x64-msvc': 4.3.0 + '@ts-morph/common@0.29.0': + dependencies: + minimatch: 10.2.5 + path-browserify: 1.0.1 + tinyglobby: 0.2.16 + '@types/debug@4.1.13': dependencies: '@types/ms': 2.1.0 @@ -2052,6 +2085,12 @@ snapshots: bail@2.0.2: {} + balanced-match@4.0.4: {} + + brace-expansion@5.0.6: + dependencies: + balanced-match: 4.0.4 + bundle-require@5.1.0(esbuild@0.27.7): dependencies: esbuild: 0.27.7 @@ -2085,6 +2124,8 @@ snapshots: clsx@2.1.1: {} + code-block-writer@13.0.3: {} + collapse-white-space@2.1.0: {} comma-separated-tokens@2.0.3: {} @@ -2683,6 +2724,10 @@ snapshots: transitivePeerDependencies: - supports-color + minimatch@10.2.5: + dependencies: + brace-expansion: 5.0.6 + mlly@1.8.2: dependencies: acorn: 8.16.0 @@ -2716,6 +2761,8 @@ snapshots: is-decimal: 2.0.1 is-hexadecimal: 2.0.1 + path-browserify@1.0.1: {} + pathe@1.1.2: {} pathe@2.0.3: {} @@ -2926,6 +2973,11 @@ snapshots: ts-interface-checker@0.1.13: {} + ts-morph@28.0.0: + dependencies: + '@ts-morph/common': 0.29.0 + code-block-writer: 13.0.3 + tsup@8.5.1(jiti@2.7.0)(postcss@8.5.15)(typescript@5.9.3): dependencies: bundle-require: 5.1.0(esbuild@0.27.7) diff --git a/scripts/extract-manifest.mjs b/scripts/extract-manifest.mjs new file mode 100644 index 0000000..cdd340e --- /dev/null +++ b/scripts/extract-manifest.mjs @@ -0,0 +1,337 @@ +#!/usr/bin/env node +// Build-time extractor: walks src/components/{ui/*.tsx,index.tsx}, +// finds every exported component, and emits a manifest of +// { kind: "mdx-component", name, summary, category, spec.props, examples } +// entries into dist/manifest.json + src/components/manifest.ts (so the +// IIFE bundle can ship it via globalThis.componentManifest at runtime). +// +// Convention each component must follow: +// - JSDoc above the function declaration with: +// summary (first paragraph) +// @category +// @example (MDX usage) +// - Inline JSDoc on each property of the props TypeLiteral (the RHS +// of an intersection with React.ComponentProps<...>) for per-prop +// descriptions. +// +// Drift: if the JSDoc is missing or @category is unknown, the script +// fails with a clear pointer at the offending file. There's no silent +// fallback — that's what kept the old hand-curated cheatsheet rotting. + +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { Project, SyntaxKind } from "ts-morph"; + +const __filename = fileURLToPath(import.meta.url); +const ROOT = path.resolve(path.dirname(__filename), ".."); + +const KNOWN_CATEGORIES = new Set([ + "layout", + "emphasis", + "data", + "conversation", + "agent", + "chronological", + "code-media", +]); + +function main() { + const project = new Project({ + tsConfigFilePath: path.join(ROOT, "tsconfig.json"), + skipAddingFilesFromTsConfig: false, + }); + + // The public surface: everything re-exported (or directly exported) + // from src/components/index.tsx. Filtering to that is what keeps + // internal primitives like ToolCallContext out of the manifest. + const indexFile = project.getSourceFileOrThrow( + path.join(ROOT, "src/components/index.tsx"), + ); + const publicExports = collectPublicExports(indexFile); + + const entries = []; + const errors = []; + + for (const { name, declaration } of publicExports) { + if (!isComponentDeclaration(name, declaration)) continue; + try { + entries.push(buildEntry(name, declaration)); + } catch (err) { + errors.push(`${name} (${shortPath(declaration.getSourceFile().getFilePath())}): ${err.message}`); + } + } + + if (errors.length > 0) { + console.error("extract-manifest: failed to extract some components:\n"); + for (const e of errors) console.error(" - " + e); + process.exit(1); + } + + entries.sort((a, b) => a.name.localeCompare(b.name)); + + const distDir = path.join(ROOT, "dist"); + fs.mkdirSync(distDir, { recursive: true }); + const manifestPath = path.join(distDir, "manifest.json"); + fs.writeFileSync(manifestPath, JSON.stringify(entries, null, 2) + "\n"); + + // Also emit a TS file that the IIFE bundle can import. Keeping it + // in src/ means tsup picks it up without a JSON loader. + const tsPath = path.join(ROOT, "src/components/manifest.ts"); + fs.writeFileSync( + tsPath, + "// AUTO-GENERATED by scripts/extract-manifest.mjs. Do not edit by hand.\n" + + "export const componentManifest = " + + JSON.stringify(entries, null, 2) + + " as const;\n", + ); + + console.log( + `extract-manifest: ${entries.length} components → ${shortPath(manifestPath)}`, + ); +} + +// Resolve every named export of src/components/index.tsx to its +// underlying declaration node. Handles both `export { X } from "..."` +// re-exports and inline `export function X(...)` forms. +function collectPublicExports(indexFile) { + const out = []; + for (const [name, declarations] of indexFile.getExportedDeclarations()) { + const decl = declarations[0]; + if (!decl) continue; + out.push({ name, declaration: decl }); + } + return out; +} + +// Names that ARE exported from index.tsx (so technically part of the +// public package API) but aren't usable directly from MDX — they're +// internal building blocks for our MDX-facing wrappers. Documenting +// them in the manifest would only confuse agents. +const INTERNAL_NAMES = new Set([ + "ToolCallPrimitive", + "ToolCallLabel", + "ToolCallContent", + "ToolTreePrimitive", + "ToolTreeTrigger", + "ToolTreeContent", +]); + +function isComponentDeclaration(name, node) { + // We treat as a component anything that's a FunctionDeclaration whose + // name starts with a capital letter and isn't on the internal list. + if (!node) return false; + if (node.getKind() !== SyntaxKind.FunctionDeclaration) return false; + const fnName = node.getName?.(); + if (!fnName || !/^[A-Z]/.test(fnName)) return false; + if (INTERNAL_NAMES.has(name)) return false; + return true; +} + +function buildEntry(name, fn) { + const jsDocs = fn.getJsDocs?.() ?? []; + if (jsDocs.length === 0) { + throw new Error( + "missing JSDoc. Add `/** … @category … @example … */` above the function.", + ); + } + const jsdoc = jsDocs[jsDocs.length - 1]; + + const description = jsdoc.getDescription().trim(); + if (!description) { + throw new Error("JSDoc must have a summary sentence before any @tag."); + } + const summary = firstParagraph(description); + + const category = readTagText(jsdoc, "category"); + if (!category) { + throw new Error("missing @category tag."); + } + if (!KNOWN_CATEGORIES.has(category)) { + throw new Error( + `unknown @category "${category}". Valid: ${[...KNOWN_CATEGORIES].join(", ")}.`, + ); + } + + const examples = jsdoc + .getTags() + .filter((t) => t.getTagName() === "example") + .map((t) => trimExample(t.getCommentText() ?? "")) + .filter(Boolean); + + const props = extractProps(fn); + + return { + kind: "mdx-component", + name, + summary, + category, + spec: { props }, + examples, + }; +} + +function firstParagraph(text) { + const idx = text.indexOf("\n\n"); + const para = (idx === -1 ? text : text.slice(0, idx)).trim(); + // Collapse hard-wraps inside the paragraph so the summary fits on + // one line in the CLI output. + return para.replace(/\s*\n\s*/g, " "); +} + +function readTagText(jsdoc, tagName) { + const tag = jsdoc.getTags().find((t) => t.getTagName() === tagName); + if (!tag) return null; + return (tag.getCommentText() ?? "").trim(); +} + +function trimExample(s) { + // JSDoc strips leading "* " but leaves indentation; normalise it. + const lines = s.split("\n"); + const min = Math.min( + ...lines.filter((l) => l.trim()).map((l) => l.match(/^\s*/)[0].length), + ); + return lines.map((l) => l.slice(min)).join("\n").trim(); +} + +// Pull props out of the function's first parameter type. We only +// document the inline TypeLiteral, which is the RHS of an intersection +// like `React.ComponentProps<"div"> & { foo?: T }`. Anything inherited +// from the HTML attributes side is omitted — it's noise for the +// agent-facing docs. +function extractProps(fn) { + const params = fn.getParameters(); + if (params.length === 0) return []; + const typeNode = params[0].getTypeNode(); + if (!typeNode) return []; + + // Collect defaults from the destructuring pattern. + const defaults = readDestructuringDefaults(params[0]); + + // Find the TypeLiteral somewhere in the type. Common shapes we handle: + // { ... } — bare TypeLiteral + // React.ComponentProps<"x"> & { ... } — intersection + // React.ComponentProps<"x"> — no inline props + const literals = findInlineTypeLiterals(typeNode); + if (literals.length === 0) return []; + + const props = []; + for (const literal of literals) { + for (const member of literal.getProperties()) { + const propName = member.getName(); + const optional = !!member.hasQuestionToken?.(); + // Resolve to expanded text. For type aliases (CalloutType) and + // unions we want the literal text — "info" | "warning" | … + // rather than just "CalloutType". Drop the implicit `| undefined` + // that optional props pick up. + let propType = expandedTypeText(member); + if (optional) { + propType = propType + .replace(/\s*\|\s*undefined\s*$/, "") + .replace(/^undefined\s*\|\s*/, ""); + } + const descTag = member.getJsDocs?.()[0]; + const description = descTag + ? descTag.getDescription().trim() || (descTag.getCommentText?.() ?? "") + : ""; + const def = defaults[propName]; + props.push({ + name: propName, + type: cleanType(propType), + optional, + ...(def !== undefined ? { default: def } : {}), + ...(description ? { description } : {}), + }); + } + } + return props; +} + +function findInlineTypeLiterals(typeNode) { + // Walk the type expression looking for `{ … }` literals. For + // intersections we keep all literals; for everything else we keep + // none unless the node itself is a literal. + const out = []; + function visit(n) { + const k = n.getKind(); + if (k === SyntaxKind.TypeLiteral) { + out.push(n); + return; + } + if (k === SyntaxKind.IntersectionType) { + for (const t of n.getTypeNodes()) visit(t); + return; + } + if (k === SyntaxKind.ParenthesizedType) { + visit(n.getTypeNode()); + return; + } + // TypeReferences (e.g. React.ComponentProps<"div">), unions, + // and bare identifiers don't have inline literals we care about. + } + visit(typeNode); + return out; +} + +function readDestructuringDefaults(param) { + const out = {}; + const name = param.getNameNode(); + if (name.getKind() !== SyntaxKind.ObjectBindingPattern) return out; + for (const el of name.getElements()) { + const init = el.getInitializer?.(); + if (!init) continue; + out[el.getName()] = init.getText(); + } + return out; +} + +// ts-morph's Type#getText() returns the alias name when one exists +// (so `CalloutType` instead of `"info" | "warning" | ...`). Agents +// reading `pin components` need the literal union, since they can't +// look up the alias. But expanding everything turns `boolean` into +// `false | true` and `React.ReactNode` into a 12-arm monster. So: +// expand only when the result is shorter than the unexpanded form, +// or when the alias name is one we know is opaque ("CalloutType", +// "KPITone", etc — anything ending in "Type", "Tone", "Status", +// "Severity", "State", "Color"). Otherwise keep the alias. +function expandedTypeText(node) { + const t = node.getType(); + const raw = cleanType(t.getText(node)); + + if (!t.isUnion()) return raw; + + const expanded = t + .getUnionTypes() + .map((u) => cleanType(u.getText(node))) + .join(" | "); + + // Bare `boolean` shouldn't expand to `false | true`. + if (/^(boolean|boolean \| undefined|undefined \| boolean)$/.test(raw)) { + return raw; + } + + // Expand if the original is an opaque alias OR if the expanded + // form is meaningfully more useful (literal union of strings). + const isOpaqueAlias = /\b[A-Z]\w*(Type|Tone|Status|Severity|State|Color)\b/.test(raw); + const expandedIsAllLiterals = t + .getUnionTypes() + .every((u) => u.isLiteral() || u.isUndefined()); + + if (isOpaqueAlias || (expandedIsAllLiterals && expanded.length < 120)) { + return expanded; + } + return raw; +} + +function cleanType(s) { + // ts-morph returns the resolved type which may include nested + // module imports like `import("…/react").ReactNode`. Strip those for + // readability without changing meaning. + return s.replace(/import\("[^"]+"\)\./g, "").trim(); +} + +function shortPath(p) { + return path.relative(ROOT, p); +} + +main(); diff --git a/src/bundle.ts b/src/bundle.ts index 76bf66c..e3b8682 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -7,8 +7,15 @@ import "./polyfills.js"; import { renderMDX } from "./compile.js"; import { stylesheet } from "./components/styles.js"; +import { componentManifest } from "./components/manifest.js"; -(globalThis as Record).compileMDX = (source: string) => { +const g = globalThis as Record; + +g.compileMDX = (source: string) => { const html = renderMDX(source); return { html, css: stylesheet }; }; + +// Component metadata for pin's library discovery API. Pin runs this +// in v8 at startup, JSON-stringifies the result, and caches it. +g.componentManifest = componentManifest; diff --git a/src/components/index.tsx b/src/components/index.tsx index 224a0fb..22f5755 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -115,6 +115,17 @@ const statusIconClass: Record = { skip: "text-muted-foreground/50", }; +/** + * Single tool invocation row. Collapsible: clicking the row opens + * args + output. Failed calls open by default and gain the "failed ·" + * timing prefix. + * + * @category agent + * @example + * + * ok github.com/bitcomplete/pin/internal/auth 0.418s + * + */ export function ToolCall({ name, label, @@ -325,10 +336,24 @@ function parseArgsAsKV(args: string): Array<[string, string]> | null { // to visually associate the calls. Each child
          still // toggles independently. +/** + * Rounded frame around several adjacent s. Pure visual + * grouping — no header, no shared toggle. For a labelled, collapsible + * parent (e.g. "Running 3 in parallel"), use instead. + * + * @category agent + * @example + * + * + * + * + * + */ export function ToolCallGroup({ className, children, }: { + /** Extra classes; rarely needed. */ className?: string; children?: React.ReactNode; }) { @@ -350,11 +375,27 @@ export function ToolCallGroup({ // in parallel" pattern. Children are indented with an L-connector // spine. Default collapsed. +/** + * Labelled, collapsible group of tool calls — the "Running N in + * parallel" pattern. Header summary at top, L-connectored children + * inside. Use when the calls share a higher-level purpose worth + * naming; for an unlabelled visual frame, use . + * + * @category agent + * @example + * + * + * + * + * + */ export function ToolTree({ label = "Running tools", children, }: { + /** Header shown above the children. */ label?: string; + /** Open by default? Defaults to false. */ defaultOpen?: boolean; children?: React.ReactNode; }) { diff --git a/src/components/manifest.ts b/src/components/manifest.ts new file mode 100644 index 0000000..682e1fc --- /dev/null +++ b/src/components/manifest.ts @@ -0,0 +1,604 @@ +// AUTO-GENERATED by scripts/extract-manifest.mjs. Do not edit by hand. +export const componentManifest = [ + { + "kind": "mdx-component", + "name": "Approval", + "summary": "Snapshot of an approval decision — what was requested, whether it was approved, who decided, when. Static record, not an interactive widget; for that, fold the decision into the surrounding prose.", + "category": "agent", + "spec": { + "props": [ + { + "name": "action", + "type": "string", + "optional": false, + "description": "Short description of what was being approved." + }, + { + "name": "approved", + "type": "boolean", + "optional": true, + "description": "undefined → pending, true → approved, false → denied." + }, + { + "name": "by", + "type": "string", + "optional": true, + "description": "Approver identifier (email, handle)." + }, + { + "name": "at", + "type": "string", + "optional": true, + "description": "Timestamp string." + } + ] + }, + "examples": [ + "" + ] + }, + { + "kind": "mdx-component", + "name": "AssistantMessage", + "summary": "Left-aligned agent turn. Serif body, no bubble, 85% max width. Contains the agent's prose plus any s the turn produced.", + "category": "conversation", + "spec": { + "props": [] + }, + "examples": [ + "\n Found three missing SFRs. Let me list them.\n \n" + ] + }, + { + "kind": "mdx-component", + "name": "Callout", + "summary": "Coloured aside — info / warning / danger / success / note. Use it to surface \"be careful\", \"important\", or \"good to know\" alongside the main text flow.", + "category": "emphasis", + "spec": { + "props": [ + { + "name": "type", + "type": "\"info\" | \"warning\" | \"danger\" | \"success\" | \"note\"", + "optional": true, + "default": "\"info\"", + "description": "Visual tone of the callout." + }, + { + "name": "title", + "type": "string", + "optional": true, + "description": "Optional bold title shown above the body." + } + ] + }, + "examples": [ + "\n Don't merge this on a Friday.\n" + ] + }, + { + "kind": "mdx-component", + "name": "Code", + "summary": "Code block. A fenced markdown block (```lang) renders identically; reach for when you need the `language` attribute set programmatically (e.g. for client-side highlighters that read it).", + "category": "code-media", + "spec": { + "props": [ + { + "name": "language", + "type": "string", + "optional": true, + "description": "Optional language hint (e.g. \"go\", \"ts\")." + } + ] + }, + "examples": [ + "\n func handle(w http.ResponseWriter, r *http.Request) { ... }\n" + ] + }, + { + "kind": "mdx-component", + "name": "Compare", + "summary": "Side-by-side panels for weighing 2-3 options. Each child is an