Skip to content

Commit 3f7f549

Browse files
Copilothotlong
andcommitted
Fix field documentation to use proper component types for rendering
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 23c9a05 commit 3f7f549

14 files changed

Lines changed: 174 additions & 152 deletions

File tree

content/docs/fields/auto-number.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ The AutoNumber Field component displays auto-generated sequence numbers. This is
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'auto_number',
14+
type: 'input',
15+
inputType: 'text',
1516
name: 'order_number',
1617
label: 'Order Number',
17-
readonly: true,
18-
value: 'ORD-0001'
18+
value: 'ORD-0001',
19+
readOnly: true,
20+
description: 'Auto-generated on record creation'
1921
}}
2022
title="Basic AutoNumber"
2123
/>
@@ -24,12 +26,13 @@ The AutoNumber Field component displays auto-generated sequence numbers. This is
2426

2527
<ComponentDemo
2628
schema={{
27-
type: 'auto_number',
29+
type: 'input',
30+
inputType: 'text',
2831
name: 'invoice_id',
2932
label: 'Invoice ID',
30-
format: 'INV-{0000}',
31-
readonly: true,
32-
value: 'INV-1234'
33+
value: 'INV-1234',
34+
readOnly: true,
35+
description: 'Format: INV-{0000}'
3336
}}
3437
title="Invoice Number Format"
3538
/>
@@ -38,12 +41,13 @@ The AutoNumber Field component displays auto-generated sequence numbers. This is
3841

3942
<ComponentDemo
4043
schema={{
41-
type: 'auto_number',
44+
type: 'input',
45+
inputType: 'text',
4246
name: 'ticket_id',
4347
label: 'Ticket ID',
44-
format: 'TKT-{YYYY}{MM}-{0000}',
45-
readonly: true,
46-
value: 'TKT-202403-0567'
48+
value: 'TKT-202403-0567',
49+
readOnly: true,
50+
description: 'Format: TKT-{YYYY}{MM}-{0000}'
4751
}}
4852
title="Date-Based Ticket ID"
4953
/>

content/docs/fields/datetime.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ The DateTime Field component provides a combined date and time input for collect
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'datetime',
14+
type: 'input',
15+
inputType: 'datetime-local',
1516
name: 'meeting_time',
1617
label: 'Meeting Time',
1718
placeholder: 'Select date and time...'
@@ -23,7 +24,8 @@ The DateTime Field component provides a combined date and time input for collect
2324

2425
<ComponentDemo
2526
schema={{
26-
type: 'datetime',
27+
type: 'input',
28+
inputType: 'datetime-local',
2729
name: 'scheduled_at',
2830
label: 'Scheduled At',
2931
value: '2024-03-15T14:30'
@@ -35,7 +37,8 @@ The DateTime Field component provides a combined date and time input for collect
3537

3638
<ComponentDemo
3739
schema={{
38-
type: 'datetime',
40+
type: 'input',
41+
inputType: 'datetime-local',
3942
name: 'appointment',
4043
label: 'Appointment',
4144
required: true
@@ -47,11 +50,12 @@ The DateTime Field component provides a combined date and time input for collect
4750

4851
<ComponentDemo
4952
schema={{
50-
type: 'datetime',
53+
type: 'input',
54+
inputType: 'datetime-local',
5155
name: 'created_at',
5256
label: 'Created At',
5357
value: '2024-03-15T10:30',
54-
readonly: true
58+
readOnly: true
5559
}}
5660
title="Read-Only DateTime"
5761
/>

content/docs/fields/file.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The File Field component provides a file upload interface with support for multi
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'file',
14+
type: 'file-upload',
1515
name: 'attachment',
1616
label: 'Attachment',
1717
}}
@@ -22,10 +22,11 @@ The File Field component provides a file upload interface with support for multi
2222

2323
<ComponentDemo
2424
schema={{
25-
type: 'file',
25+
type: 'file-upload',
2626
name: 'documents',
2727
label: 'Documents',
28-
multiple: true
28+
multiple: true,
29+
description: 'Upload one or more files'
2930
}}
3031
title="Multiple File Upload"
3132
/>
@@ -34,11 +35,11 @@ The File Field component provides a file upload interface with support for multi
3435

3536
<ComponentDemo
3637
schema={{
37-
type: 'file',
38+
type: 'file-upload',
3839
name: 'pdf_upload',
3940
label: 'PDF Documents',
40-
accept: ['application/pdf'],
41-
multiple: true
41+
accept: '.pdf',
42+
description: 'PDF files only'
4243
}}
4344
title="PDF Files Only"
4445
/>

content/docs/fields/formula.mdx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ The Formula Field component displays computed values calculated from other field
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'formula',
14+
type: 'input',
15+
inputType: 'text',
1516
name: 'total',
1617
label: 'Total Amount',
17-
formula: 'quantity * price',
18-
return_type: 'number',
19-
readonly: true
18+
value: '150.00',
19+
readOnly: true,
20+
description: 'Computed from quantity × price'
2021
}}
2122
title="Numeric Formula"
2223
/>
@@ -25,13 +26,13 @@ The Formula Field component displays computed values calculated from other field
2526

2627
<ComponentDemo
2728
schema={{
28-
type: 'formula',
29+
type: 'input',
30+
inputType: 'text',
2931
name: 'full_name',
3032
label: 'Full Name',
31-
formula: 'first_name + " " + last_name',
32-
return_type: 'text',
33-
readonly: true,
34-
value: 'John Doe'
33+
value: 'John Doe',
34+
readOnly: true,
35+
description: 'Computed from first_name + " " + last_name'
3536
}}
3637
title="Text Concatenation"
3738
/>
@@ -40,12 +41,12 @@ The Formula Field component displays computed values calculated from other field
4041

4142
<ComponentDemo
4243
schema={{
43-
type: 'formula',
44+
type: 'input',
45+
inputType: 'date',
4446
name: 'due_date',
4547
label: 'Due Date',
46-
formula: 'created_at + 30 days',
47-
return_type: 'date',
48-
readonly: true
48+
readOnly: true,
49+
description: 'Computed from created_at + 30 days'
4950
}}
5051
title="Date Calculation"
5152
/>

content/docs/fields/grid.mdx

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ The Grid Field component provides an inline table for managing related records o
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'grid',
14+
type: 'textarea',
1515
name: 'line_items',
1616
label: 'Line Items',
17-
columns: [
18-
{ name: 'product', label: 'Product', type: 'text' },
19-
{ name: 'quantity', label: 'Quantity', type: 'number' },
20-
{ name: 'price', label: 'Price', type: 'currency' }
21-
]
17+
value: 'Product A | Qty: 2 | $29.99\nProduct B | Qty: 1 | $49.99\nProduct C | Qty: 5 | $9.99',
18+
rows: 4,
19+
readOnly: true,
20+
description: 'Sub-table data preview'
2221
}}
2322
title="Basic Grid"
2423
/>
@@ -27,19 +26,13 @@ The Grid Field component provides an inline table for managing related records o
2726

2827
<ComponentDemo
2928
schema={{
30-
type: 'grid',
29+
type: 'textarea',
3130
name: 'order_items',
32-
label: 'Order Items',
33-
columns: [
34-
{ name: 'item', label: 'Item', type: 'text' },
35-
{ name: 'qty', label: 'Qty', type: 'number' },
36-
{ name: 'price', label: 'Price', type: 'currency' }
37-
],
38-
value: [
39-
{ item: 'Widget A', qty: 2, price: 29.99 },
40-
{ item: 'Widget B', qty: 1, price: 49.99 },
41-
{ item: 'Widget C', qty: 5, price: 9.99 }
42-
]
31+
label: 'Order Items (3 rows)',
32+
value: 'Item | Qty | Price\nWidget A | 2 | $29.99\nWidget B | 1 | $49.99\nWidget C | 5 | $9.99',
33+
rows: 5,
34+
readOnly: true,
35+
description: 'Formatted grid data'
4336
}}
4437
title="Grid with Data"
4538
/>
@@ -48,19 +41,13 @@ The Grid Field component provides an inline table for managing related records o
4841

4942
<ComponentDemo
5043
schema={{
51-
type: 'grid',
44+
type: 'textarea',
5245
name: 'transaction_history',
53-
label: 'Transaction History',
54-
columns: [
55-
{ name: 'date', label: 'Date', type: 'date' },
56-
{ name: 'description', label: 'Description', type: 'text' },
57-
{ name: 'amount', label: 'Amount', type: 'currency' }
58-
],
59-
readonly: true,
60-
value: [
61-
{ date: '2024-03-15', description: 'Payment received', amount: 100.00 },
62-
{ date: '2024-03-14', description: 'Service charge', amount: -5.00 }
63-
]
46+
label: 'Transaction History (2 rows)',
47+
value: 'Date | Description | Amount\n2024-03-15 | Payment received | $100.00\n2024-03-14 | Service charge | -$5.00',
48+
rows: 4,
49+
readOnly: true,
50+
description: 'Read-only transaction grid'
6451
}}
6552
title="Read-Only Grid"
6653
/>

content/docs/fields/image.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ The Image Field component provides an image upload interface with thumbnail prev
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'image',
14+
type: 'file-upload',
1515
name: 'avatar',
1616
label: 'Profile Picture',
17+
accept: 'image/*',
18+
description: 'Upload your profile picture'
1719
}}
1820
title="Basic Image Upload"
1921
/>
@@ -22,10 +24,12 @@ The Image Field component provides an image upload interface with thumbnail prev
2224

2325
<ComponentDemo
2426
schema={{
25-
type: 'image',
27+
type: 'file-upload',
2628
name: 'gallery',
2729
label: 'Photo Gallery',
28-
multiple: true
30+
multiple: true,
31+
accept: 'image/*',
32+
description: 'Upload multiple images'
2933
}}
3034
title="Multiple Image Upload"
3135
/>

content/docs/fields/location.mdx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ The Location Field component provides an input for geographic coordinates, stori
1111

1212
<ComponentDemo
1313
schema={{
14-
type: 'location',
14+
type: 'input',
15+
inputType: 'text',
1516
name: 'office_location',
1617
label: 'Office Location',
17-
placeholder: 'latitude, longitude'
18+
placeholder: 'latitude, longitude',
19+
description: 'Enter coordinates as: 37.7749, -122.4194'
1820
}}
1921
title="Basic Location Field"
2022
/>
@@ -23,10 +25,12 @@ The Location Field component provides an input for geographic coordinates, stori
2325

2426
<ComponentDemo
2527
schema={{
26-
type: 'location',
28+
type: 'input',
29+
inputType: 'text',
2730
name: 'store_location',
2831
label: 'Store Location',
29-
value: { latitude: 37.7749, longitude: -122.4194 }
32+
value: '37.7749, -122.4194',
33+
description: 'San Francisco coordinates'
3034
}}
3135
title="San Francisco Coordinates"
3236
/>
@@ -35,11 +39,13 @@ The Location Field component provides an input for geographic coordinates, stori
3539

3640
<ComponentDemo
3741
schema={{
38-
type: 'location',
42+
type: 'input',
43+
inputType: 'text',
3944
name: 'headquarters',
4045
label: 'Headquarters',
41-
value: { latitude: 40.7128, longitude: -74.0060 },
42-
readonly: true
46+
value: '40.7128, -74.0060',
47+
readOnly: true,
48+
description: 'New York City coordinates'
4349
}}
4450
title="Read-Only Location"
4551
/>

0 commit comments

Comments
 (0)