+ {children} +
+{agent.rating.toFixed(1) ?? "0.0"}
{StarRatingIcons(agent.rating)}diff --git a/.github/workflows/platform-frontend-ci.yml b/.github/workflows/platform-frontend-ci.yml index 4f729995a869..f4276784cbfa 100644 --- a/.github/workflows/platform-frontend-ci.yml +++ b/.github/workflows/platform-frontend-ci.yml @@ -56,6 +56,30 @@ jobs: run: | yarn type-check + design: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "21" + + - name: Install dependencies + run: | + yarn install --frozen-lockfile + + - name: Run Chromatic + uses: chromaui/action@latest + with: + # ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + workingDir: autogpt_platform/frontend + test: runs-on: ubuntu-latest strategy: diff --git a/autogpt_platform/frontend/.storybook/main.ts b/autogpt_platform/frontend/.storybook/main.ts index 62db72c32018..75b1365a01cf 100644 --- a/autogpt_platform/frontend/.storybook/main.ts +++ b/autogpt_platform/frontend/.storybook/main.ts @@ -9,6 +9,10 @@ const config: StorybookConfig = { "@storybook/addon-essentials", "@storybook/addon-interactions", ], + env: { + NEXT_PUBLIC_SUPABASE_URL: "https://your-project.supabase.co", + NEXT_PUBLIC_SUPABASE_ANON_KEY: "your-anon-key", + }, features: { experimentalRSC: true, }, @@ -16,6 +20,16 @@ const config: StorybookConfig = { name: "@storybook/nextjs", options: {}, }, - staticDirs: ["../public"], + staticDirs: [ + "../public", + { + from: "../node_modules/geist/dist/fonts/geist-sans", + to: "/fonts/geist-sans", + }, + { + from: "../node_modules/geist/dist/fonts/geist-mono", + to: "/fonts/geist-mono", + }, + ], }; export default config; diff --git a/autogpt_platform/frontend/.storybook/preview.ts b/autogpt_platform/frontend/.storybook/preview.ts deleted file mode 100644 index b8bef1a320f4..000000000000 --- a/autogpt_platform/frontend/.storybook/preview.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { Preview } from "@storybook/react"; -import { initialize, mswLoader } from "msw-storybook-addon"; -import "../src/app/globals.css"; - -// Initialize MSW -initialize(); - -const preview: Preview = { - parameters: { - nextjs: { - appDirectory: true, - }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/i, - }, - }, - }, - loaders: [mswLoader], -}; - -export default preview; diff --git a/autogpt_platform/frontend/.storybook/preview.tsx b/autogpt_platform/frontend/.storybook/preview.tsx new file mode 100644 index 000000000000..8b3cab24c27d --- /dev/null +++ b/autogpt_platform/frontend/.storybook/preview.tsx @@ -0,0 +1,61 @@ +import React from "react"; +import type { Preview } from "@storybook/react"; +import { initialize, mswLoader } from "msw-storybook-addon"; +import { Inter, Poppins } from "next/font/google"; +import localFont from "next/font/local"; +import "../src/app/globals.css"; +import { Providers } from "../src/app/providers"; + +const poppins = Poppins({ + subsets: ["latin"], + weight: ["400", "500", "600", "700"], + variable: "--font-poppins", +}); + +const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); + +const GeistSans = localFont({ + src: "../fonts/geist-sans/Geist-Variable.woff2", + variable: "--font-geist-sans", +}); + +const GeistMono = localFont({ + src: "../fonts/geist-mono/GeistMono-Variable.woff2", + variable: "--font-geist-mono", +}); + +// Initialize MSW +initialize(); + +const preview: Preview = { + parameters: { + nextjs: { + appDirectory: true, + }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i, + }, + }, + layout: "fullscreen", + }, + decorators: [ + (Story, context) => { + const mockOptions = context.parameters.mockBackend || {}; + + return ( +
+
About
-Loading...
+ {isLoading ? ( +Loading...
+- Try adjusting your search terms or filters -
++ Try adjusting your search terms or filters +
++ +
Select from the list of agents you currently have, or upload from your local machine.
{cred.id}
+
+ - Manage your account settings and preferences. -
-by
+ + {creator} + ++ Description +
++ {longDescription} +
+ Categories +
++ Version history +
++ Last updated {lastUpdated} +
++ Version {version} +
++
{description}
+
{description}
- {description} +
+ Join a community where your AI creations can inspire, engage,
{" "}
+ and be downloaded by users around the world.
+
{bio}
-+ {children} +
+{agent.rating.toFixed(1) ?? "0.0"}
{StarRatingIcons(agent.rating)}