// @bun
// src/components/docs/shared/StudioPrompt.tsx
import Link from "@contractspec/lib.ui-link";
import { jsx, jsxs } from "react/jsx-runtime";
function StudioPrompt({
  title = "Want to turn product signals into spec-first deliverables?",
  body = "ContractSpec Studio ingests evidence from meetings, support, analytics, docs, and code, then compiles decisions into spec diffs and task packs.",
  ctaLabel = "Try Studio",
  href = "https://www.contractspec.studio"
}) {
  return /* @__PURE__ */ jsxs("div", {
    className: "card-subtle space-y-3 p-6",
    children: [
      /* @__PURE__ */ jsx("h3", {
        className: "text-lg font-semibold",
        children: title
      }),
      /* @__PURE__ */ jsx("p", {
        className: "text-muted-foreground text-sm",
        children: body
      }),
      /* @__PURE__ */ jsx(Link, {
        href,
        className: "btn-primary",
        children: ctaLabel
      })
    ]
  });
}

// src/components/docs/guides/GuideCIDiffGatingPage.tsx
import { CodeBlock } from "@contractspec/lib.design-system";
import Link2 from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function GuideCIDiffGatingPage() {
  return /* @__PURE__ */ jsxs2("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx2("h1", {
            className: "text-4xl font-bold",
            children: "CI gating with deterministic diffs"
          }),
          /* @__PURE__ */ jsx2("p", {
            className: "text-muted-foreground text-lg",
            children: "Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "card-subtle space-y-4 p-6",
        children: [
          /* @__PURE__ */ jsx2("h2", {
            className: "text-2xl font-bold",
            children: "What you'll build"
          }),
          /* @__PURE__ */ jsxs2("ul", {
            className: "text-muted-foreground space-y-2 text-sm",
            children: [
              /* @__PURE__ */ jsx2("li", {
                children: "CI workflow running ContractSpec validation and drift checks."
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Machine-readable output for PR annotations."
              }),
              /* @__PURE__ */ jsx2("li", {
                children: "Deterministic contract diffs in review."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "space-y-6",
        children: [
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "1) Add the CI workflow"
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground text-sm",
                children: "Copy the template from the CLI package."
              }),
              /* @__PURE__ */ jsx2(CodeBlock, {
                language: "bash",
                filename: "ci-copy",
                code: `cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml`
              }),
              /* @__PURE__ */ jsxs2("p", {
                className: "text-muted-foreground text-sm",
                children: [
                  "Expected output: new workflow file in ",
                  /* @__PURE__ */ jsx2("code", {
                    children: ".github/workflows"
                  }),
                  "."
                ]
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "2) Run CI locally"
              }),
              /* @__PURE__ */ jsx2(CodeBlock, {
                language: "bash",
                filename: "ci-local",
                code: `contractspec ci --format json --check-drift`
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground text-sm",
                children: "Expected output: JSON summary including pass/fail counts and drift status (if configured)."
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "space-y-3",
            children: [
              /* @__PURE__ */ jsx2("h2", {
                className: "text-2xl font-bold",
                children: "3) Add a diff check"
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground text-sm",
                children: "Use the diff command to inspect breaking changes in PRs."
              }),
              /* @__PURE__ */ jsx2(CodeBlock, {
                language: "bash",
                filename: "ci-diff",
                code: `contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking`
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground text-sm",
                children: "Expected output: deterministic diff with breaking change hints."
              })
            ]
          }),
          /* @__PURE__ */ jsxs2("div", {
            className: "card-subtle space-y-3 p-6",
            children: [
              /* @__PURE__ */ jsx2("h3", {
                className: "text-lg font-semibold",
                children: "Example package"
              }),
              /* @__PURE__ */ jsx2("p", {
                className: "text-muted-foreground text-sm",
                children: "The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."
              }),
              /* @__PURE__ */ jsx2(CodeBlock, {
                language: "bash",
                filename: "crm-ci",
                code: `cd packages/examples/crm-pipeline
bun run build
bun run validate`
              })
            ]
          }),
          /* @__PURE__ */ jsx2(StudioPrompt, {
            title: "Need continuous checks tied to outcomes?",
            body: "Studio closes the loop with post-change verification and learning dividends that improve future decisions."
          })
        ]
      }),
      /* @__PURE__ */ jsxs2("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsxs2(Link2, {
            href: "/docs/guides",
            className: "btn-primary",
            children: [
              "Back to guides ",
              /* @__PURE__ */ jsx2(ChevronRight, {
                size: 16
              })
            ]
          }),
          /* @__PURE__ */ jsx2(Link2, {
            href: "/docs",
            className: "btn-ghost",
            children: "Docs home"
          })
        ]
      })
    ]
  });
}
export {
  GuideCIDiffGatingPage
};
