Skip to content

Commit 615c253

Browse files
authored
Updated Playground docs with MUI and Vuetify components (#19)
* feat(examples): add canonical form definition JSONs * feat(examples): add React+MUI example scaffolding * feat(examples): add React+MUI App, componentMap, and definition * feat(examples): add React+MUI field wrappers (text, select, checkbox, radio, switch) * feat(examples): add React+MUI file, textarea, actions, and step progress * feat(examples): add Vue+Vuetify example scaffolding * feat(examples): add Vue+Vuetify App, componentMap, and definition * feat(examples): add Vuetify field wrappers (text, select, checkbox, radio, switch) * feat(examples): add Vuetify file, textarea, actions, and step progress * feat(examples): add vanilla Svelte bring-your-own-rendering example * refactor(docs): add playground loaders and fixtures module * refactor(docs): replace inline playground with modular Sandpack wrapper * chore: remove old playground, gitignore example artifacts * ci: add docs build and example smoke tests * fix(docs): set Sandpack entry for Vuetify plugin registration * feat(docs): add no-library playground section with default HTML rendering * fix(examples): register all Vuetify components for Sandpack compatibility * feat(docs): add MUI/No-library variant toggle per framework section * fix: use pnpm exec instead of npx for docs scripts * style: apply code style rules to playground examples
1 parent 2166f2f commit 615c253

61 files changed

Lines changed: 1728 additions & 230 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,47 @@ jobs:
3535
- run: pnpm --filter @formhaus/core --filter @formhaus/react run test:resolve
3636

3737
- run: pnpm test
38+
39+
docs:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: pnpm/action-setup@v4
46+
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: 22
50+
cache: pnpm
51+
52+
- run: pnpm install --frozen-lockfile
53+
54+
- run: pnpm build
55+
56+
- run: pnpm docs:build
57+
58+
examples:
59+
runs-on: ubuntu-latest
60+
61+
strategy:
62+
matrix:
63+
example: [react-mui, vue-vuetify, vanilla-svelte]
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: pnpm/action-setup@v4
69+
70+
- uses: actions/setup-node@v4
71+
with:
72+
node-version: 22
73+
cache: pnpm
74+
75+
- name: Install example deps
76+
working-directory: examples/${{ matrix.example }}
77+
run: pnpm install --ignore-workspace
78+
79+
- name: Build example
80+
working-directory: examples/${{ matrix.example }}
81+
run: pnpm build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ coverage/
88
storybook-static/
99
docs/.vitepress/cache/
1010
docs/.vitepress/dist/
11+
examples/*/node_modules/
12+
examples/*/pnpm-lock.yaml
13+
examples/*/dist/

docs/.vitepress/components/PlaygroundExamples.vue

Lines changed: 0 additions & 225 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*?raw' {
2+
const content: string;
3+
export default content;
4+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<script setup lang="ts">
2+
defineProps<{ definition: object }>();
3+
</script>
4+
5+
<template>
6+
<details class="fh-definition-panel">
7+
<summary>Form definition</summary>
8+
<pre><code>{{ JSON.stringify(definition, null, 2) }}</code></pre>
9+
</details>
10+
</template>
11+
12+
<style scoped>
13+
.fh-definition-panel {
14+
margin-top: 12px;
15+
border: 1px solid var(--vp-c-border);
16+
border-radius: 8px;
17+
overflow: hidden;
18+
}
19+
.fh-definition-panel summary {
20+
padding: 8px 14px;
21+
font-size: 13px;
22+
font-weight: 500;
23+
color: var(--vp-c-text-2);
24+
cursor: pointer;
25+
background: var(--vp-c-bg-soft);
26+
}
27+
.fh-definition-panel pre {
28+
margin: 0;
29+
padding: 12px 14px;
30+
font-size: 12px;
31+
line-height: 1.5;
32+
overflow-x: auto;
33+
background: var(--vp-c-bg);
34+
}
35+
</style>

0 commit comments

Comments
 (0)