Skip to content

Commit 39f5a21

Browse files
committed
feat: add complex examples for kanban board and data display components
- Introduced a new complex example for a kanban board with tasks and statuses. - Added multiple data display examples including an enterprise data table, a simple data table, and a calendar view. - Implemented forms examples showcasing a user registration form and an Airtable-style form with validation and conditional fields. - Created layouts examples featuring a responsive grid layout and a dashboard with various metrics. - Added primitives examples demonstrating button variants and input states.
1 parent c36462a commit 39f5a21

18 files changed

Lines changed: 1233 additions & 1237 deletions

apps/playground/src/data/examples.ts

Lines changed: 11 additions & 1237 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import kanbanBoard from './complex/kanban-board.json';
2+
3+
export const complex = {
4+
'kanban-board': JSON.stringify(kanbanBoard, null, 2)
5+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"type": "div",
3+
"className": "space-y-4",
4+
"body": [
5+
{
6+
"type": "div",
7+
"className": "space-y-2",
8+
"body": [
9+
{
10+
"type": "text",
11+
"content": "Kanban Board",
12+
"className": "text-2xl font-bold"
13+
},
14+
{
15+
"type": "text",
16+
"content": "Drag and drop kanban board for project management - similar to Trello",
17+
"className": "text-muted-foreground"
18+
}
19+
]
20+
},
21+
{
22+
"type": "kanban",
23+
"className": "h-[600px]",
24+
"columns": [
25+
{ "id": "todo", "title": "To Do", "color": "bg-slate-100" },
26+
{ "id": "in-progress", "title": "In Progress", "color": "bg-blue-50" },
27+
{ "id": "review", "title": "Review", "color": "bg-orange-50" },
28+
{ "id": "done", "title": "Done", "color": "bg-green-50" }
29+
],
30+
"data": [
31+
{
32+
"id": 1,
33+
"title": "Research Competitors",
34+
"description": "Analyze top 3 competitors features and pricing",
35+
"status": "todo",
36+
"priority": "high",
37+
"assignee": "John Doe"
38+
},
39+
{
40+
"id": 2,
41+
"title": "Design System Draft",
42+
"description": "Create initial tokens and core components",
43+
"status": "in-progress",
44+
"priority": "critical",
45+
"assignee": "Jane Smith"
46+
},
47+
{
48+
"id": 3,
49+
"title": "Setup CI/CD Pipeline",
50+
"description": "Configure GitHub Actions for automated testing",
51+
"status": "review",
52+
"priority": "medium",
53+
"assignee": "Bob Johnson"
54+
},
55+
{
56+
"id": 4,
57+
"title": "User Interview Script",
58+
"description": "Prepare questions for user research phase",
59+
"status": "todo",
60+
"priority": "low",
61+
"assignee": "Alice Williams"
62+
},
63+
{
64+
"id": 5,
65+
"title": "Database Schema",
66+
"description": "Finalize database relationships and indexing strategy",
67+
"status": "done",
68+
"priority": "critical",
69+
"assignee": "Charlie Brown"
70+
},
71+
{
72+
"id": 6,
73+
"title": "API Documentation",
74+
"description": "Document all endpoints using OpenAPI spec",
75+
"status": "in-progress",
76+
"priority": "high",
77+
"assignee": "Diana Prince"
78+
}
79+
]
80+
}
81+
]
82+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import enterpriseTable from './data-display/enterprise-table.json';
2+
import dataTableSimple from './data-display/data-table-simple.json';
3+
import calendarView from './data-display/calendar-view.json';
4+
5+
export const dataDisplay = {
6+
'enterprise-table': JSON.stringify(enterpriseTable, null, 2),
7+
'data-table-simple': JSON.stringify(dataTableSimple, null, 2),
8+
'calendar-view': JSON.stringify(calendarView, null, 2)
9+
};
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"type": "div",
3+
"className": "space-y-4",
4+
"body": [
5+
{
6+
"type": "div",
7+
"className": "space-y-2",
8+
"body": [
9+
{
10+
"type": "text",
11+
"content": "Calendar View",
12+
"className": "text-2xl font-bold"
13+
},
14+
{
15+
"type": "text",
16+
"content": "Airtable-style calendar for displaying records as events",
17+
"className": "text-muted-foreground"
18+
}
19+
]
20+
},
21+
{
22+
"type": "calendar-view",
23+
"className": "h-[600px] border rounded-lg",
24+
"view": "month",
25+
"titleField": "title",
26+
"startDateField": "start",
27+
"endDateField": "end",
28+
"colorField": "type",
29+
"colorMapping": {
30+
"meeting": "#3b82f6",
31+
"deadline": "#ef4444",
32+
"event": "#10b981",
33+
"holiday": "#8b5cf6"
34+
},
35+
"data": [
36+
{
37+
"id": 1,
38+
"title": "Team Standup",
39+
"start": "2024-01-01T09:00:00.000Z",
40+
"end": "2024-01-01T09:30:00.000Z",
41+
"type": "meeting",
42+
"allDay": false
43+
},
44+
{
45+
"id": 2,
46+
"title": "Project Launch",
47+
"start": "2024-01-03T00:00:00.000Z",
48+
"type": "deadline",
49+
"allDay": true
50+
},
51+
{
52+
"id": 3,
53+
"title": "Client Meeting",
54+
"start": "2024-01-05T09:00:00.000Z",
55+
"end": "2024-01-05T14:00:00.000Z",
56+
"type": "meeting",
57+
"allDay": false
58+
},
59+
{
60+
"id": 4,
61+
"title": "Team Building Event",
62+
"start": "2024-01-07T00:00:00.000Z",
63+
"end": "2024-01-09T00:00:00.000Z",
64+
"type": "event",
65+
"allDay": true
66+
},
67+
{
68+
"id": 5,
69+
"title": "Code Review",
70+
"start": "2024-01-02T00:00:00.000Z",
71+
"end": "2024-01-02T15:00:00.000Z",
72+
"type": "meeting",
73+
"allDay": false
74+
},
75+
{
76+
"id": 6,
77+
"title": "National Holiday",
78+
"start": "2024-01-10T00:00:00.000Z",
79+
"type": "holiday",
80+
"allDay": true
81+
}
82+
]
83+
}
84+
]
85+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"type": "div",
3+
"className": "space-y-6",
4+
"body": [
5+
{
6+
"type": "div",
7+
"className": "space-y-2",
8+
"body": [
9+
{
10+
"type": "text",
11+
"content": "Simple Data Table",
12+
"className": "text-2xl font-bold"
13+
},
14+
{
15+
"type": "text",
16+
"content": "Minimal configuration with essential features only",
17+
"className": "text-muted-foreground"
18+
}
19+
]
20+
},
21+
{
22+
"type": "data-table",
23+
"pagination": false,
24+
"searchable": false,
25+
"selectable": false,
26+
"sortable": true,
27+
"exportable": false,
28+
"rowActions": false,
29+
"columns": [
30+
{ "header": "Product", "accessorKey": "product" },
31+
{ "header": "Price", "accessorKey": "price" },
32+
{ "header": "Stock", "accessorKey": "stock" },
33+
{ "header": "Category", "accessorKey": "category" }
34+
],
35+
"data": [
36+
{ "product": "Laptop", "price": "$999", "stock": "45", "category": "Electronics" },
37+
{ "product": "Mouse", "price": "$29", "stock": "150", "category": "Accessories" },
38+
{ "product": "Keyboard", "price": "$79", "stock": "89", "category": "Accessories" },
39+
{ "product": "Monitor", "price": "$299", "stock": "32", "category": "Electronics" },
40+
{ "product": "Desk Chair", "price": "$199", "stock": "18", "category": "Furniture" }
41+
]
42+
}
43+
]
44+
}

0 commit comments

Comments
 (0)