@docyrus/docyrus 0.0.30 → 0.0.32

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.
Files changed (30) hide show
  1. package/agent-loader.js +36 -25
  2. package/agent-loader.js.map +4 -4
  3. package/main.js +4 -4
  4. package/main.js.map +1 -1
  5. package/package.json +3 -3
  6. package/resources/pi-agent/extensions/docyrus-web-browser.ts +31 -0
  7. package/resources/pi-agent/shared/docyrusWebBrowserProtocol.ts +169 -0
  8. package/resources/pi-agent/skills/diffity-diff/SKILL.md +1 -1
  9. package/resources/pi-agent/skills/diffity-resolve/SKILL.md +4 -4
  10. package/resources/pi-agent/skills/diffity-review/SKILL.md +5 -4
  11. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +197 -0
  12. package/resources/pi-agent/skills/docyrus-api-dev/references/acl-endpoints-frontend.md +295 -0
  13. package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +349 -0
  14. package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +298 -0
  15. package/resources/pi-agent/skills/docyrus-api-dev/references/data-source-query-guide.md +2063 -0
  16. package/resources/pi-agent/skills/docyrus-api-dev/references/formula-design-guide-llm.md +312 -0
  17. package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +592 -0
  18. package/resources/pi-agent/skills/docyrus-app-dev-react/SKILL.md +361 -0
  19. package/resources/pi-agent/skills/docyrus-app-dev-react/references/README.md +29 -0
  20. package/resources/pi-agent/skills/docyrus-app-dev-react/references/api-client-and-auth.md +326 -0
  21. package/resources/pi-agent/skills/docyrus-app-dev-react/references/collections-and-patterns.md +353 -0
  22. package/resources/pi-agent/skills/docyrus-app-dev-react/references/component-selection-guide.md +619 -0
  23. package/resources/pi-agent/skills/docyrus-app-dev-react/references/icon-usage-guide.md +463 -0
  24. package/resources/pi-agent/skills/docyrus-app-dev-react/references/preferred-components-catalog.md +242 -0
  25. package/resources/pi-agent/skills/docyrus-platform/SKILL.md +2 -2
  26. package/resources/pi-agent/skills/docyrus-platform/references/auth-and-multi-tenancy.md +9 -1
  27. package/resources/pi-agent/skills/docyrus-platform/references/developer-tools.md +3 -2
  28. package/server-loader.js +328 -87
  29. package/server-loader.js.map +4 -4
  30. package/resources/pi-agent/extensions/multi-edit.ts +0 -835
@@ -0,0 +1,619 @@
1
+ # Component Selection Guide
2
+
3
+ Decision trees and best practices for choosing the right component for each use case.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [UX Design Patterns](#ux-design-patterns)
8
+ 2. [Selection Process](#selection-process)
9
+ 3. [Common Use Case Decision Trees](#common-use-case-decision-trees)
10
+ 4. [Library-Specific Strengths](#library-specific-strengths)
11
+ 5. [Default Choices](#default-choices)
12
+ 6. [When to Use Each Library](#when-to-use-each-library)
13
+
14
+ ---
15
+
16
+ ## UX Design Patterns
17
+
18
+ These patterns are **mandatory** and must be followed in all Docyrus applications.
19
+
20
+ ### Pattern 1: Item Create Forms → AwesomeDialog
21
+
22
+ All item creation and editing forms use the **AwesomeDialog** system. Choose the container type based on form complexity:
23
+
24
+ ```
25
+ Form complexity → Container choice:
26
+
27
+ Small/simple form (3-6 fields) → container="sheet" side="right"
28
+ Long/complex form (7+ fields) → container="modal" size="lg"
29
+ Mobile-first form → container="drawer" side="bottom"
30
+ ```
31
+
32
+ **AwesomeDialog** props reference:
33
+ - `container`: `'modal'` | `'sheet'` | `'drawer'` — determines the dialog presentation
34
+ - `side`: `'left'` | `'right'` | `'top'` | `'bottom'` — positioning for sheet/drawer
35
+ - `size`: `'sm'` | `'default'` | `'lg'` | `'xl'` | `'full'` — size preset
36
+ - `pattern`: boolean — show decorative pattern background (default: true)
37
+ - `patternStyle`: `'stripes'` | `'dots'` | `'grid'` | `'crosshatch'` | `'zigzag'`
38
+ - `fullscreenable`: boolean — allow fullscreen toggle
39
+ - `minimizable`: boolean — allow minimize (requires GlobalDialogProvider)
40
+ - `resizable`: boolean — allow resize handles
41
+ - `dialogId`: string — unique ID for global dialog tracking
42
+
43
+ **Sub-components**: `AwesomeDialogHeader`, `AwesomeDialogBody`, `AwesomeDialogFooter`, `AwesomeDialogToolbar`
44
+
45
+ **Example — Small create form (task):**
46
+ ```tsx
47
+ <AwesomeDialog open={open} onOpenChange={setOpen} container="sheet" side="right">
48
+ <AwesomeDialogHeader title="Create Task" icon="far-plus" />
49
+ <AwesomeDialogBody>{/* TanStack Form fields */}</AwesomeDialogBody>
50
+ <AwesomeDialogFooter>
51
+ <Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
52
+ <Button onClick={handleSubmit}>Create</Button>
53
+ </AwesomeDialogFooter>
54
+ </AwesomeDialog>
55
+ ```
56
+
57
+ **Example — Large create form (project):**
58
+ ```tsx
59
+ <AwesomeDialog open={open} onOpenChange={setOpen} container="modal" size="lg" fullscreenable>
60
+ <AwesomeDialogHeader title="Create Project" icon="far-folder-plus" />
61
+ <AwesomeDialogBody>{/* Many form fields — body scrolls */}</AwesomeDialogBody>
62
+ <AwesomeDialogFooter>
63
+ <Button variant="outline" onClick={() => setOpen(false)}>Cancel</Button>
64
+ <Button onClick={handleSubmit}>Create Project</Button>
65
+ </AwesomeDialogFooter>
66
+ </AwesomeDialog>
67
+ ```
68
+
69
+ ### Pattern 2: Item Detail Pages → New Page vs AwesomeDialog
70
+
71
+ Choose the right container based on item complexity:
72
+
73
+ ```
74
+ Item complexity → Detail view choice:
75
+
76
+ Large items (projects, workspaces, reports) → Dedicated new page (full route)
77
+ Small items (tasks, contacts, comments) → AwesomeDialog with container="sheet" side="right"
78
+ ```
79
+
80
+ **Decision tree:**
81
+ ```
82
+ Does the item have:
83
+ - Multiple tabs/sections?
84
+ - Sub-items or child lists?
85
+ - Complex layout with sidebar?
86
+ → YES: Create a dedicated page route
87
+
88
+ - Simple field list?
89
+ - Quick view/edit pattern?
90
+ - Opened from a list or table?
91
+ → YES: Use AwesomeDialog right drawer
92
+ ```
93
+
94
+ **Example — Task detail in AwesomeDialog:**
95
+ ```tsx
96
+ <AwesomeDialog open={open} onOpenChange={setOpen} container="sheet" side="right" size="lg" fullscreenable>
97
+ <AwesomeDialogHeader
98
+ title={task.title}
99
+ description={`${task.status} · ${task.assignee}`}
100
+ headerButtons={
101
+ <Button variant="outline" size="sm" onClick={switchToFullForm}>Edit All</Button>
102
+ }
103
+ />
104
+ <AwesomeDialogBody>
105
+ <EditableRecordDetail fields={fields} record={record} onSave={handleSave}>
106
+ <EditableRecordDetailField slug="title" />
107
+ <EditableRecordDetailField slug="status" />
108
+ <EditableRecordDetailField slug="assignee" />
109
+ <EditableRecordDetailField slug="due_date" />
110
+ </EditableRecordDetail>
111
+ </AwesomeDialogBody>
112
+ </AwesomeDialog>
113
+ ```
114
+
115
+ ### Pattern 3: Form System → TanStack Form + Docyrus Form Fields
116
+
117
+ **All forms must use** TanStack Form with the Docyrus form field system. Never use plain HTML forms or React Hook Form directly.
118
+
119
+ **Key components:**
120
+ - `DynamicFormField` — Auto-dispatches to the correct field type based on `IField.type`
121
+ - 47+ field types: text, number, email, url, phone, date, dateTime, time, select, multiSelect, status, relation, file, image, code, docEditor, and more
122
+ - Each field type has a dedicated `*FormField` component (e.g., `TextFormField`, `SelectFormField`, `DateFormField`)
123
+
124
+ **Form field pattern:**
125
+ ```tsx
126
+ import { useForm } from '@tanstack/react-form'
127
+ import { TextFormField, SelectFormField, DateFormField } from '@docyrus/ui/components/form-fields'
128
+
129
+ const form = useForm({ defaultValues: { title: '', status: '', dueDate: '' } })
130
+
131
+ <form.Field name="title">
132
+ {(field) => <TextFormField field={field} label="Title" />}
133
+ </form.Field>
134
+ <form.Field name="status">
135
+ {(field) => <SelectFormField field={field} label="Status" options={statusOptions} />}
136
+ </form.Field>
137
+ ```
138
+
139
+ ### Pattern 4: Inline Editing → EditableRecordDetail
140
+
141
+ Use `EditableRecordDetail` for detail views where users can edit individual fields inline without opening a full form page. **Always enable `trackChanges`** to highlight changed fields and show a floating ActionBar. Always include an **"Edit All"** button in the header to switch to a full form editing experience.
142
+
143
+ **Key components:**
144
+ - `EditableRecordDetail` — Provider/wrapper that manages field state, change tracking, and save/cancel
145
+ - `EditableRecordDetailField` — Individual field that reads config from context, renders label + inline-editable value
146
+ - `EditableValue` — Lower-level single-field inline editor (used internally by EditableRecordDetailField)
147
+ - `useEditableRecordDetail()` — Hook to access form, values, changes, and save/cancel from within the provider
148
+
149
+ **How it works (with `trackChanges` enabled):**
150
+ 1. Fields render as read-only `DynamicValue` display
151
+ 2. Click a field → switches to `DynamicFormField` editor inline
152
+ 3. Changed fields get highlighted with amber background
153
+ 4. Floating `ActionBar` appears showing "N fields changed" with Save/Cancel buttons
154
+ 5. Save commits only changed fields; Cancel reverts all changes
155
+
156
+ **Important:** Always pass `trackChanges` prop when using `EditableRecordDetail` or `DataGrid` with cell editing. Without it, users have no visual feedback about which fields they've modified and no centralized Save/Cancel flow.
157
+
158
+ **Field change tracking types:**
159
+ ```tsx
160
+ interface RecordDetailField {
161
+ field: IField // Field configuration (name, slug, type)
162
+ enumOptions?: EnumOption[] // Options for select-based fields
163
+ readOnly?: boolean // Per-field read-only override
164
+ appSlug?: string // For dynamic enum loading
165
+ dataSourceSlug?: string // For dynamic enum loading
166
+ }
167
+
168
+ interface FieldChange {
169
+ fieldSlug: string
170
+ fieldName: string
171
+ originalValue: unknown
172
+ newValue: unknown
173
+ }
174
+ ```
175
+
176
+ **Example — Detail view with inline editing and "Edit All" button:**
177
+ ```tsx
178
+ <AwesomeDialogHeader
179
+ title="Task Detail"
180
+ headerButtons={<Button variant="outline" size="sm" onClick={switchToFullForm}>Edit All</Button>}
181
+ />
182
+ <AwesomeDialogBody>
183
+ <EditableRecordDetail fields={fields} record={record} onSave={handleSave} onCancel={handleCancel} trackChanges>
184
+ <div className="space-y-3">
185
+ <h4 className="border-b pb-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
186
+ General Info
187
+ </h4>
188
+ <EditableRecordDetailField slug="title" />
189
+ <EditableRecordDetailField slug="status" />
190
+ <EditableRecordDetailField slug="priority" />
191
+ <EditableRecordDetailField slug="assignee" />
192
+ <EditableRecordDetailField slug="due_date" />
193
+ </div>
194
+ </EditableRecordDetail>
195
+ </AwesomeDialogBody>
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Selection Process
201
+
202
+ Follow this process when selecting a component:
203
+
204
+ ```
205
+ 1. Check if there's a default preference for the use case
206
+
207
+ 2. If no default, search for matching components by:
208
+ - Name match (exact or similar)
209
+ - Functionality match
210
+ - Category match (form, data, navigation, etc.)
211
+
212
+ 3. If multiple matches found, apply library priority:
213
+ - docyrus (if Docyrus-specific data handling needed)
214
+ - shadcn (for basic/common components)
215
+ - diceui (for advanced/specialized features)
216
+ - animate-ui (when animation/transitions are important)
217
+ - reui (for specific utility needs)
218
+
219
+ 4. Verify the component meets requirements by checking docs
220
+
221
+ 5. Install and implement
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Common Use Case Decision Trees
227
+
228
+ ### Dashboard & Data Visualization
229
+
230
+ | Need | Component | Library | Rationale |
231
+ |------|-----------|---------|-----------|
232
+ | Stat/metric card | **AwesomeCard** | docyrus | Default choice - hatched header design, perfect for metrics |
233
+ | Stat dashboard (multi-card) | **AwesomeStats** | docyrus | Grid/flex/tabs layouts, mini-charts, comparisons, drag-reorder |
234
+ | Alternative card | Card | shadcn | Basic card for custom designs |
235
+ | Stat display | Stat | diceui | Dedicated stat display with formatting |
236
+ | Pivot table / analytics | **PivotGrid** | docyrus | 3-level hierarchies, subtotals, drilldown, export (CSV/Excel/PDF) |
237
+ | Chart/graph | Chart + Recharts | shadcn | Built-in Recharts integration |
238
+ | Gauge/dial | Gauge | diceui | Circular progress indicator |
239
+ | Progress bar | Progress | shadcn | Linear progress indicator |
240
+ | Circular progress | Circular Progress | diceui | Ring-style progress |
241
+
242
+ ### Navigation & Layout
243
+
244
+ | Need | Component | Library | Rationale |
245
+ |------|-----------|---------|-----------|
246
+ | Dynamic forms (default) | **Form Fields + TanStack Form** | docyrus | 47 field types with auto-dispatch — **always use this** |
247
+ | Inline record editing | **EditableRecordDetail** | docyrus | Click-to-edit fields with change tracking + ActionBar |
248
+ | Single field inline edit | EditableValue | docyrus | Lower-level click-to-edit for individual values |
249
+ | Text input | Input | shadcn | Basic text input (use via TextFormField in forms) |
250
+ | Text area | Textarea | shadcn | Multi-line text (use via TextareaFormField in forms) |
251
+ | Select dropdown | Select | shadcn | Basic select (use via SelectFormField in forms) |
252
+ | Combobox/autocomplete | Combobox | diceui | Search + select |
253
+ | Date picker | Date Time Picker | docyrus | Date + time combined |
254
+ | Date range picker | **Date Time Range Picker** | docyrus | Start/end date+time pair with size variants |
255
+ | Date only | Calendar | shadcn | Date selection only |
256
+ | Time only | Time Picker | diceui | Time selection only |
257
+ | Phone number | Phone Input | diceui | International formatting |
258
+ | Color selection | Color Picker | diceui | Full spectrum + palette |
259
+ | File upload | File Upload | diceui | Drag-drop, preview, progress |
260
+ | Tags input | Tags Input | diceui | Multiple tag entry |
261
+ | Rating | Rating | diceui | Star/heart rating |
262
+ | Checkbox group | Checkbox Group | diceui | Multiple selections |
263
+ | Radio group (animated) | Radio Group | animate-ui | Single selection with animation |
264
+ | Radio group (card/grid) | **Radio Group** | docyrus | Card variant with icons, descriptions, grid columns |
265
+ | Switch | Switch | animate-ui | Toggle with animation |
266
+ | Slider | Slider | shadcn | Range selection |
267
+ | OTP input | Input OTP | shadcn | One-time password codes |
268
+
269
+ ### Data Display & Tables
270
+
271
+ | Need | Component | Library | Rationale |
272
+ |------|-----------|---------|-----------|
273
+ | Editable grid | Data Grid | docyrus | Virtualized, keyboard nav, cell editing — enable `trackChanges` for edit tracking |
274
+ | Grid saved views | **Data Grid View Select** | docyrus | Saved view management with sort/filter/columns — persist with `DataViews` from `@docyrus/app-utils` |
275
+ | Read-only table | Table | shadcn | Simple, responsive tables |
276
+ | Advanced data table | Data Table | diceui | Filtering, sorting, pagination built-in |
277
+ | Table filters | Data Table Filter | docyrus | Multi-column filter bar |
278
+ | Value display | Value Renderers | docyrus | 44 renderer types for read-only display |
279
+ | Empty state | Empty | shadcn | No data placeholder |
280
+
281
+ When using **Data Grid View Select**, back its `views`, `onViewCreate`, `onViewSave`, `onViewDelete`, `onViewHide`, and `onViewUnhide` flows with `createDataViewClient(client, appId)` from `@docyrus/app-utils`. Always pass the TanStack `table` instance, and pass `fields` when you want the editor's built-in filter builder enabled.
282
+
283
+ ### Forms & Inputs
284
+
285
+ **Always use TanStack Form + Docyrus form fields.** The `DynamicFormField` component auto-dispatches to the correct field type.
286
+
287
+ | Need | Component | Library | Rationale |
288
+ |------|-----------|---------|-----------|
289
+ | Dynamic forms (default) | **Form Fields + TanStack Form** | docyrus | 47 field types with auto-dispatch — **always use this** |
290
+ | Inline record editing | **EditableRecordDetail** | docyrus | Click-to-edit fields with change tracking + ActionBar |
291
+ | Single field inline edit | EditableValue | docyrus | Lower-level click-to-edit for individual values |
292
+ | Text input | Input | shadcn | Basic text input (use via TextFormField in forms) |
293
+ | Text area | Textarea | shadcn | Multi-line text (use via TextareaFormField in forms) |
294
+ | Select dropdown | Select | shadcn | Basic select (use via SelectFormField in forms) |
295
+ | Combobox/autocomplete | Combobox | diceui | Search + select |
296
+ | Date picker | Date Time Picker | docyrus | Date + time combined |
297
+ | Date range picker | **Date Time Range Picker** | docyrus | Start/end date+time pair with size variants |
298
+ | Date only | Calendar | shadcn | Date selection only |
299
+ | Time only | Time Picker | diceui | Time selection only |
300
+ | Phone number | Phone Input | diceui | International formatting |
301
+ | Color selection | Color Picker | diceui | Full spectrum + palette |
302
+ | File upload | File Upload | diceui | Drag-drop, preview, progress |
303
+ | Tags input | Tags Input | diceui | Multiple tag entry |
304
+ | Rating | Rating | diceui | Star/heart rating |
305
+ | Checkbox group | Checkbox Group | diceui | Multiple selections |
306
+ | Radio group (animated) | Radio Group | animate-ui | Single selection with animation |
307
+ | Radio group (card/grid) | **Radio Group** | docyrus | Card variant with icons, descriptions, grid columns |
308
+ | Switch | Switch | animate-ui | Toggle with animation |
309
+ | Slider | Slider | shadcn | Range selection |
310
+ | OTP input | Input OTP | shadcn | One-time password codes |
311
+
312
+ ### Dialogs & Overlays
313
+
314
+ | Need | Component | Library | Rationale |
315
+ |------|-----------|---------|-----------|
316
+ | Item create form (small) | **AwesomeDialog** (sheet) | docyrus | Default — sheet right for quick forms |
317
+ | Item create form (large) | **AwesomeDialog** (modal) | docyrus | Default — modal for complex forms |
318
+ | Item detail (small item) | **AwesomeDialog** (sheet right) | docyrus | Default — right drawer for task/contact detail |
319
+ | Minimizable/global dialogs | **AwesomeDialog** + GlobalDialogProvider | docyrus | Taskbar-style dialog management |
320
+ | Responsive dialog | Responsive Dialog | diceui | Auto-switches to drawer on mobile |
321
+ | Alert/confirmation dialog | Alert Dialog | animate-ui | Confirmation prompts |
322
+ | Basic dialog | Dialog | animate-ui | Animated modal (non-form use cases) |
323
+ | Drawer | Drawer | shadcn | Simple side/bottom panel |
324
+ | Sheet | Sheet | animate-ui | Complementary content |
325
+ | Popover | Popover | animate-ui | Floating content |
326
+ | Tooltip | Tooltip | animate-ui | Hover hints |
327
+ | Hover card | Hover Card | animate-ui | Rich preview on hover |
328
+
329
+ ### Specialized Components
330
+
331
+ | Need | Component | Library | Rationale |
332
+ |------|-----------|---------|-----------|
333
+ | Kanban board | **Kanban** | docyrus | Drag-drop columns with dnd-kit, keyboard nav |
334
+ | Gantt chart | **Gantt** | docyrus | Project timeline scheduling |
335
+ | Resource scheduling | **Resource Scheduler Panel** | docyrus | Horizontal timeline with drag-drop events |
336
+ | Appointment booking | **Time Slot Scheduler** | docyrus | Columns/month views, capacity, timezone |
337
+ | Timeline | Timeline | diceui | Event/step display |
338
+ | Stepper / wizard | **Stepper** | docyrus | 6 variants, horizontal/vertical, animated connectors |
339
+ | Tour/onboarding | Tour | diceui | Interactive tutorials |
340
+ | Query builder | Query Builder | docyrus | Docyrus query construction |
341
+ | Notifications | **NotificationStack** | docyrus | Stacked notification cards |
342
+ | Notification panel | **NotificationsPanel** | docyrus | Full notification management |
343
+ | Search input | **SearchInput** | docyrus | Dedicated search with clear |
344
+ | Location input | **PlaceAutocomplete** | docyrus | Address search + selection |
345
+ | Map display | **Map** | docyrus | Geographic data (Leaflet) |
346
+ | Tree hierarchy | **TreeView** | docyrus | Nested data display |
347
+ | Image editing | **ImageEditor** | docyrus | Crop, adjust, transform |
348
+ | Media player | Media Player | diceui | Video/audio playback |
349
+ | QR code | QR Code | diceui | QR generation |
350
+ | Cropper / Image cropping | **ImageEditor** | docyrus | Crop, adjust, transform |
351
+ | Mentions | Mention | diceui | @mention functionality |
352
+ | Command palette | Command | shadcn | Keyboard shortcuts |
353
+ | Confirmation action | **ConfirmationButton** | docyrus | Button with confirm dialog |
354
+ | Activity logging (CRM) | **Log Activity Form** | docyrus | Calls, emails, meetings, tasks, status updates with Plate editor |
355
+ | Dynamic repeating rows | **Schema Repeater** | docyrus | Structured data list with customizable input types per column |
356
+ | Rich item selector | **Mega Select** | docyrus | Grid picker with categories, search, detail panel |
357
+ | Quick record create | **Create Record Dialog** | docyrus | Popover dialog with subject, mentions, selectors |
358
+ | Email composing | **Email Composer** | docyrus | To/Cc/Bcc, formatting toolbar, attachments |
359
+ | Markdown editing | **Simple Markdown Editor** | docyrus | Lightweight MD editor with toolbar/stats |
360
+ | Team chat | **Team Chat Channel** | docyrus | Posts, threads, reactions, mentions, attachments |
361
+ | Contact activities | **Contact Activity Panel** | docyrus | Activity timeline with calls, emails, tasks, chat |
362
+ | AI agent chat | **Docyrus Agent** | docyrus | Chat/action-panel/trigger modes for AI agents |
363
+ | Pricing/quoting | **Pricing Engine Panel** | docyrus | Line items, VAT, discounts, currency, totals |
364
+ | Record sharing | **Record Sharing** | docyrus | Permission-based sharing with users/teams/roles |
365
+
366
+ ---
367
+
368
+ ## Library-Specific Strengths
369
+
370
+ ### shadcn (43 components)
371
+ **Best for**: Core UI primitives, forms, basic layout
372
+
373
+ **Strengths**:
374
+ - Well-tested, accessible components
375
+ - Great documentation
376
+ - Broad browser support
377
+ - Foundation for other libraries
378
+
379
+ **Use when**: You need a standard, reliable component without special features
380
+
381
+ ### diceui (42 components)
382
+ **Best for**: Advanced interactions, specialized data components
383
+
384
+ **Strengths**:
385
+ - Rich feature sets (filtering, sorting, virtualization)
386
+ - Advanced input types (phone, color, mask)
387
+ - Drag-drop capabilities
388
+ - Data visualization components
389
+
390
+ **Use when**: You need advanced functionality beyond basic components
391
+
392
+ ### animate-ui (21 components)
393
+ **Best for**: Animated transitions, polished UX
394
+
395
+ **Strengths**:
396
+ - Smooth, professional animations
397
+ - Enhanced visual feedback
398
+ - Composable animated patterns
399
+
400
+ **Use when**: Animation/transitions are important to the UX
401
+
402
+ ### docyrus (51 components)
403
+ **Best for**: Docyrus-specific data handling, forms, dialogs, inline editing, scheduling, chat, AI agents, and business logic
404
+
405
+ **Strengths**:
406
+ - Deep Docyrus platform integration
407
+ - AwesomeDialog system for item creation and detail views
408
+ - EditableRecordDetail for inline field editing with change tracking
409
+ - 47 form field types with TanStack Form integration
410
+ - 44 value renderer types
411
+ - Data source query builders
412
+ - Scheduling: Gantt, Resource Scheduler, Time Slot Scheduler, Calendar
413
+ - Communication: Team Chat Channel, Email Composer, Comments Panel
414
+ - AI integration: Docyrus Agent (chat, action panel, trigger modes)
415
+ - Business: Pricing Engine, Record Sharing, Contact Activity
416
+ - Selection: Mega Select, Create Record Dialog
417
+ - Kanban board, notifications, maps, markdown editor, and more
418
+
419
+ **Use when**: Working with Docyrus data sources, building item create/detail flows, forms, scheduling, chat, AI features, or queries
420
+
421
+ ### reui (2 components)
422
+ **Best for**: Specific utility needs
423
+
424
+ **Strengths**:
425
+ - Focused implementations
426
+ - Lightweight alternatives
427
+
428
+ **Use when**: The specific component matches your exact need
429
+
430
+ ---
431
+
432
+ ## Default Choices
433
+
434
+ These are the **recommended defaults** unless the user specifies otherwise:
435
+
436
+ | Use Case | Default Component | Library |
437
+ |----------|------------------|---------|
438
+ | Item create form | **AwesomeDialog** (sheet/modal) | docyrus |
439
+ | Quick record create | **Create Record Dialog** | docyrus |
440
+ | Item detail (small) | **AwesomeDialog** (sheet right) | docyrus |
441
+ | Inline record editing | **EditableRecordDetail** | docyrus |
442
+ | Dashboard card | AwesomeCard | docyrus |
443
+ | App navigation | Sidebar | animate-ui |
444
+ | Charts | Chart + Recharts | shadcn |
445
+ | Data table | Data Table | diceui |
446
+ | Data grid saved views | **Data Grid View Select** + `DataViews` | docyrus + `@docyrus/app-utils` |
447
+ | Forms | **Form Fields + TanStack Form** | docyrus |
448
+ | File upload | File Upload | diceui |
449
+ | Confirmation dialogs | Alert Dialog | animate-ui |
450
+ | Gantt / project scheduling | Gantt | docyrus |
451
+ | Resource scheduling | **Resource Scheduler Panel** | docyrus |
452
+ | Appointment booking | **Time Slot Scheduler** | docyrus |
453
+ | Team chat | **Team Chat Channel** | docyrus |
454
+ | Email composing | **Email Composer** | docyrus |
455
+ | AI agent interface | **Docyrus Agent** | docyrus |
456
+ | Kanban board | **Kanban** | docyrus |
457
+ | Notifications | NotificationStack | docyrus |
458
+ | Pricing / quoting | **Pricing Engine Panel** | docyrus |
459
+ | Record sharing | **Record Sharing** | docyrus |
460
+ | Stat dashboards | **AwesomeStats** | docyrus |
461
+ | Pivot table / analytics | **PivotGrid** | docyrus |
462
+ | Activity logging (CRM) | **Log Activity Form** | docyrus |
463
+ | Multi-step wizard | **Stepper** | docyrus |
464
+
465
+ ---
466
+
467
+ ## When to Use Each Library
468
+
469
+ ### Use shadcn when:
470
+ - Building basic forms with standard inputs
471
+ - Creating simple layouts with cards, buttons, badges
472
+ - Need reliable, accessible primitives
473
+ - No special animation or advanced features required
474
+
475
+ ### Use diceui when:
476
+ - Building complex data tables with sorting/filtering
477
+ - Need advanced input types (phone, color, tags)
478
+ - Implementing drag-drop (kanban, sortable lists)
479
+ - Creating rich data visualizations (gauges, timelines)
480
+
481
+ ### Use animate-ui when:
482
+ - Animation/transitions are important to the design
483
+ - Building navigation with smooth interactions
484
+ - Creating polished dialog/overlay experiences
485
+ - Need animated feedback for user actions
486
+
487
+ ### Use docyrus when:
488
+ - Building item create forms (AwesomeDialog, Create Record Dialog)
489
+ - Building item detail views (AwesomeDialog + EditableRecordDetail)
490
+ - Working directly with Docyrus data sources
491
+ - Building forms that map to Docyrus fields (TanStack Form + DynamicFormField)
492
+ - Displaying Docyrus record data in tables/cards
493
+ - Need inline editing with change tracking
494
+ - Building scheduling UIs (Resource Scheduler, Time Slot Scheduler, Gantt, Calendar)
495
+ - Building communication features (Team Chat, Email Composer, Comments Panel)
496
+ - Integrating AI agents (Docyrus Agent with chat/action modes)
497
+ - Need pricing/quoting (Pricing Engine Panel)
498
+ - Need record sharing with permissions (Record Sharing)
499
+ - Need rich item selectors (Mega Select, Kanban)
500
+ - Need Docyrus-specific components (query builder, activity panel, notifications)
501
+
502
+ ### Use reui when:
503
+ - The specific component (file upload or sortable) matches your exact need
504
+ - Want a lightweight alternative to diceui versions
505
+
506
+ ---
507
+
508
+ ## Icon Selection Guide
509
+
510
+ **Priority order for icons**:
511
+
512
+ 1. **hugeicons** (first choice)
513
+ - Modern, consistent style
514
+ - Large icon set
515
+ - Use for: All general-purpose icons
516
+
517
+ 2. **fontawesome light** (second choice)
518
+ - Professional appearance
519
+ - Familiar to users
520
+ - Use for: When hugeicons doesn't have the needed icon
521
+
522
+ 3. **lucide-icons** (third choice)
523
+ - Clean, minimalist style
524
+ - Use for: Fallback when neither hugeicons nor fontawesome have the icon
525
+
526
+ **Example**:
527
+ ```tsx
528
+ import { HugeIconDollarCircle } from '@/components/icons/hugeicons'
529
+ import { FaLightChartLine } from '@/components/icons/fontawesome'
530
+ import { LucideActivity } from 'lucide-react'
531
+
532
+ // Prefer hugeicons
533
+ <HugeIconDollarCircle className="h-5 w-5" />
534
+
535
+ // Use fontawesome if not in hugeicons
536
+ <FaLightChartLine className="h-5 w-5" />
537
+
538
+ // Use lucide as fallback
539
+ <LucideActivity className="h-5 w-5" />
540
+ ```
541
+
542
+ ---
543
+
544
+ ## Quick Reference: Component Categories
545
+
546
+ ### Dialogs & Item Flows
547
+ - Item create forms: **docyrus AwesomeDialog** (sheet for small, modal for large)
548
+ - Quick record create: **docyrus Create Record Dialog** (popover with subject/mentions)
549
+ - Item detail (small): **docyrus AwesomeDialog** (sheet right)
550
+ - Item detail (large): Dedicated page route
551
+ - Inline editing: **docyrus EditableRecordDetail**
552
+ - Confirmation: animate-ui Alert Dialog
553
+ - Responsive: diceui Responsive Dialog
554
+
555
+ ### Data & Display
556
+ - Tables: docyrus Data Grid, diceui Data Table, shadcn Table
557
+ - Pivot table: docyrus PivotGrid (hierarchies, subtotals, drilldown, export)
558
+ - Grid saved views: docyrus Data Grid View Select + `DataViews` from `@docyrus/app-utils`
559
+ - Cards: docyrus AwesomeCard, shadcn Card
560
+ - Stat dashboards: docyrus AwesomeStats (grid/flex/tabs, mini-charts, comparisons)
561
+ - Charts: shadcn Chart + Recharts
562
+ - Stats: diceui Stat, diceui Gauge, shadcn Progress
563
+ - Gantt: docyrus Gantt
564
+ - Tree: docyrus TreeView
565
+
566
+ ### Forms & Input
567
+ - Dynamic forms: **docyrus Form Fields + TanStack Form** (always use)
568
+ - Inline editing: docyrus EditableRecordDetail, EditableValue
569
+ - Text: shadcn Input, Textarea
570
+ - Markdown: docyrus Simple Markdown Editor
571
+ - Selection: shadcn Select, diceui Combobox
572
+ - Rich selection: docyrus Mega Select (grid picker with categories)
573
+ - Radio cards: docyrus Radio Group (card variant with icons/descriptions)
574
+ - Dates: docyrus Date Time Picker, docyrus Date Time Range Picker, shadcn Calendar
575
+ - Files: diceui File Upload
576
+ - Special: diceui Phone Input, Color Picker, Tags Input
577
+
578
+ ### Navigation
579
+ - Sidebar: animate-ui Sidebar
580
+ - Menus: animate-ui Dropdown Menu, shadcn Menubar
581
+ - Breadcrumbs: shadcn Breadcrumb
582
+ - Tabs: animate-ui Tabs
583
+
584
+ ### Overlays
585
+ - Item forms/details: **docyrus AwesomeDialog** (preferred)
586
+ - Popovers: animate-ui Popover, Tooltip, Hover Card
587
+ - Drawers: shadcn Drawer, animate-ui Sheet
588
+
589
+ ### Communication
590
+ - Team chat: docyrus Team Chat Channel (threads, reactions, mentions)
591
+ - Email composing: docyrus Email Composer (To/Cc/Bcc, toolbar, attachments)
592
+ - Comments: docyrus Comments Panel (threaded conversations)
593
+ - Contact activities: docyrus Contact Activity Panel (calls, meetings, emails)
594
+ - Activity logging: docyrus Log Activity Form (calls, emails, meetings, tasks, statuses)
595
+
596
+ ### Scheduling
597
+ - Project timelines: docyrus Gantt
598
+ - Resource scheduling: docyrus Resource Scheduler Panel (horizontal timeline)
599
+ - Appointment booking: docyrus Time Slot Scheduler (columns/month views)
600
+ - Calendar events: docyrus Calendar (month/week/day views)
601
+
602
+ ### AI & Agents
603
+ - AI chat: docyrus Docyrus Agent (chat mode)
604
+ - AI actions: docyrus Docyrus Agent (action-panel mode)
605
+ - AI trigger: docyrus Docyrus Agent (floating trigger button)
606
+
607
+ ### Business Logic
608
+ - Pricing/quoting: docyrus Pricing Engine Panel (line items, VAT, discounts)
609
+ - Record sharing: docyrus Record Sharing (permissions, users/teams/roles)
610
+
611
+ ### Specialized
612
+ - Kanban: docyrus Kanban (drag-drop columns)
613
+ - Timeline: diceui Timeline
614
+ - Stepper / wizard: docyrus Stepper (6 variants, horizontal/vertical, animated)
615
+ - Query: docyrus Query Builder
616
+ - Notifications: docyrus NotificationStack
617
+ - Maps: docyrus Map
618
+ - Search: docyrus SearchInput
619
+ - Repeating rows: docyrus SchemaRepeater (dynamic structured data lists)