diff --git a/package.json b/package.json index fe1c304fa3..665013e665 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "@babel/preset-typescript": "^7.24.1", "@next/eslint-plugin-next": "^14.1.0", "@playwright/test": "^1.44.1", + "@radix-ui/colors": "^3.0.0", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.10", "@types/is-ci": "^3.0.4", diff --git a/packages/ui/static-bundle/astro.config.mjs b/packages/ui/static-bundle/astro.config.mjs index f9123fed1b..7e1798ce2a 100644 --- a/packages/ui/static-bundle/astro.config.mjs +++ b/packages/ui/static-bundle/astro.config.mjs @@ -5,5 +5,10 @@ import tailwind from "@astrojs/tailwind"; // https://astro.build/config export default defineConfig({ + vite: { + build: { + minify: false, + }, + }, integrations: [react(), tailwind()], }); diff --git a/packages/ui/static-bundle/package.json b/packages/ui/static-bundle/package.json index dd5d8b341b..84786073e9 100644 --- a/packages/ui/static-bundle/package.json +++ b/packages/ui/static-bundle/package.json @@ -14,9 +14,11 @@ "@fern-api/fdr-sdk": "workspace:*", "@fern-ui/components": "workspace:*", "@fern-ui/react-commons": "workspace:*", + "@fern-ui/ui": "workspace:*", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "astro": "^4.10.1", + "clsx": "^2.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", "tailwindcss": "^3.4.4" diff --git a/packages/ui/static-bundle/src/components/EndpointUrl.tsx b/packages/ui/static-bundle/src/components/EndpointUrl.tsx index b050fa3695..67f28e1a3d 100644 --- a/packages/ui/static-bundle/src/components/EndpointUrl.tsx +++ b/packages/ui/static-bundle/src/components/EndpointUrl.tsx @@ -8,15 +8,17 @@ export const EndpointUrl: React.FC<{ const { copyToClipboard, wasJustCopied } = useCopyToClipboard(endpoint.slug); return ( - -
- {endpoint.method} -
{endpoint.slug}
-
-
+
+ +
+ {endpoint.method} +
{endpoint.slug}
+
+
+
); }; diff --git a/packages/ui/static-bundle/src/pages/[...path].astro b/packages/ui/static-bundle/src/pages/[...path].astro index 6e03eb5ef2..facc776940 100644 --- a/packages/ui/static-bundle/src/pages/[...path].astro +++ b/packages/ui/static-bundle/src/pages/[...path].astro @@ -1,12 +1,15 @@ --- import { FernNavigation } from "@fern-api/fdr-sdk"; import { NodeCollector } from "@fern-api/fdr-sdk/navigation"; +import { getColorVariables } from "@fern-ui/ui/src/next-app/utils/getColorVariables"; import type { GetStaticPaths } from "astro"; +import cn from "clsx"; import DocsMainContent from "../components/DocsMainContent.astro"; -import { getRoot } from "../utils"; +import { getDocs } from "../utils"; export const getStaticPaths = (async () => { - const root = await getRoot("gemini.ferndocs.com"); + const docs = await getDocs("gemini.ferndocs.com"); + const root = FernNavigation.utils.convertLoadDocsForUrlResponse(docs); return NodeCollector.collect(root) .getPageSlugs() .map((path) => { @@ -18,7 +21,8 @@ export const getStaticPaths = (async () => { const { path } = Astro.params; -const root = await getRoot("gemini.ferndocs.com"); +const docs = await getDocs("gemini.ferndocs.com"); +const root = FernNavigation.utils.convertLoadDocsForUrlResponse(docs); const node = FernNavigation.utils.findNode(root, path.split("/")); if (node.type === "notFound") { @@ -28,15 +32,40 @@ if (node.type === "notFound") { if (node.type === "redirect") { return Astro.redirect(node.redirect); } + +const colorVariables = getColorVariables( + { + dark: undefined, + light: undefined, + }, + docs.definition.filesV2 +); --- {node.node.title} + -