robobyte-front-builder 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +65 -0
- package/README.md +57 -0
- package/docs/ReportViewer.md +581 -0
- package/docs/fetchReportData.md +379 -0
- package/docs/printLayout.md +405 -0
- package/package.json +29 -1
- package/training/00-index.md +168 -0
- package/training/01-input.md +144 -0
- package/training/02-checkbox.md +107 -0
- package/training/03-dropdown.md +135 -0
- package/training/04-datepicker.md +139 -0
- package/training/05-radio.md +123 -0
- package/training/06-number.md +133 -0
- package/training/07-textarea.md +114 -0
- package/training/08-richtext.md +112 -0
- package/training/09-tag.md +110 -0
- package/training/10-time.md +107 -0
- package/training/11-toggle.md +108 -0
- package/training/12-signature.md +107 -0
- package/training/13-autocomplete.md +134 -0
- package/training/14-button.md +168 -0
- package/training/15-label.md +138 -0
- package/training/16-header.md +128 -0
- package/training/17-divider.md +96 -0
- package/training/18-image.md +105 -0
- package/training/19-link.md +108 -0
- package/training/20-banner.md +122 -0
- package/training/21-progress-circle.md +101 -0
- package/training/22-progress-line.md +93 -0
- package/training/23-menu.md +139 -0
- package/training/24-popover.md +114 -0
- package/training/25-layout.md +116 -0
- package/training/26-layout-cell.md +143 -0
- package/training/27-card.md +87 -0
- package/training/28-wizard.md +126 -0
- package/training/29-wizard-step.md +92 -0
- package/training/30-repeater.md +123 -0
- package/training/31-dialog.md +131 -0
- package/training/32-breadcrumb.md +121 -0
- package/training/33-dataGrid.md +129 -0
- package/training/34-dataTableViewer.md +115 -0
- package/training/35-reportViewer.md +673 -0
- package/training/36-viewRenderer.md +110 -0
- package/training/37-treeView.md +170 -0
- package/training/38-kpi-metric.md +148 -0
- package/training/39-kpi-trend.md +105 -0
- package/training/40-kpi-badge.md +112 -0
- package/training/41-kpi-statusDot.md +118 -0
- package/training/42-kpi-iconBox.md +114 -0
- package/training/43-kpi-gauge.md +143 -0
- package/training/44-kpi-bulletChart.md +126 -0
- package/training/45-kpi-colorScale.md +143 -0
- package/training/46-kpi-rating.md +125 -0
- package/training/47-kpi-countdown.md +151 -0
- package/training/48-fetchReportData.md +276 -0
- package/training/49-printLayout.md +215 -0
- package/training/examples/01-login-form.json +176 -0
- package/training/examples/02-contact-form.json +141 -0
- package/training/examples/03-kpi-cards-row.json +123 -0
- package/training/examples/04-settings-toggles.json +153 -0
- package/training/examples/05-user-profile-card.json +136 -0
- package/training/examples/06-date-range-filter.json +108 -0
- package/training/examples/07-search-bar-results.json +130 -0
- package/training/examples/08-notification-settings.json +131 -0
- package/training/examples/09-employee-profile-form.json +259 -0
- package/training/examples/10-invoice-form.json +241 -0
- package/training/examples/11-dashboard-overview.json +251 -0
- package/training/examples/12-registration-wizard.json +154 -0
- package/training/examples/13-product-catalog.json +168 -0
- package/training/examples/14-data-table-with-filters.json +180 -0
- package/training/examples/15-tabbed-profile.json +92 -0
- package/training/examples/16-kpi-full-row.json +203 -0
- package/training/examples/17-tree-detail-view.json +139 -0
- package/training/examples/18-employee-management.json +233 -0
- package/training/examples/19-sales-dashboard.json +272 -0
- package/training/examples/20-checkout-wizard.json +225 -0
- package/training/examples/21-analytics-page.json +222 -0
- package/training/examples/22-hr-onboarding.json +222 -0
- package/training/examples/23-document-browser.json +241 -0
- package/training/examples/24-order-management.json +290 -0
- package/training/examples/25-crm-contact-page.json +272 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Component: signature
|
|
2
|
+
|
|
3
|
+
A canvas-based signature pad. Users draw their signature with a mouse or stylus. Value is stored as a base64 PNG data URL.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Value stored as base64 PNG string in `data[key]`. |
|
|
12
|
+
| `label` | expression | Label text shown above the signature canvas. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field required. |
|
|
15
|
+
| `value` | expression | Controlled value (base64 PNG). Pass to pre-fill with existing signature. |
|
|
16
|
+
| `width` | number | Canvas width in pixels. Default: `500`. |
|
|
17
|
+
| `height` | number | Canvas height in pixels. Default: `200`. |
|
|
18
|
+
| `backgroundColor` | text | Canvas background color. Default: `"#ffffff"`. |
|
|
19
|
+
| `penColor` | text | Ink color. Default: `"#000000"`. Accepts any CSS color. |
|
|
20
|
+
| `minWidth` | number | Minimum pen stroke width for thin lines. Default: `0.5`. |
|
|
21
|
+
| `maxWidth` | number | Maximum pen stroke width for thick lines. Default: `2.5`. |
|
|
22
|
+
| `disabled` | boolean | Renders canvas as read-only (no drawing allowed). |
|
|
23
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Props — Style Tab
|
|
28
|
+
|
|
29
|
+
Uses common input style fields.
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Options / Notes |
|
|
32
|
+
|------|------|-----------------|
|
|
33
|
+
| `display` | expression | CSS display. |
|
|
34
|
+
| `width` | expression | Wrapper width. |
|
|
35
|
+
| `margin` | expression | Outer spacing. |
|
|
36
|
+
| `padding` | expression | Inner padding. |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Props — Actions Tab
|
|
41
|
+
|
|
42
|
+
No dedicated action events. Use `onChange` pattern via form submission or a save button.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Use Cases
|
|
47
|
+
|
|
48
|
+
**When to use:**
|
|
49
|
+
- Legal forms, contracts, consent forms.
|
|
50
|
+
- Delivery confirmation signatures.
|
|
51
|
+
- HR onboarding forms.
|
|
52
|
+
- Any scenario requiring a handwritten signature captured digitally.
|
|
53
|
+
|
|
54
|
+
**When NOT to use:**
|
|
55
|
+
- Text-based initials or typed signatures → use `input`.
|
|
56
|
+
- Image upload from file → use an image-upload component.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Schema Examples
|
|
61
|
+
|
|
62
|
+
### Standard signature field
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"type": "signature",
|
|
66
|
+
"props": {
|
|
67
|
+
"key": "customerSignature",
|
|
68
|
+
"label": "Customer Signature",
|
|
69
|
+
"required": true,
|
|
70
|
+
"width": 500,
|
|
71
|
+
"height": 200,
|
|
72
|
+
"backgroundColor": "#f9f9f9",
|
|
73
|
+
"penColor": "#1a237e"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Compact signature pad
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"type": "signature",
|
|
82
|
+
"props": {
|
|
83
|
+
"key": "driverSignature",
|
|
84
|
+
"label": "Driver Signature",
|
|
85
|
+
"width": 360,
|
|
86
|
+
"height": 140,
|
|
87
|
+
"penColor": "#000000",
|
|
88
|
+
"minWidth": 1,
|
|
89
|
+
"maxWidth": 3
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Read-only display of existing signature
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"type": "signature",
|
|
98
|
+
"props": {
|
|
99
|
+
"key": "approvalSignature",
|
|
100
|
+
"label": "Approved By",
|
|
101
|
+
"value": "data.document.approvalSignature",
|
|
102
|
+
"disabled": true,
|
|
103
|
+
"width": 400,
|
|
104
|
+
"height": 160
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Component: autocomplete
|
|
2
|
+
|
|
3
|
+
A searchable select input with async fetch support, grouping, multi-select, and free-text entry. More powerful than `dropdown` for large datasets.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Unique identifier. Value stored in `data[key]`. |
|
|
12
|
+
| `label` | expression | Label text. |
|
|
13
|
+
| `labelPosition` | select | `top` · `left` · `right` · `none` |
|
|
14
|
+
| `required` | boolean | Marks field required. |
|
|
15
|
+
| `placeholder` | text | Hint shown in the search input. |
|
|
16
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
17
|
+
| `disabled` | boolean | Disables the field. |
|
|
18
|
+
| `enabled` | boolean | Enable/disable from an expression. |
|
|
19
|
+
| `fullWidth` | boolean | Stretches to fill container. |
|
|
20
|
+
| `options` | options-editor | Static options list `{ label, value }`. For async, leave empty and use `asyncFetchOptions`. |
|
|
21
|
+
| `isSingle` | boolean | `true` for single-select. `false` (default) for multi-select (value is an array). |
|
|
22
|
+
| `freeSolo` | boolean | Allows users to enter values not in the options list. |
|
|
23
|
+
| `clearable` | boolean | Pressing Escape clears the selection. |
|
|
24
|
+
| `disableCloseOnSelect` | boolean | Keeps the dropdown open after selecting an option (useful for multi-select). |
|
|
25
|
+
| `fetchOnOpen` | boolean | Triggers `asyncFetchOptions` when the dropdown opens. |
|
|
26
|
+
| `labelField` | expression | Field path within each option object to use as the display label, e.g. `"name"`. |
|
|
27
|
+
| `groupByField` | expression | Field path to group options by, e.g. `"department"`. |
|
|
28
|
+
| `targetValue` | expression | Path to extract the stored value from a selected option object, e.g. `"id"`. |
|
|
29
|
+
| `targetValues` | expression | Map of field paths to extract multiple values from the selected option. |
|
|
30
|
+
| `asyncFetchOptions` | expression | Expression/function to fetch options dynamically. Receives the typed search string. |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Props — Style Tab
|
|
35
|
+
|
|
36
|
+
Same as common input style fields.
|
|
37
|
+
|
|
38
|
+
| Prop | Type | Options / Notes |
|
|
39
|
+
|------|------|-----------------|
|
|
40
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` |
|
|
41
|
+
| `width` | expression | Field width. |
|
|
42
|
+
| `margin` | expression | Outer spacing. |
|
|
43
|
+
| `padding` | expression | Inner padding. |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Props — Actions Tab
|
|
48
|
+
|
|
49
|
+
No dedicated actions. Results write to `data[key]` automatically. Use `onChange` wrapper if needed.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Use Cases
|
|
54
|
+
|
|
55
|
+
**When to use:**
|
|
56
|
+
- Large option sets where typing to filter is essential (hundreds of entries).
|
|
57
|
+
- Server-side search/autocomplete: type to fetch matching records from an API.
|
|
58
|
+
- Multi-select with search capability.
|
|
59
|
+
- Grouped options (by category, department, etc.).
|
|
60
|
+
- Fields where user may enter a custom value not in the list (`freeSolo`).
|
|
61
|
+
|
|
62
|
+
**When NOT to use:**
|
|
63
|
+
- Small static list (< 10 items) → use `dropdown` for simplicity.
|
|
64
|
+
- Exact yes/no → use `toggle` or `checkbox`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Schema Examples
|
|
69
|
+
|
|
70
|
+
### Single-select from static list
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"type": "autocomplete",
|
|
74
|
+
"props": {
|
|
75
|
+
"key": "country",
|
|
76
|
+
"label": "Country",
|
|
77
|
+
"isSingle": true,
|
|
78
|
+
"options": "data.countries",
|
|
79
|
+
"labelField": "name",
|
|
80
|
+
"targetValue": "code",
|
|
81
|
+
"placeholder": "Search countries...",
|
|
82
|
+
"fullWidth": true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Async server search
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"type": "autocomplete",
|
|
91
|
+
"props": {
|
|
92
|
+
"key": "userId",
|
|
93
|
+
"label": "Assign To",
|
|
94
|
+
"isSingle": true,
|
|
95
|
+
"fetchOnOpen": true,
|
|
96
|
+
"asyncFetchOptions": "searchUsers",
|
|
97
|
+
"labelField": "fullName",
|
|
98
|
+
"targetValue": "id",
|
|
99
|
+
"placeholder": "Type to search users..."
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Multi-select with groups
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"type": "autocomplete",
|
|
108
|
+
"props": {
|
|
109
|
+
"key": "permissions",
|
|
110
|
+
"label": "Permissions",
|
|
111
|
+
"isSingle": false,
|
|
112
|
+
"options": "data.allPermissions",
|
|
113
|
+
"labelField": "name",
|
|
114
|
+
"groupByField": "module",
|
|
115
|
+
"disableCloseOnSelect": true,
|
|
116
|
+
"fullWidth": true
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Free-text multi with suggestions
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"type": "autocomplete",
|
|
125
|
+
"props": {
|
|
126
|
+
"key": "tags",
|
|
127
|
+
"label": "Tags",
|
|
128
|
+
"isSingle": false,
|
|
129
|
+
"freeSolo": true,
|
|
130
|
+
"options": "data.suggestedTags",
|
|
131
|
+
"placeholder": "Type to add tags"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Component: button
|
|
2
|
+
|
|
3
|
+
A clickable action button. Supports form submission, reset, custom code, icons, and tooltip.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `key` | expression | Optional identifier for targeting or referencing. |
|
|
12
|
+
| `label` | expression | Button text. Can be any expression returning a string. |
|
|
13
|
+
| `variant` | select | `text` — no background. `outlined` — border only. `contained` — filled background. |
|
|
14
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` · `inherit` |
|
|
15
|
+
| `size` | select | `small` · `medium` · `large` |
|
|
16
|
+
| `prefix` | icon | Icon shown before the label (left icon). |
|
|
17
|
+
| `suffix` | icon | Icon shown after the label (right icon). |
|
|
18
|
+
| `tooltip` | expression | Tooltip text shown on hover. |
|
|
19
|
+
| `iconButton` | boolean | `true` renders as a circular icon-only button (no label). Pair with `prefix`. |
|
|
20
|
+
| `disabled` | boolean | Makes the button non-clickable. |
|
|
21
|
+
| `fullWidth` | boolean | Stretches button to 100% of its container. |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Props — Style Tab
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Options / Notes |
|
|
28
|
+
|------|------|-----------------|
|
|
29
|
+
| `background` | expression | CSS background shorthand, e.g. `"linear-gradient(45deg, #FE6B8B, #FF8E53)"`. |
|
|
30
|
+
| `backgroundColor` | expression | Solid background color, e.g. `"#1976d2"`. |
|
|
31
|
+
| `color` | expression | Text/icon color, e.g. `"#ffffff"`. |
|
|
32
|
+
| `borderRadius` | expression | Border radius, e.g. `"8px"` or `"50%"`. |
|
|
33
|
+
| `boxShadow` | expression | Box shadow, e.g. `"0 4px 12px rgba(0,0,0,0.2)"`. |
|
|
34
|
+
| `border` | expression | Full border shorthand, e.g. `"2px solid #1976d2"`. |
|
|
35
|
+
| `borderColor` | expression | Border color only. |
|
|
36
|
+
| `textTransform` | select | `none` · `uppercase` · `lowercase` · `capitalize` |
|
|
37
|
+
| `fontWeight` | expression | Font weight, e.g. `"600"`. |
|
|
38
|
+
| `fontSize` | expression | Font size, e.g. `"14px"`. |
|
|
39
|
+
| `letterSpacing` | expression | Letter spacing, e.g. `"0.05em"`. |
|
|
40
|
+
| `width` | expression | Button width, e.g. `"160px"`. |
|
|
41
|
+
| `height` | expression | Button height. |
|
|
42
|
+
| `padding` | expression | Inner padding override. |
|
|
43
|
+
| `margin` | expression | Outer margin. |
|
|
44
|
+
| `display` | expression | CSS display. |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Props — Actions Tab
|
|
49
|
+
|
|
50
|
+
| Event | Type | Notes |
|
|
51
|
+
|-------|------|-------|
|
|
52
|
+
| `onClick` | action | `submit` — submits the parent form. `reset` — resets all form fields. `custom` — runs custom code. |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Use Cases
|
|
57
|
+
|
|
58
|
+
**When to use:**
|
|
59
|
+
- Form submit/save buttons (`onClick: submit`).
|
|
60
|
+
- Form reset/clear buttons (`onClick: reset`).
|
|
61
|
+
- Navigation triggers: go to next step, open dialog, navigate to another view.
|
|
62
|
+
- API calls: save record, delete, approve.
|
|
63
|
+
- Icon-only action buttons in toolbars (`iconButton: true`).
|
|
64
|
+
|
|
65
|
+
**When NOT to use:**
|
|
66
|
+
- Navigation links → use `link`.
|
|
67
|
+
- Tab switching → use `menu`.
|
|
68
|
+
- Toggle state → use `toggle`.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Schema Examples
|
|
73
|
+
|
|
74
|
+
### Primary submit button
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"type": "button",
|
|
78
|
+
"props": {
|
|
79
|
+
"key": "submitBtn",
|
|
80
|
+
"label": "Save",
|
|
81
|
+
"variant": "contained",
|
|
82
|
+
"color": "primary",
|
|
83
|
+
"fullWidth": true,
|
|
84
|
+
"prefix": "SaveOutlined"
|
|
85
|
+
},
|
|
86
|
+
"actions": {
|
|
87
|
+
"onClick": { "type": "submit" }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Custom action button
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"type": "button",
|
|
96
|
+
"props": {
|
|
97
|
+
"label": "Approve",
|
|
98
|
+
"variant": "contained",
|
|
99
|
+
"color": "success",
|
|
100
|
+
"prefix": "CheckCircleOutlined",
|
|
101
|
+
"tooltip": "Approve this request"
|
|
102
|
+
},
|
|
103
|
+
"actions": {
|
|
104
|
+
"onClick": {
|
|
105
|
+
"type": "custom",
|
|
106
|
+
"code": "approveRequest({ id: data.request.id }); setData({ approved: true })"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Icon-only button
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"type": "button",
|
|
116
|
+
"props": {
|
|
117
|
+
"key": "refreshBtn",
|
|
118
|
+
"iconButton": true,
|
|
119
|
+
"prefix": "RefreshOutlined",
|
|
120
|
+
"tooltip": "Refresh data",
|
|
121
|
+
"color": "primary",
|
|
122
|
+
"size": "small"
|
|
123
|
+
},
|
|
124
|
+
"actions": {
|
|
125
|
+
"onClick": {
|
|
126
|
+
"type": "custom",
|
|
127
|
+
"code": "refreshData()"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Danger / destructive button
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"type": "button",
|
|
137
|
+
"props": {
|
|
138
|
+
"label": "Delete",
|
|
139
|
+
"variant": "outlined",
|
|
140
|
+
"color": "error",
|
|
141
|
+
"prefix": "DeleteOutlined"
|
|
142
|
+
},
|
|
143
|
+
"style": {
|
|
144
|
+
"borderRadius": "4px"
|
|
145
|
+
},
|
|
146
|
+
"actions": {
|
|
147
|
+
"onClick": {
|
|
148
|
+
"type": "custom",
|
|
149
|
+
"code": "openDialog('confirmDelete')"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Reset form button
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"type": "button",
|
|
159
|
+
"props": {
|
|
160
|
+
"label": "Reset",
|
|
161
|
+
"variant": "text",
|
|
162
|
+
"color": "inherit"
|
|
163
|
+
},
|
|
164
|
+
"actions": {
|
|
165
|
+
"onClick": { "type": "reset" }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Component: label
|
|
2
|
+
|
|
3
|
+
A text display element using MUI Typography. Use for body text, captions, subtitles, and data display. Not interactive.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `text` | expression | The text to display. Can be any expression: `data.userName`, `"Static text"`, `data.count + " items"`. |
|
|
12
|
+
| `prefix` | icon | Icon shown before the text. |
|
|
13
|
+
| `suffix` | icon | Icon shown after the text. |
|
|
14
|
+
| `iconSize` | expression | Size of both prefix and suffix icons when `prefix`/`suffix` share a size, e.g. `"20px"`. |
|
|
15
|
+
| `iconColor` | expression | Color of both icons, e.g. `"primary.main"`. |
|
|
16
|
+
| `prefixSize` | expression | Size of prefix icon specifically. |
|
|
17
|
+
| `prefixColor` | expression | Color of prefix icon specifically. |
|
|
18
|
+
| `suffixSize` | expression | Size of suffix icon specifically. |
|
|
19
|
+
| `suffixColor` | expression | Color of suffix icon specifically. |
|
|
20
|
+
| `iconGap` | expression | Gap between icon and text, e.g. `"8px"`. |
|
|
21
|
+
| `variant` | select | `body1` · `body2` · `caption` · `overline` · `subtitle1` · `subtitle2` — MUI Typography variant controlling font size/weight. |
|
|
22
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` · `textPrimary` · `textSecondary` |
|
|
23
|
+
| `align` | select | `left` · `center` · `right` · `justify` |
|
|
24
|
+
| `gutterBottom` | boolean | Adds bottom margin equal to one line-height. |
|
|
25
|
+
| `noWrap` | boolean | Prevents text wrapping; shows ellipsis on overflow. |
|
|
26
|
+
| `paragraph` | boolean | Renders as a `<p>` element with paragraph margins. |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Props — Style Tab
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Options / Notes |
|
|
33
|
+
|------|------|-----------------|
|
|
34
|
+
| `elementStyle` | expression | CSS object override applied to the wrapper element. |
|
|
35
|
+
| `elementCss` | expression | CSS string override applied to the wrapper element. |
|
|
36
|
+
| `display` | expression | CSS display. |
|
|
37
|
+
| `width` | expression | Wrapper width. |
|
|
38
|
+
| `height` | expression | Wrapper height. |
|
|
39
|
+
| `margin` | expression | Outer spacing. |
|
|
40
|
+
| `padding` | expression | Inner padding. |
|
|
41
|
+
| `fontSize` | expression | Font size override, e.g. `"16px"`. |
|
|
42
|
+
| `fontWeight` | expression | Font weight, e.g. `"600"`. |
|
|
43
|
+
| `lineHeight` | expression | Line height, e.g. `"1.5"`. |
|
|
44
|
+
| `letterSpacing` | expression | Letter spacing, e.g. `"0.05em"`. |
|
|
45
|
+
| `textTransform` | expression | CSS text-transform, e.g. `"uppercase"`. |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Props — Actions Tab
|
|
50
|
+
|
|
51
|
+
No actions. Label is display-only. Use `link` or `button` for clickable text.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Use Cases
|
|
56
|
+
|
|
57
|
+
**When to use:**
|
|
58
|
+
- Displaying field values in read-only detail views.
|
|
59
|
+
- Body text, descriptions, helper text.
|
|
60
|
+
- Captions below images or charts.
|
|
61
|
+
- Metadata display: created at, updated by, status text.
|
|
62
|
+
- Small labels with icons (e.g. status indicators).
|
|
63
|
+
|
|
64
|
+
**When NOT to use:**
|
|
65
|
+
- Page/section titles → use `header`.
|
|
66
|
+
- Clickable text → use `link` or `button`.
|
|
67
|
+
- Data that needs formatting (currency, dates) → display through KPI components.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Schema Examples
|
|
72
|
+
|
|
73
|
+
### Simple body text
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"type": "label",
|
|
77
|
+
"props": {
|
|
78
|
+
"text": "Welcome to the dashboard",
|
|
79
|
+
"variant": "body1",
|
|
80
|
+
"color": "textPrimary"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Dynamic value display
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"type": "label",
|
|
89
|
+
"props": {
|
|
90
|
+
"text": "data.user.fullName",
|
|
91
|
+
"variant": "subtitle1",
|
|
92
|
+
"color": "primary",
|
|
93
|
+
"align": "left"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### With prefix icon
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"type": "label",
|
|
102
|
+
"props": {
|
|
103
|
+
"text": "data.record.status",
|
|
104
|
+
"prefix": "CircleOutlined",
|
|
105
|
+
"prefixColor": "success.main",
|
|
106
|
+
"prefixSize": "12px",
|
|
107
|
+
"iconGap": "6px",
|
|
108
|
+
"variant": "body2",
|
|
109
|
+
"color": "textSecondary"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Caption text
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"type": "label",
|
|
118
|
+
"props": {
|
|
119
|
+
"text": "Last updated: data.lastUpdated",
|
|
120
|
+
"variant": "caption",
|
|
121
|
+
"color": "textSecondary",
|
|
122
|
+
"align": "right"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Truncated single line
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"type": "label",
|
|
131
|
+
"props": {
|
|
132
|
+
"text": "data.item.description",
|
|
133
|
+
"variant": "body2",
|
|
134
|
+
"noWrap": true,
|
|
135
|
+
"color": "textSecondary"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Component: header
|
|
2
|
+
|
|
3
|
+
A heading text element using MUI Typography h1–h6 variants. Use for page titles, section headings, and card titles.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Props — Main Tab
|
|
8
|
+
|
|
9
|
+
| Prop | Type | Options / Notes |
|
|
10
|
+
|------|------|-----------------|
|
|
11
|
+
| `text` | expression | The heading text. Can be an expression or static string. |
|
|
12
|
+
| `prefix` | icon | Icon shown before the heading text. |
|
|
13
|
+
| `suffix` | icon | Icon shown after the heading text. |
|
|
14
|
+
| `iconSize` | expression | Size of both icons, e.g. `"24px"`. |
|
|
15
|
+
| `iconColor` | expression | Color of both icons, e.g. `"primary.main"`. |
|
|
16
|
+
| `prefixSize` | expression | Size of prefix icon specifically. |
|
|
17
|
+
| `prefixColor` | expression | Color of prefix icon. |
|
|
18
|
+
| `suffixSize` | expression | Size of suffix icon specifically. |
|
|
19
|
+
| `suffixColor` | expression | Color of suffix icon. |
|
|
20
|
+
| `iconGap` | expression | Gap between icon and text, e.g. `"8px"`. |
|
|
21
|
+
| `variant` | select | `h1` · `h2` · `h3` · `h4` · `h5` · `h6` — Controls visual size/weight. |
|
|
22
|
+
| `component` | select | `h1` · `h2` · `h3` · `h4` · `h5` · `h6` · `div` · `span` — Actual HTML tag rendered. Set independently from `variant` for SEO control. |
|
|
23
|
+
| `color` | select | `default` · `primary` · `secondary` · `error` · `warning` · `info` · `success` · `textPrimary` · `textSecondary` |
|
|
24
|
+
| `align` | select | `left` · `center` · `right` · `justify` |
|
|
25
|
+
| `gutterBottom` | boolean | Adds bottom margin equal to one line-height. |
|
|
26
|
+
| `noWrap` | boolean | Prevents wrapping; shows ellipsis on overflow. |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Props — Style Tab
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Options / Notes |
|
|
33
|
+
|------|------|-----------------|
|
|
34
|
+
| `elementStyle` | expression | CSS object override applied to the wrapper element. |
|
|
35
|
+
| `elementCss` | expression | CSS string override applied to the wrapper element. |
|
|
36
|
+
| `display` | expression | CSS display. |
|
|
37
|
+
| `width` | expression | Wrapper width. |
|
|
38
|
+
| `height` | expression | Wrapper height. |
|
|
39
|
+
| `margin` | expression | Outer spacing. |
|
|
40
|
+
| `padding` | expression | Inner padding. |
|
|
41
|
+
| `fontSize` | expression | Font size override, e.g. `"28px"`. |
|
|
42
|
+
| `fontWeight` | expression | Font weight override, e.g. `"800"`. |
|
|
43
|
+
| `lineHeight` | expression | Line height. |
|
|
44
|
+
| `letterSpacing` | expression | Letter spacing, e.g. `"-0.02em"`. |
|
|
45
|
+
| `textTransform` | expression | CSS text-transform, e.g. `"uppercase"`. |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Props — Actions Tab
|
|
50
|
+
|
|
51
|
+
No actions. Header is display-only.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Use Cases
|
|
56
|
+
|
|
57
|
+
**When to use:**
|
|
58
|
+
- Page title at the top of a view.
|
|
59
|
+
- Section headings to divide content areas.
|
|
60
|
+
- Card/panel titles.
|
|
61
|
+
- Any prominent text that needs h1–h6 semantic weight.
|
|
62
|
+
|
|
63
|
+
**When NOT to use:**
|
|
64
|
+
- Body text or descriptions → use `label`.
|
|
65
|
+
- Clickable heading → use `link` styled with a heading variant.
|
|
66
|
+
- Metric values → use KPI components.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Schema Examples
|
|
71
|
+
|
|
72
|
+
### Page title
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"type": "header",
|
|
76
|
+
"props": {
|
|
77
|
+
"text": "Employee Profile",
|
|
78
|
+
"variant": "h4",
|
|
79
|
+
"component": "h1",
|
|
80
|
+
"color": "textPrimary",
|
|
81
|
+
"gutterBottom": true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Section heading with icon
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"type": "header",
|
|
90
|
+
"props": {
|
|
91
|
+
"text": "Contact Information",
|
|
92
|
+
"variant": "h6",
|
|
93
|
+
"component": "h2",
|
|
94
|
+
"prefix": "ContactMailOutlined",
|
|
95
|
+
"prefixColor": "primary.main",
|
|
96
|
+
"iconGap": "8px",
|
|
97
|
+
"color": "primary"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Dynamic heading from data
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"type": "header",
|
|
106
|
+
"props": {
|
|
107
|
+
"text": "data.project.name",
|
|
108
|
+
"variant": "h5",
|
|
109
|
+
"component": "h2",
|
|
110
|
+
"align": "center",
|
|
111
|
+
"color": "textPrimary"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Centered dashboard title
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"type": "header",
|
|
120
|
+
"props": {
|
|
121
|
+
"text": "Sales Dashboard",
|
|
122
|
+
"variant": "h3",
|
|
123
|
+
"component": "h1",
|
|
124
|
+
"align": "center",
|
|
125
|
+
"color": "primary"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|