diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d76e958 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + test: + name: Run Tests (Node.js ${{ matrix.node-version }}) + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20, 22, 24] + + steps: + - name: Checkout Repo + uses: actions/checkout@v5 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: pnpm i + + - name: Install Playwright Browsers + run: pnpm --filter @repo/elements exec playwright install --with-deps chromium + + - name: Run Tests + run: pnpm test diff --git a/.gitignore b/.gitignore index 5d3b519..2ed5fee 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,9 @@ dist-ssr .env .env.* !.env.example + +# Testing +coverage +**/__screenshots__ + +.code-group.md \ No newline at end of file diff --git a/apps/www/content/3.components/3.vibe-coding/web-preview.md b/apps/www/content/3.components/3.vibe-coding/web-preview.md new file mode 100644 index 0000000..ab951b7 --- /dev/null +++ b/apps/www/content/3.components/3.vibe-coding/web-preview.md @@ -0,0 +1,595 @@ +--- +title: Web Preview +description: A composable component for previewing the result of a generated UI, with support for live examples and code display. +icon: lucide:globe +--- + +The `WebPreview` component provides a flexible way to showcase the result of a generated UI component, along with its source code. It is designed for documentation and demo purposes, allowing users to interact with live examples and view the underlying implementation. + +:::ComponentLoader{label="Web Preview" componentName="WebPreview"} +::: + +## Install using CLI + +:::tabs{variant="card"} + ::div{label="ai-elements-vue"} + ```sh + npx ai-elements-vue@latest add web-preview + ``` + :: + ::div{label="shadcn-vue"} + + ```sh + npx shadcn-vue@latest add https://registry.ai-elements-vue.com/web-preview.json + ``` + :: +::: + +## Install Manually +:::code-group +```vue [WebPreview.vue] + + + +``` + +```vue [WebPreviewBody.vue] + + +