@devalok/shilp-sutra-karm 0.18.0 → 0.18.1
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/docs/components/admin/admin-dashboard.md +215 -0
- package/docs/components/admin/admin-types.md +167 -0
- package/docs/components/admin/admin-utils.md +165 -0
- package/docs/components/admin/break-admin.md +167 -0
- package/docs/components/board/board-column.md +35 -0
- package/docs/components/board/board-provider.md +73 -0
- package/docs/components/board/board-toolbar.md +36 -0
- package/docs/components/board/board-types.md +62 -0
- package/docs/components/board/bulk-action-bar.md +38 -0
- package/docs/components/board/column-empty.md +33 -0
- package/docs/components/board/column-header.md +36 -0
- package/docs/components/board/kanban-board.md +53 -0
- package/docs/components/board/task-card.md +58 -0
- package/docs/components/board/task-context-menu.md +36 -0
- package/docs/components/chat/chat-input.md +37 -0
- package/docs/components/chat/chat-panel.md +58 -0
- package/docs/components/chat/conversation-list.md +47 -0
- package/docs/components/chat/message-list.md +44 -0
- package/docs/components/chat/streaming-text.md +29 -0
- package/docs/components/client/accent-provider.md +29 -0
- package/docs/components/client/client-portal-header.md +40 -0
- package/docs/components/client/project-card.md +39 -0
- package/docs/components/dashboard/attendance-cta.md +47 -0
- package/docs/components/dashboard/daily-brief.md +45 -0
- package/docs/components/dashboard/scratchpad-widget.md +52 -0
- package/docs/components/dashboard/sidebar-scratchpad.md +39 -0
- package/docs/components/other/karm-command-registry.md +61 -0
- package/docs/components/other/page-skeletons.md +52 -0
- package/docs/components/tasks/activity-tab.md +41 -0
- package/docs/components/tasks/conversation-tab.md +52 -0
- package/docs/components/tasks/files-tab.md +51 -0
- package/docs/components/tasks/review-tab.md +49 -0
- package/docs/components/tasks/subtasks-tab.md +56 -0
- package/docs/components/tasks/task-detail-panel.md +103 -0
- package/docs/components/tasks/task-properties.md +79 -0
- package/package.json +4 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# FilesTab
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/tasks
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: tasks
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
files: TaskFile[] (REQUIRED)
|
|
9
|
+
onUpload: (file: File, title?: string) => void (REQUIRED)
|
|
10
|
+
onDelete: (fileId: string) => void (REQUIRED)
|
|
11
|
+
isUploading: boolean (default: false)
|
|
12
|
+
readOnly: boolean (default: false) — hides upload/delete controls
|
|
13
|
+
...HTMLAttributes<HTMLDivElement>
|
|
14
|
+
|
|
15
|
+
## TaskFile Shape
|
|
16
|
+
id: string
|
|
17
|
+
taskId: string
|
|
18
|
+
title: string
|
|
19
|
+
fileUrl: string
|
|
20
|
+
downloadUrl: string (optional)
|
|
21
|
+
fileType: string | null
|
|
22
|
+
uploadedBy: { id: string; name: string; image: string | null }
|
|
23
|
+
createdAt: string
|
|
24
|
+
externalUrl: string (optional, e.g. Google Drive link)
|
|
25
|
+
externalLabel: string (optional, tooltip for external link, default: "Open externally")
|
|
26
|
+
|
|
27
|
+
## Defaults
|
|
28
|
+
isUploading=false, readOnly=false
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
```jsx
|
|
32
|
+
<FilesTab
|
|
33
|
+
files={task.files}
|
|
34
|
+
onUpload={(file) => uploadFile(file)}
|
|
35
|
+
onDelete={(fileId) => deleteFile(fileId)}
|
|
36
|
+
isUploading={uploading}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Gotchas
|
|
41
|
+
- Supports drag-and-drop upload zone and click-to-upload.
|
|
42
|
+
- File icons are auto-detected from fileType: images, documents, code, spreadsheets, archives.
|
|
43
|
+
- Delete triggers a confirmation Dialog before calling onDelete.
|
|
44
|
+
- In readOnly mode, upload zone and delete buttons are hidden; download/external links remain.
|
|
45
|
+
- externalUrl is validated to start with https?:// before rendering as a link.
|
|
46
|
+
- Empty state: "No files attached".
|
|
47
|
+
- Forwards ref to outer div.
|
|
48
|
+
|
|
49
|
+
## Changes
|
|
50
|
+
### v0.18.0
|
|
51
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ReviewTab
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/tasks
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: tasks
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
reviews: ReviewRequest[] (REQUIRED)
|
|
9
|
+
members: Member[] (REQUIRED)
|
|
10
|
+
onRequestReview: (reviewerId: string) => void (REQUIRED)
|
|
11
|
+
onUpdateStatus: (reviewId: string, status: ReviewRequest['status'], feedback?: string) => void (REQUIRED)
|
|
12
|
+
...HTMLAttributes<HTMLDivElement>
|
|
13
|
+
|
|
14
|
+
## ReviewRequest Shape
|
|
15
|
+
id: string
|
|
16
|
+
taskId: string
|
|
17
|
+
status: 'PENDING' | 'APPROVED' | 'CHANGES_REQUESTED' | 'REJECTED'
|
|
18
|
+
feedback: string | null
|
|
19
|
+
requestedBy: { id: string; name: string; image: string | null }
|
|
20
|
+
reviewer: { id: string; name: string; image: string | null }
|
|
21
|
+
createdAt: string
|
|
22
|
+
updatedAt: string
|
|
23
|
+
|
|
24
|
+
## Member Shape
|
|
25
|
+
id: string
|
|
26
|
+
name: string
|
|
27
|
+
image: string | null (optional)
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
```jsx
|
|
31
|
+
<ReviewTab
|
|
32
|
+
reviews={task.reviewRequests}
|
|
33
|
+
members={teamMembers}
|
|
34
|
+
onRequestReview={(reviewerId) => requestReview(reviewerId)}
|
|
35
|
+
onUpdateStatus={(id, status, feedback) => updateReview(id, status, feedback)}
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Gotchas
|
|
40
|
+
- Each review card shows reviewer avatar, name, requested-by name, and status badge.
|
|
41
|
+
- PENDING reviews have a "Respond" button that expands to show feedback textarea and three response buttons: Approve (success), Request Changes (warning), Reject (error).
|
|
42
|
+
- "Request Review" button at the bottom uses MemberPicker from core.
|
|
43
|
+
- Status badge colors are defined in task-constants.ts via REVIEW_STATUS_MAP.
|
|
44
|
+
- Empty state: "No reviews yet".
|
|
45
|
+
- Forwards ref to outer div.
|
|
46
|
+
|
|
47
|
+
## Changes
|
|
48
|
+
### v0.18.0
|
|
49
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# SubtasksTab
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/tasks
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: tasks
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
subtasks: Subtask[] (REQUIRED)
|
|
9
|
+
terminalColumnId: string (optional — column ID that marks tasks as complete)
|
|
10
|
+
projectId: string (REQUIRED)
|
|
11
|
+
parentTaskId: string (REQUIRED)
|
|
12
|
+
defaultColumnId: string (REQUIRED)
|
|
13
|
+
onCreateSubtask: (title: string) => void (REQUIRED)
|
|
14
|
+
onToggleSubtask: (taskId: string, isComplete: boolean) => void (REQUIRED)
|
|
15
|
+
onClickSubtask: (taskId: string) => void
|
|
16
|
+
readOnly: boolean (default: false) — hides create/toggle controls
|
|
17
|
+
...HTMLAttributes<HTMLDivElement>
|
|
18
|
+
|
|
19
|
+
## Subtask Shape
|
|
20
|
+
id: string
|
|
21
|
+
title: string
|
|
22
|
+
priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
|
|
23
|
+
columnId: string
|
|
24
|
+
column: { id: string; name: string; isTerminal?: boolean } (optional)
|
|
25
|
+
assignees: { user: { id: string; name: string; image?: string | null } }[]
|
|
26
|
+
|
|
27
|
+
## Defaults
|
|
28
|
+
readOnly=false
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
```jsx
|
|
32
|
+
<SubtasksTab
|
|
33
|
+
subtasks={task.subtasks}
|
|
34
|
+
terminalColumnId="done-col"
|
|
35
|
+
projectId={task.projectId}
|
|
36
|
+
parentTaskId={task.id}
|
|
37
|
+
defaultColumnId="todo-col"
|
|
38
|
+
onCreateSubtask={(title) => createSubtask(title)}
|
|
39
|
+
onToggleSubtask={(id, complete) => toggleSubtask(id, complete)}
|
|
40
|
+
onClickSubtask={(id) => navigateToTask(id)}
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Gotchas
|
|
45
|
+
- A subtask is considered "complete" when column.isTerminal is true OR columnId matches terminalColumnId.
|
|
46
|
+
- Progress bar shows completed/total count at the top.
|
|
47
|
+
- Each subtask row shows: checkbox, priority dot, title (strikethrough when complete), first assignee avatar.
|
|
48
|
+
- Clicking a subtask row triggers onClickSubtask (if provided).
|
|
49
|
+
- In readOnly mode, checkboxes are non-interactive and the "Add subtask" button is hidden.
|
|
50
|
+
- "Add subtask" inline form with Enter to submit, Escape to cancel.
|
|
51
|
+
- Empty state: "No subtasks".
|
|
52
|
+
- Forwards ref to outer div.
|
|
53
|
+
|
|
54
|
+
## Changes
|
|
55
|
+
### v0.18.0
|
|
56
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# TaskDetailPanel
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/tasks
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: tasks
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
task: FullTask | null (REQUIRED)
|
|
9
|
+
loading: boolean (default: false)
|
|
10
|
+
open: boolean (REQUIRED)
|
|
11
|
+
onOpenChange: (open: boolean) => void (REQUIRED)
|
|
12
|
+
columns: Column[] (REQUIRED)
|
|
13
|
+
members: Member[] (REQUIRED)
|
|
14
|
+
activities: AuditLogEntry[] (default: [])
|
|
15
|
+
enrichedComments: Comment[] | null (override comments from separate API)
|
|
16
|
+
clientMode: boolean (default: false) — hides staff-only tabs/fields
|
|
17
|
+
clientEditableFields: string[] (default: ['priority', 'dueDate'])
|
|
18
|
+
headerSlot: ReactNode (content between title and properties)
|
|
19
|
+
extraTabs: ExtraTab[] (default: []) — additional tab panels alongside built-in tabs
|
|
20
|
+
onTitleUpdate: (title: string) => void
|
|
21
|
+
onPropertyUpdate: (field: string, value: unknown) => void
|
|
22
|
+
onAssign: (userId: string) => void
|
|
23
|
+
onUnassign: (userId: string) => void
|
|
24
|
+
onCreateSubtask: (title: string) => void
|
|
25
|
+
onToggleSubtask: (taskId: string, isComplete: boolean) => void
|
|
26
|
+
onRequestReview: (reviewerId: string) => void
|
|
27
|
+
onUpdateReviewStatus: (reviewId: string, status: string, feedback?: string) => void
|
|
28
|
+
onPostComment: (content: string, authorType: 'INTERNAL' | 'CLIENT') => void
|
|
29
|
+
onUploadFile: (file: File, title?: string) => void
|
|
30
|
+
onUploadDeliverable: (file: File, deliverableId?: string) => void
|
|
31
|
+
onDeleteFile: (fileId: string) => void
|
|
32
|
+
onTabChange: (tab: string) => void
|
|
33
|
+
renderEditor: (props: { content: string; onChange: (content: string) => void; placeholder: string }) => ReactNode
|
|
34
|
+
renderViewer: (props: { content: string; className?: string }) => ReactNode
|
|
35
|
+
renderPriorityIndicator: (props: { priority: string }) => ReactNode
|
|
36
|
+
renderDatePicker: (props: { value: Date | null; onChange: (date: Date | null) => void; placeholder: string; className?: string }) => ReactNode
|
|
37
|
+
isUploading: boolean (default: false)
|
|
38
|
+
|
|
39
|
+
## FullTask Shape
|
|
40
|
+
id: string
|
|
41
|
+
title: string
|
|
42
|
+
description: string | null
|
|
43
|
+
projectId: string
|
|
44
|
+
columnId: string
|
|
45
|
+
column: { id: string; name: string }
|
|
46
|
+
ownerId: string | null
|
|
47
|
+
owner: Member | null
|
|
48
|
+
priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
|
|
49
|
+
dueDate: string | null
|
|
50
|
+
labels: string[]
|
|
51
|
+
visibility: 'INTERNAL' | 'EVERYONE'
|
|
52
|
+
parentTaskId: string | null
|
|
53
|
+
depth: number
|
|
54
|
+
order: number
|
|
55
|
+
isBlocked: boolean
|
|
56
|
+
assignees: { user: Member }[]
|
|
57
|
+
subtasks: Subtask[]
|
|
58
|
+
reviewRequests: ReviewRequest[]
|
|
59
|
+
comments: Comment[] (optional)
|
|
60
|
+
files: TaskFile[]
|
|
61
|
+
createdAt: string
|
|
62
|
+
updatedAt: string
|
|
63
|
+
metadata: Record<string, unknown> (optional)
|
|
64
|
+
|
|
65
|
+
## ExtraTab Shape
|
|
66
|
+
id: string
|
|
67
|
+
label: string
|
|
68
|
+
icon: ReactNode (optional)
|
|
69
|
+
content: ReactNode
|
|
70
|
+
position: 'before' | 'after' (default: 'after')
|
|
71
|
+
|
|
72
|
+
## Built-in Tabs
|
|
73
|
+
subtasks, review, conversation, files, activity
|
|
74
|
+
|
|
75
|
+
## Defaults
|
|
76
|
+
loading=false, clientMode=false, clientEditableFields=['priority','dueDate'], activities=[], extraTabs=[], isUploading=false
|
|
77
|
+
|
|
78
|
+
## Example
|
|
79
|
+
```jsx
|
|
80
|
+
<TaskDetailPanel
|
|
81
|
+
task={selectedTask}
|
|
82
|
+
open={isPanelOpen}
|
|
83
|
+
onOpenChange={setIsPanelOpen}
|
|
84
|
+
columns={projectColumns}
|
|
85
|
+
members={teamMembers}
|
|
86
|
+
activities={auditLog}
|
|
87
|
+
onPropertyUpdate={(field, value) => updateTask(field, value)}
|
|
88
|
+
onPostComment={(content, type) => postComment(content, type)}
|
|
89
|
+
/>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
- Renders as a Sheet (side panel) on the right, 40% width (min 380px).
|
|
94
|
+
- In clientMode, only the Conversation tab is shown. Staff-only tabs (subtasks, review, files, activity) are hidden.
|
|
95
|
+
- In clientMode, title editing is disabled and properties respect clientEditableFields.
|
|
96
|
+
- Title is editable by clicking on it (staff mode only).
|
|
97
|
+
- enrichedComments takes priority over task.comments when both are provided.
|
|
98
|
+
- extraTabs with position="before" render before built-in tabs; default "after" appends them.
|
|
99
|
+
- Forwards ref to SheetContent.
|
|
100
|
+
|
|
101
|
+
## Changes
|
|
102
|
+
### v0.18.0
|
|
103
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# TaskProperties
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/tasks
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: tasks
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
task: TaskData (REQUIRED)
|
|
9
|
+
columns: Column[] (REQUIRED)
|
|
10
|
+
members: Member[] (REQUIRED)
|
|
11
|
+
onUpdate: (field: string, value: unknown) => void (REQUIRED)
|
|
12
|
+
onAssign: (userId: string) => void (REQUIRED)
|
|
13
|
+
onUnassign: (userId: string) => void (REQUIRED)
|
|
14
|
+
readOnly: boolean (default: false)
|
|
15
|
+
editableFields: string[] (field names the client can still edit when readOnly=true)
|
|
16
|
+
renderPriorityIndicator: (props: { priority: string }) => ReactNode
|
|
17
|
+
renderDatePicker: (props: { value: Date | null; onChange: (date: Date | null) => void; placeholder: string; className?: string }) => ReactNode
|
|
18
|
+
onConfirmVisibilityChange: () => void (called when switching to EVERYONE; if omitted, change applies immediately)
|
|
19
|
+
...HTMLAttributes<HTMLDivElement>
|
|
20
|
+
|
|
21
|
+
## TaskData Shape
|
|
22
|
+
id: string
|
|
23
|
+
columnId: string
|
|
24
|
+
column: { id: string; name: string }
|
|
25
|
+
ownerId: string | null
|
|
26
|
+
owner: Member | null
|
|
27
|
+
assignees: { user: Member }[]
|
|
28
|
+
priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
|
|
29
|
+
dueDate: string | null
|
|
30
|
+
labels: string[]
|
|
31
|
+
visibility: 'INTERNAL' | 'EVERYONE'
|
|
32
|
+
|
|
33
|
+
## Member Shape
|
|
34
|
+
id: string
|
|
35
|
+
name: string
|
|
36
|
+
email: string (optional)
|
|
37
|
+
image: string | null (optional)
|
|
38
|
+
|
|
39
|
+
## Column Shape
|
|
40
|
+
id: string
|
|
41
|
+
name: string
|
|
42
|
+
isDefault: boolean (optional)
|
|
43
|
+
isTerminal: boolean (optional)
|
|
44
|
+
|
|
45
|
+
## Property Rows
|
|
46
|
+
Column — popover picker
|
|
47
|
+
Owner — MemberPicker (hidden in readOnly mode)
|
|
48
|
+
Assignees — MemberPicker (multi-select), pill chips with remove
|
|
49
|
+
Priority — popover picker with dot color indicators
|
|
50
|
+
Due Date — native date input or custom renderDatePicker
|
|
51
|
+
Labels — pill chips with add/remove inline input
|
|
52
|
+
Visibility — toggle button (Internal / Everyone, hidden in readOnly mode)
|
|
53
|
+
|
|
54
|
+
## Defaults
|
|
55
|
+
readOnly=false
|
|
56
|
+
|
|
57
|
+
## Example
|
|
58
|
+
```jsx
|
|
59
|
+
<TaskProperties
|
|
60
|
+
task={taskData}
|
|
61
|
+
columns={columns}
|
|
62
|
+
members={members}
|
|
63
|
+
onUpdate={(field, value) => updateTask(field, value)}
|
|
64
|
+
onAssign={(userId) => assignUser(userId)}
|
|
65
|
+
onUnassign={(userId) => unassignUser(userId)}
|
|
66
|
+
/>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Gotchas
|
|
70
|
+
- In readOnly mode, Owner and Visibility rows are completely hidden.
|
|
71
|
+
- editableFields only applies when readOnly=true (e.g. ['priority', 'dueDate'] lets clients change those).
|
|
72
|
+
- onUpdate field values: 'columnId', 'ownerId', 'priority', 'dueDate', 'labels', 'visibility'.
|
|
73
|
+
- Uses MemberPicker from core composed library for owner/assignee selection.
|
|
74
|
+
- onConfirmVisibilityChange is a guard hook: when provided and user switches to EVERYONE, it is called instead of onUpdate, allowing a confirmation dialog.
|
|
75
|
+
- Forwards ref to outer div.
|
|
76
|
+
|
|
77
|
+
## Changes
|
|
78
|
+
### v0.18.0
|
|
79
|
+
- **Added** Initial release
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devalok/shilp-sutra-karm",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Domain components for Karm — board, tasks, chat, dashboard, client, and admin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,10 +45,12 @@
|
|
|
45
45
|
"import": "./dist/admin/index.js",
|
|
46
46
|
"default": "./dist/admin/index.js",
|
|
47
47
|
"types": "./dist/admin/index.d.ts"
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"./docs/*": "./docs/components/*"
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"dist",
|
|
53
|
+
"docs/components",
|
|
52
54
|
"README.md",
|
|
53
55
|
"llms.txt"
|
|
54
56
|
],
|