Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a99e550
Initial plan
Copilot Jan 14, 2026
a7882a4
Add comprehensive Form component with react-hook-form integration
Copilot Jan 14, 2026
e023222
Changes before error encountered
Copilot Jan 14, 2026
b7c1d8f
Add comprehensive documentation for Form component
Copilot Jan 14, 2026
0eb968a
Merge branch 'main' of https://github.com/objectql/objectui into copi…
Copilot Jan 14, 2026
c6942b1
Fix code review issues: Add TypeScript types, fix Tailwind classes, i…
Copilot Jan 14, 2026
f3be632
Minor fix: Remove unused index parameter and add ts-ignore for proces…
Copilot Jan 14, 2026
16d7eca
Fix CI test failure: Add pretest script to build dependencies before …
Copilot Jan 14, 2026
b67d36d
Update pnpm-lock.yaml: Disable autoInstallPeers and clean up dependen…
hotlong Jan 14, 2026
5a6655d
Add tailwindcss-animate plugin and update testing-library/dom dependency
hotlong Jan 14, 2026
e2d75f4
Refactor component registration: Remove redundant 'type' property and…
hotlong Jan 14, 2026
df64a2f
Update package.json
hotlong Jan 14, 2026
3866b65
Enable auto-install of peer dependencies in npm config
hotlong Jan 14, 2026
a76c482
Add permissions section to PR checks workflow
hotlong Jan 14, 2026
0549013
Refactor project structure: update package paths, enhance ESLint conf…
hotlong Jan 14, 2026
b99c0bc
Update start script in package.json and change test environment to ha…
hotlong Jan 14, 2026
04c2070
Update package.json to set module type and modify vitest.config.ts to…
hotlong Jan 14, 2026
6c93e07
feat: add path aliases for components in vitest configuration
hotlong Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Check for build artifacts
run: |
if [ ! -d "packages/protocol/dist" ]; then
if [ ! -d "packages/core/dist" ]; then
echo "Protocol package build failed"
exit 1
fi
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write
issues: write

jobs:
validate:
name: Validate PR
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
28 changes: 28 additions & 0 deletions apps/playground/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
6 changes: 6 additions & 0 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^5.1.1",
"autoprefixer": "^10.4.23",
"eslint": "^9.39.2",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.26",
"globals": "^16.5.0",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.19",
"tailwindcss-animate": "^1.0.7",
"typescript": "~5.9.3",
"typescript-eslint": "^8.53.0",
"vite": "^7.2.4"
}
}
24 changes: 18 additions & 6 deletions apps/playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,34 @@ type ViewportSize = 'desktop' | 'tablet' | 'mobile';
export default function Playground() {
const [selectedExample, setSelectedExample] = useState<ExampleKey>('dashboard');
const [code, setCode] = useState(examples['dashboard']);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [schema, setSchema] = useState<any>(null);
const [jsonError, setJsonError] = useState<string | null>(null);
const [viewportSize, setViewportSize] = useState<ViewportSize>('desktop');
const [copied, setCopied] = useState(false);

// Real-time JSON parsing
useEffect(() => {
const updateSchema = (newCode: string) => {
try {
const parsed = JSON.parse(code);
const parsed = JSON.parse(newCode);
setSchema(parsed);
setJsonError(null);
} catch (e) {
setJsonError((e as Error).message);
// Keep previous schema on error
}
}, [code]);
};

// Initial parse usage
useEffect(() => {
updateSchema(code);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); // Run once on mount

const handleExampleChange = (key: ExampleKey) => {
setSelectedExample(key);
setCode(examples[key]);
const newCode = examples[key];
setCode(newCode);
updateSchema(newCode);
};

const handleCopySchema = async () => {
Expand Down Expand Up @@ -118,7 +126,11 @@ export default function Playground() {
<div className="flex-1 overflow-hidden">
<textarea
value={code}
onChange={(e) => setCode(e.target.value)}
onChange={(e) => {
const val = e.target.value;
setCode(val);
updateSchema(val);
}}
className="w-full h-full p-4 font-mono text-sm resize-none focus:outline-none border-0 bg-background"
spellCheck={false}
style={{
Expand Down
138 changes: 137 additions & 1 deletion apps/playground/src/data/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,142 @@ export const examples = {
]
}`,

'airtable-form': `{
"type": "div",
"className": "max-w-4xl space-y-6",
"body": [
{
"type": "div",
"className": "space-y-2",
"body": [
{
"type": "text",
"content": "Airtable-Style Feature-Complete Form",
"className": "text-3xl font-bold"
},
{
"type": "text",
"content": "A comprehensive form component with validation, multi-column layout, and conditional fields",
"className": "text-muted-foreground"
}
]
},
{
"type": "card",
"className": "shadow-sm",
"body": {
"type": "form",
"className": "p-6",
"submitLabel": "Create Project",
"cancelLabel": "Reset",
"showCancel": true,
"columns": 2,
"validationMode": "onBlur",
"resetOnSubmit": false,
"defaultValues": {
"projectType": "personal",
"priority": "medium",
"notifications": true
},
"fields": [
{
"name": "projectName",
"label": "Project Name",
"type": "input",
"required": true,
"placeholder": "Enter project name",
"validation": {
"minLength": {
"value": 3,
"message": "Project name must be at least 3 characters"
}
}
},
{
"name": "projectType",
"label": "Project Type",
"type": "select",
"required": true,
"options": [
{ "label": "Personal", "value": "personal" },
{ "label": "Team", "value": "team" },
{ "label": "Enterprise", "value": "enterprise" }
]
},
{
"name": "teamSize",
"label": "Team Size",
"type": "input",
"inputType": "number",
"placeholder": "Number of team members",
"condition": {
"field": "projectType",
"in": ["team", "enterprise"]
},
"validation": {
"min": {
"value": 2,
"message": "Team must have at least 2 members"
}
}
},
{
"name": "budget",
"label": "Budget",
"type": "input",
"inputType": "number",
"placeholder": "Project budget",
"condition": {
"field": "projectType",
"equals": "enterprise"
}
},
{
"name": "priority",
"label": "Priority Level",
"type": "select",
"required": true,
"options": [
{ "label": "Low", "value": "low" },
{ "label": "Medium", "value": "medium" },
{ "label": "High", "value": "high" },
{ "label": "Critical", "value": "critical" }
]
},
{
"name": "deadline",
"label": "Deadline",
"type": "input",
"inputType": "date",
"condition": {
"field": "priority",
"in": ["high", "critical"]
}
},
{
"name": "description",
"label": "Project Description",
"type": "textarea",
"placeholder": "Describe your project goals and objectives",
"validation": {
"maxLength": {
"value": 500,
"message": "Description must not exceed 500 characters"
}
}
},
{
"name": "notifications",
"label": "Enable Notifications",
"type": "checkbox",
"description": "Receive updates about project progress"
}
]
}
}
]
}`,

'simple-page': `{
"type": "div",
"className": "space-y-4",
Expand Down Expand Up @@ -733,6 +869,6 @@ export type ExampleKey = keyof typeof examples;
export const exampleCategories = {
'Primitives': ['simple-page', 'input-states', 'button-variants'],
'Layouts': ['grid-layout', 'dashboard', 'tabs-demo'],
'Forms': ['form-demo'],
'Forms': ['form-demo', 'airtable-form'],
'Data Display': ['calendar-view']
};
4 changes: 3 additions & 1 deletion apps/playground/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import tailwindcssAnimate from "tailwindcss-animate";

/** @type {import('tailwindcss').Config} */
export default {
darkMode: ["class"],
Expand Down Expand Up @@ -57,5 +59,5 @@ export default {
}
}
},
plugins: [require("tailwindcss-animate")],
plugins: [tailwindcssAnimate],
}
Loading