@devalok/shilp-sutra-karm 0.6.1 → 0.6.2

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 (2) hide show
  1. package/llms.txt +121 -0
  2. package/package.json +3 -2
package/llms.txt ADDED
@@ -0,0 +1,121 @@
1
+ # @devalok/shilp-sutra-karm
2
+
3
+ > Domain-specific UI components for the Karm team-management platform.
4
+ > Built on top of @devalok/shilp-sutra (core design system).
5
+ > Peer dependency: @devalok/shilp-sutra >=0.3.0
6
+
7
+ ## Install & Import
8
+
9
+ pnpm add @devalok/shilp-sutra-karm
10
+
11
+ // Per-module imports (recommended):
12
+ import { KanbanBoard } from '@devalok/shilp-sutra-karm/board'
13
+ import { TaskDetailPanel } from '@devalok/shilp-sutra-karm/tasks'
14
+ import { ChatPanel } from '@devalok/shilp-sutra-karm/chat'
15
+ import { AttendanceCTA, DailyBrief } from '@devalok/shilp-sutra-karm/dashboard'
16
+ import { AccentProvider, ClientPortalHeader, ProjectCard } from '@devalok/shilp-sutra-karm/client'
17
+ import { AdminDashboard, BreakAdmin } from '@devalok/shilp-sutra-karm/admin'
18
+
19
+ // Or from root barrel:
20
+ import { KanbanBoard, TaskDetailPanel, ChatPanel } from '@devalok/shilp-sutra-karm'
21
+
22
+ ## Module Reference
23
+
24
+ ### Board (`/board`)
25
+ - KanbanBoard: initialData(BoardData), onTaskMove, onTaskAdd, onColumnRename, onColumnDelete, onClickTask, onAddColumn
26
+ - BoardColumn: column(BoardColumnData), index, onAddTask, onClickTask, onRenameColumn, onDeleteColumn
27
+ - TaskCard: task(BoardTask), onClickTask
28
+ - TaskCardOverlay: task(BoardTask) — drag overlay variant
29
+
30
+ BoardTask shape: { id, title, priority, labels[], dueDate, isBlocked, assignees[] }
31
+ BoardData shape: { columns: [{ id, name, isClientVisible, tasks[] }] }
32
+
33
+ Uses dnd-kit for drag-and-drop. KanbanBoard manages all DnD state internally.
34
+
35
+ ### Tasks (`/tasks`)
36
+ - TaskDetailPanel: task(FullTask|null), open, onOpenChange, columns[], members[], activities[], clientMode?, onTitleUpdate, onPropertyUpdate, onAssign, onUnassign, onCreateSubtask, onToggleSubtask, onRequestReview, onUpdateReviewStatus + more callbacks
37
+ - TaskProperties: task, columns[], members[], onUpdate, onAssign, onUnassign, readOnly?, editableFields?, renderPriorityIndicator?, renderDatePicker?
38
+ - ActivityTab: activities(AuditLogEntry[])
39
+ - ConversationTab: comments[], taskVisibility, onPostComment, clientMode?, renderEditor?, renderViewer?
40
+ - FilesTab: files[], onUpload, onDelete, isUploading?, readOnly?
41
+ - ReviewTab: reviews[], members[], onRequestReview, onUpdateStatus
42
+ - SubtasksTab: subtasks[], onCreateSubtask, onToggleSubtask, onClickSubtask?, readOnly?
43
+
44
+ TaskDetailPanel opens as a Sheet with tabs: Properties, Subtasks, Review, Conversation, Files, Activity.
45
+ Supports clientMode for read-only client portal views.
46
+ Priority values: 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
47
+ Visibility: 'INTERNAL' | 'EVERYONE'
48
+
49
+ ### Chat (`/chat`)
50
+ - ChatPanel: isOpen, onOpenChange, messages[], conversations[], agents?[], selectedAgentId?, isStreaming?, streamingText?, onSendMessage, onCancelStream?, onSelectAgent?, onStartNewChat?, onSelectConversation?, onArchiveConversation?, onDeleteConversation?
51
+ - ChatInput: onSubmit, onCancel?, isStreaming?, placeholder?, disclaimer?
52
+ - MessageList: messages[], isStreaming?, streamingText?, isLoadingMessages?
53
+ - ConversationList: conversations[], activeConversationId?, onSelect, onNewChat, onArchive?, onDelete?
54
+ - StreamingText: text(string) — markdown renderer with animated cursor
55
+
56
+ ChatMessage shape: { id, role: 'USER'|'ASSISTANT'|'SYSTEM', content }
57
+ Agent shape: { id, name, desc }
58
+ Conversation shape: { id, title, updatedAt }
59
+
60
+ ### Dashboard (`/dashboard`)
61
+ - AttendanceCTA: userName, attendance, canMarkAttendance, onMarkAttendance?, isSubmitting?, formatTime?
62
+ - DailyBrief: data({ brief: string[], generatedAt }|null), loading?
63
+
64
+ ### Client Portal (`/client`)
65
+ - AccentProvider: accentCss?(string) — injects CSS custom properties on document root
66
+ - ClientPortalHeader: orgName, orgLogo?, userName, userAvatar?
67
+ - ProjectCard: name, description?, status('active'|'completed'|'paused'), taskCount?, completedTasks?
68
+
69
+ ### Admin (`/admin`)
70
+ AdminDashboard and BreakAdmin are COMPOUND components with sub-components accessed via dot notation.
71
+
72
+ AdminDashboard compound:
73
+ <AdminDashboard.Root currentUserId={...} currentUserRole={...} assetsBaseUrl={...} userImages={...}>
74
+ <AdminDashboard.Calendar dateAttendanceMap={...} />
75
+ <AdminDashboard.AttendanceOverview groupedAttendance={...} users={...} />
76
+ <AdminDashboard.LeaveRequests requests={...} corrections={...} />
77
+ <AdminDashboard.AssociateDetail attendance={...} tasks={...} corrections={...} />
78
+ </AdminDashboard.Root>
79
+
80
+ BreakAdmin compound:
81
+ <BreakAdmin.Root currentUser={...} breaks={...} users={...} breakBalanceData={...} userImages={...} onApproveRequest={...} onRejectRequest={...} ...>
82
+ <BreakAdmin.Header />
83
+ <BreakAdmin.Breaks />
84
+ <BreakAdmin.LeaveRequest />
85
+ <BreakAdmin.BreakBalance />
86
+ <BreakAdmin.EditBreak />
87
+ <BreakAdmin.EditBreakBalance />
88
+ <BreakAdmin.DeleteBreak />
89
+ <BreakAdmin.ApprovedAdjustments />
90
+ </BreakAdmin.Root>
91
+
92
+ UserRole: 'Apprentice' | 'Associate' | 'Admin' | 'SuperAdmin'
93
+ AttendanceStatus: 'PRESENT' | 'ABSENT' | 'BREAK' | 'Not_Marked' | 'HOLIDAY' | 'WEEKEND'
94
+ BreakRequestStatus: 'PENDING' | 'APPROVED' | 'REJECTED' | 'CANCELLED'
95
+
96
+ ### Utility Exports
97
+ - Date formatting: formatDate, formatDateIST, formatTimeIST, formatDateWithWeekday, formatOptionalDate
98
+ - Date helpers: getDaySuffix, isSameDay, getWeekDays, getMonthDays, getStartOfDay, getEndOfDay
99
+ - String helpers: removeAllEmojis, removeEmojiAtStart
100
+ - Rendering: renderAdjustmentType, renderStatus
101
+
102
+ ### Loading Skeletons
103
+ - DevsabhaSkeleton, BandwidthSkeleton — domain-specific page skeletons
104
+
105
+ ## Key Patterns
106
+
107
+ - All components are callback-driven (emit updates via on* props, no internal state management)
108
+ - Admin components use compound pattern with React Context (AdminDashboard.Root provides context to children)
109
+ - Client mode: TaskDetailPanel, TaskProperties, FilesTab support readOnly + editableFields for client portal
110
+ - Chat supports streaming: pass isStreaming + streamingText for live AI responses
111
+ - Board uses dnd-kit: KanbanBoard handles all drag state, emits onTaskMove with final position
112
+ - All dates default to IST (Asia/Kolkata) timezone in admin utilities
113
+
114
+ ## Common Mistakes -- DO NOT
115
+
116
+ - DO NOT manage DnD state outside KanbanBoard — it handles sensors, collision detection, and sorting internally
117
+ - DO NOT forget to pass both open AND onOpenChange to TaskDetailPanel (it's a controlled Sheet)
118
+ - DO NOT use AdminDashboard sub-components outside AdminDashboard.Root — they depend on context
119
+ - DO NOT use BreakAdmin sub-components outside BreakAdmin.Root — same compound pattern
120
+ - DO NOT pass raw Date objects for task dates — use ISO strings (the components parse them internally)
121
+ - DO NOT forget the peer dependency: @devalok/shilp-sutra must be installed for UI primitives
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra-karm",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Domain components for Karm — board, tasks, chat, dashboard, client, and admin",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,8 @@
39
39
  },
40
40
  "files": [
41
41
  "dist",
42
- "README.md"
42
+ "README.md",
43
+ "llms.txt"
43
44
  ],
44
45
  "scripts": {
45
46
  "build": "vite build && node scripts/inject-use-client.mjs",