@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,167 @@
|
|
|
1
|
+
# BreakAdmin
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/admin
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: admin
|
|
6
|
+
|
|
7
|
+
Compound component for break/leave management admin page. Uses React Context internally.
|
|
8
|
+
Supports both compound usage (with children) and default layout (without children).
|
|
9
|
+
|
|
10
|
+
Exports: BreakAdmin (compound), BreakAdminHeader, Breaks, LeaveRequest, BreakBalance, EditBreak, EditBreakBalance, DeleteBreak, BreakAdminSkeleton
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
### BreakAdmin.Root / BreakAdmin (BreakAdminProps)
|
|
15
|
+
currentUser: Pick<AdminUser, "id" | "name" | "role"> (REQUIRED)
|
|
16
|
+
breaks: BreakRequest[] (REQUIRED)
|
|
17
|
+
pendingRequests: BreakRequest[] (REQUIRED)
|
|
18
|
+
cashoutRequests: BreakRequest[] (default: [])
|
|
19
|
+
breakBalanceData: BreakBalanceData[] (REQUIRED)
|
|
20
|
+
breakBalance: { remainingDays: number; breakBalance: number } | null
|
|
21
|
+
userImages: Record<string, string> (REQUIRED)
|
|
22
|
+
users: AdminUser[] (REQUIRED)
|
|
23
|
+
isLoading: boolean (default: false)
|
|
24
|
+
isLoadingBreaks: boolean (default: false)
|
|
25
|
+
isLoadingRequests: boolean (default: false)
|
|
26
|
+
isLoadingBalance: boolean (default: false)
|
|
27
|
+
existingBreaks: BreakRequest[]
|
|
28
|
+
filters: BreakAdminFilters
|
|
29
|
+
onFilterChange: (filters: BreakAdminFilters) => void
|
|
30
|
+
onApproveRequest: (requestId: string, comment?: string, isCorrection?: boolean, request?: BreakRequest) => void
|
|
31
|
+
onRejectRequest: (requestId: string, comment?: string, isCorrection?: boolean, request?: BreakRequest) => void
|
|
32
|
+
onApproveCashout: (requestId: string) => void
|
|
33
|
+
onRejectCashout: (requestId: string) => void
|
|
34
|
+
onRefresh: () => void
|
|
35
|
+
onSaveBreak: (data: { requestId: string; userId: string; status: string; adminComment: string; startDate: string; endDate: string; isEditing: boolean }) => void
|
|
36
|
+
onDeleteBreak: () => void
|
|
37
|
+
onSaveBalance: (data: { userId: string; cashOutDays: number; carryForward: number; year: number }) => void
|
|
38
|
+
onFetchMonthBreaks: (month: number, year: number) => Promise<BreakRequest[]>
|
|
39
|
+
realtimeCallbacks: RealtimeCallbacks
|
|
40
|
+
children: ReactNode
|
|
41
|
+
...HTMLDivElement attributes
|
|
42
|
+
|
|
43
|
+
### BreakAdmin.Header
|
|
44
|
+
...HTMLDivElement attributes (className, etc.)
|
|
45
|
+
Reads from context: filters, breakBalance, userImages, users
|
|
46
|
+
|
|
47
|
+
### BreakAdmin.TabBar
|
|
48
|
+
...HTMLDivElement attributes
|
|
49
|
+
Reads from context: activeTab, pendingRequests, breakBalanceData
|
|
50
|
+
|
|
51
|
+
### BreakAdmin.BreaksPanel
|
|
52
|
+
...HTMLDivElement attributes
|
|
53
|
+
Reads from context: breaks, userImages, existingBreaks, onFetchMonthBreaks, onSaveBreak, onDeleteBreak, onRefresh
|
|
54
|
+
|
|
55
|
+
### BreakAdmin.RequestsPanel
|
|
56
|
+
...HTMLDivElement attributes
|
|
57
|
+
Reads from context: pendingRequests, userImages, approve/reject handlers
|
|
58
|
+
|
|
59
|
+
### BreakAdmin.BalancePanel
|
|
60
|
+
...HTMLDivElement attributes
|
|
61
|
+
Reads from context: breakBalanceData, userImages, onSaveBalance
|
|
62
|
+
|
|
63
|
+
### BreakAdminHeader (BreakAdminHeaderProps) — standalone
|
|
64
|
+
filters: BreakAdminFilters (REQUIRED)
|
|
65
|
+
onFilterChange: (filters: BreakAdminFilters) => void (REQUIRED)
|
|
66
|
+
breakBalance: { remainingDays: number; breakBalance: number } | null
|
|
67
|
+
userImages: Record<string, string> (REQUIRED)
|
|
68
|
+
users: AdminUser[] (REQUIRED)
|
|
69
|
+
...HTMLDivElement attributes
|
|
70
|
+
|
|
71
|
+
### Breaks (BreaksProps) — standalone
|
|
72
|
+
breaks: BreakRequest[] (REQUIRED)
|
|
73
|
+
userImages: Record<string, string> (REQUIRED)
|
|
74
|
+
existingBreaks: BreakRequest[]
|
|
75
|
+
onFetchMonthBreaks: (month: number, year: number) => Promise<BreakRequest[]>
|
|
76
|
+
onSave: (data: { requestId: string; userId: string; status: string; adminComment: string; startDate: string; endDate: string; isEditing: boolean }) => void
|
|
77
|
+
onDelete: () => void
|
|
78
|
+
onRefresh: () => void
|
|
79
|
+
...HTMLDivElement attributes
|
|
80
|
+
|
|
81
|
+
### LeaveRequest (LeaveRequestProps) — standalone
|
|
82
|
+
request: BreakRequest (REQUIRED)
|
|
83
|
+
userImages: Record<string, string> (REQUIRED)
|
|
84
|
+
handleRejectRequest: (event: MouseEvent | undefined, id: string, comment?: string) => void (REQUIRED)
|
|
85
|
+
handleApproveRequest: (event: MouseEvent | undefined, id: string, comment?: string) => void (REQUIRED)
|
|
86
|
+
commentBoxOpen: boolean (REQUIRED)
|
|
87
|
+
onCommentBoxClose: () => void (REQUIRED)
|
|
88
|
+
clickedAction: "approve" | "reject" | null (REQUIRED)
|
|
89
|
+
userId: string (REQUIRED)
|
|
90
|
+
...HTMLDivElement attributes
|
|
91
|
+
|
|
92
|
+
### BreakBalance (BreakBalanceProps) — standalone
|
|
93
|
+
breakBalanceData: BreakBalanceData[] (REQUIRED)
|
|
94
|
+
userImages: Record<string, string> (REQUIRED)
|
|
95
|
+
onSaveBalance: (data: { userId: string; cashOutDays: number; carryForward: number; year: number }) => void
|
|
96
|
+
...HTMLDivElement attributes
|
|
97
|
+
|
|
98
|
+
### EditBreak (EditBreakProps) — standalone
|
|
99
|
+
selectedLeave: BreakRequest & { numberOfDays: number } (REQUIRED)
|
|
100
|
+
existingBreaks: BreakRequest[]
|
|
101
|
+
onFetchMonthBreaks: (month: number, year: number) => Promise<BreakRequest[]>
|
|
102
|
+
onSave: (data: { requestId: string; userId: string; status: string; adminComment: string; startDate: string; endDate: string; isEditing: boolean }) => void
|
|
103
|
+
onDelete: () => void
|
|
104
|
+
...HTMLDivElement attributes
|
|
105
|
+
|
|
106
|
+
### EditBreakBalance (EditBreakBalanceProps) — standalone
|
|
107
|
+
selectedLeave: BreakBalanceData (REQUIRED)
|
|
108
|
+
onSave: (data: { userId: string; cashOutDays: number; carryForward: number; year: number }) => void
|
|
109
|
+
...HTMLDivElement attributes
|
|
110
|
+
|
|
111
|
+
### DeleteBreak (DeleteBreakProps) — standalone
|
|
112
|
+
id: string (REQUIRED)
|
|
113
|
+
userId: string (REQUIRED)
|
|
114
|
+
onDelete: () => void
|
|
115
|
+
...HTMLDivElement attributes
|
|
116
|
+
|
|
117
|
+
### BreakAdminSkeleton
|
|
118
|
+
...HTMLDivElement attributes (className, etc.)
|
|
119
|
+
|
|
120
|
+
## Supporting Types
|
|
121
|
+
BreakAdminFilters: { selectedAssociate: AdminUser | null; dateFilterStart: string | Date | null; dateFilterEnd: string | Date | null; currMonth: number; currYear: number; isOpen: boolean }
|
|
122
|
+
|
|
123
|
+
## Defaults
|
|
124
|
+
isLoading=false, cashoutRequests=[], isLoadingBreaks=false, isLoadingRequests=false, isLoadingBalance=false
|
|
125
|
+
|
|
126
|
+
## Example
|
|
127
|
+
```jsx
|
|
128
|
+
// Default layout (no children needed)
|
|
129
|
+
<BreakAdmin
|
|
130
|
+
currentUser={{ id: "admin-1", name: "Admin", role: "Admin" }}
|
|
131
|
+
breaks={allBreaks}
|
|
132
|
+
pendingRequests={pending}
|
|
133
|
+
breakBalanceData={balanceData}
|
|
134
|
+
userImages={imageMap}
|
|
135
|
+
users={allUsers}
|
|
136
|
+
isLoading={isLoading}
|
|
137
|
+
onApproveRequest={handleApprove}
|
|
138
|
+
onRejectRequest={handleReject}
|
|
139
|
+
onSaveBreak={handleSaveBreak}
|
|
140
|
+
onSaveBalance={handleSaveBalance}
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
// Compound layout (custom arrangement)
|
|
144
|
+
<BreakAdmin.Root currentUser={user} breaks={b} pendingRequests={p} breakBalanceData={bd} userImages={ui} users={u}>
|
|
145
|
+
<BreakAdmin.Header />
|
|
146
|
+
<BreakAdmin.TabBar />
|
|
147
|
+
<BreakAdmin.BreaksPanel />
|
|
148
|
+
<BreakAdmin.RequestsPanel />
|
|
149
|
+
<BreakAdmin.BalancePanel />
|
|
150
|
+
</BreakAdmin.Root>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Gotchas
|
|
154
|
+
- Without children, renders the default layout (Header + TabBar + all three panels)
|
|
155
|
+
- With children, renders only the provided sub-components — you control the layout
|
|
156
|
+
- Approve/reject with Cmd/Ctrl+click opens a comment box before confirming
|
|
157
|
+
- `BreakAdmin.BreaksPanel` only renders when `activeTab === "breaks"`
|
|
158
|
+
- `BreakAdmin.RequestsPanel` only renders when `activeTab === "requests"`
|
|
159
|
+
- `BreakAdmin.BalancePanel` only renders when `activeTab === "balance"`
|
|
160
|
+
- `isLoading=true` renders `BreakAdminSkeleton` instead of children
|
|
161
|
+
- `onApproveRequest` receives `isCorrection` boolean and the full `request` object as 3rd/4th args
|
|
162
|
+
- Toast notifications fire automatically on approve/reject success or error
|
|
163
|
+
|
|
164
|
+
## Changes
|
|
165
|
+
### v0.9.0
|
|
166
|
+
- **Added** Compound component API replacing monolith
|
|
167
|
+
- **Added** Standalone exports for BreakAdminHeader, Breaks, LeaveRequest, BreakBalance, EditBreak, EditBreakBalance, DeleteBreak
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# BoardColumn
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
column: BoardColumn (REQUIRED)
|
|
9
|
+
index: number (REQUIRED)
|
|
10
|
+
isOverlay: boolean
|
|
11
|
+
dragPreview: { taskId: string; columnId: string; index: number }
|
|
12
|
+
draggedTask: BoardTask | null
|
|
13
|
+
...HTMLAttributes<HTMLDivElement>
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
isOverlay=undefined, dragPreview=undefined, draggedTask=undefined
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<BoardColumn column={column} index={0} />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Gotchas
|
|
24
|
+
- Must be rendered inside a BoardProvider context.
|
|
25
|
+
- Reads viewMode from context to switch between TaskCard and TaskCardCompact.
|
|
26
|
+
- Renders ColumnHeader, TaskContextMenu wrappers, and ColumnEmpty automatically.
|
|
27
|
+
- When column.wipLimit is set and exceeded, the column background turns error-colored.
|
|
28
|
+
- Fixed width defined by COLUMN_WIDTH constant.
|
|
29
|
+
- Forwards ref to outer div.
|
|
30
|
+
- Uses @dnd-kit useDroppable for drop target and SortableContext for task reordering.
|
|
31
|
+
- Ghost silhouette (TaskGhost) is rendered at the dragPreview position during cross-column drags.
|
|
32
|
+
|
|
33
|
+
## Changes
|
|
34
|
+
### v0.18.0
|
|
35
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# BoardProvider
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
initialData: BoardData (REQUIRED)
|
|
9
|
+
currentUserId: string | null (default: null)
|
|
10
|
+
members: BoardMember[] (explicit member list for assignment dropdowns; falls back to deriving from task assignees)
|
|
11
|
+
children: ReactNode (REQUIRED)
|
|
12
|
+
onTaskMove: (taskId: string, toColumnId: string, newOrder: number) => void
|
|
13
|
+
onTaskAdd: (columnId: string, options: NewTaskOptions) => void
|
|
14
|
+
onBulkAction: (action: BulkAction) => void
|
|
15
|
+
onColumnReorder: (columnId: string, newIndex: number) => void
|
|
16
|
+
onColumnRename: (columnId: string, name: string) => void
|
|
17
|
+
onColumnDelete: (columnId: string) => void
|
|
18
|
+
onColumnToggleVisibility: (columnId: string, visible: boolean) => void
|
|
19
|
+
onColumnWipLimitChange: (columnId: string, limit: number | null) => void
|
|
20
|
+
onClickTask: (taskId: string) => void
|
|
21
|
+
onAddColumn: () => void
|
|
22
|
+
onQuickPriorityChange: (taskId: string, priority: string) => void
|
|
23
|
+
onQuickAssign: (taskId: string, userId: string) => void
|
|
24
|
+
onQuickDueDateChange: (taskId: string, date: string | null) => void
|
|
25
|
+
onQuickLabelAdd: (taskId: string, label: string) => void
|
|
26
|
+
onQuickVisibilityChange: (taskId: string, visibility: string) => void
|
|
27
|
+
onQuickDelete: (taskId: string) => void
|
|
28
|
+
|
|
29
|
+
## Defaults
|
|
30
|
+
currentUserId=null
|
|
31
|
+
|
|
32
|
+
## Context Value (useBoardContext)
|
|
33
|
+
columns: BoardColumn[] (filtered)
|
|
34
|
+
rawColumns: BoardColumn[] (unfiltered)
|
|
35
|
+
members: BoardMember[]
|
|
36
|
+
viewMode: BoardViewMode
|
|
37
|
+
setViewMode: (mode: BoardViewMode) => void
|
|
38
|
+
filters: BoardFilters
|
|
39
|
+
setFilters: (updates: Partial<BoardFilters>) => void
|
|
40
|
+
clearFilters: () => void
|
|
41
|
+
hasActiveFilters: boolean
|
|
42
|
+
selectedTaskIds: Set<string>
|
|
43
|
+
toggleTaskSelection: (taskId: string) => void
|
|
44
|
+
selectRange: (fromId: string, toId: string) => void
|
|
45
|
+
selectAll: () => void
|
|
46
|
+
clearSelection: () => void
|
|
47
|
+
focusedTaskId: string | null
|
|
48
|
+
setFocusedTaskId: (id: string | null) => void
|
|
49
|
+
currentUserId: string | null
|
|
50
|
+
highlightMyTasks: boolean
|
|
51
|
+
setHighlightMyTasks: (on: boolean) => void
|
|
52
|
+
activeTask: BoardTask | null
|
|
53
|
+
setActiveTask: (task: BoardTask | null) => void
|
|
54
|
+
|
|
55
|
+
## Example
|
|
56
|
+
```jsx
|
|
57
|
+
<BoardProvider initialData={data} currentUserId="user-1" onTaskMove={handleMove}>
|
|
58
|
+
<BoardToolbar />
|
|
59
|
+
<BulkActionBar />
|
|
60
|
+
{/* custom layout */}
|
|
61
|
+
</BoardProvider>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Gotchas
|
|
65
|
+
- Must wrap all board sub-components (BoardColumn, BoardToolbar, BulkActionBar, etc.).
|
|
66
|
+
- useBoardContext() throws if used outside BoardProvider.
|
|
67
|
+
- All callback props default to no-op internally.
|
|
68
|
+
- columns in context are filtered; use rawColumns for unfiltered data.
|
|
69
|
+
- Syncs with initialData changes via useEffect.
|
|
70
|
+
|
|
71
|
+
## Changes
|
|
72
|
+
### v0.18.0
|
|
73
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# BoardToolbar
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
...HTMLAttributes<HTMLDivElement>
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
- Debounced search input (200ms)
|
|
12
|
+
- Priority filter (multi-select checkbox dropdown: LOW, MEDIUM, HIGH, URGENT)
|
|
13
|
+
- Assignee filter (multi-select checkbox dropdown, derived from board members)
|
|
14
|
+
- Label filter (multi-select checkbox dropdown, derived from task labels)
|
|
15
|
+
- Due date filter (radio: overdue, today, this-week)
|
|
16
|
+
- "Highlight my tasks" toggle button
|
|
17
|
+
- View mode toggle (SegmentedControl: Board / Compact)
|
|
18
|
+
- Active filter chips with individual dismiss and "Clear all" button
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
{/* Rendered automatically by KanbanBoard, or manually inside BoardProvider */}
|
|
23
|
+
<BoardProvider initialData={data}>
|
|
24
|
+
<BoardToolbar />
|
|
25
|
+
</BoardProvider>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
- Must be rendered inside a BoardProvider context.
|
|
30
|
+
- No props needed — all state comes from context.
|
|
31
|
+
- Assignee and Label filter dropdowns only render when members/labels exist.
|
|
32
|
+
- Forwards ref to outer div.
|
|
33
|
+
|
|
34
|
+
## Changes
|
|
35
|
+
### v0.18.0
|
|
36
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Board Types
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Category: board
|
|
5
|
+
|
|
6
|
+
## BoardTask
|
|
7
|
+
id: string
|
|
8
|
+
taskId: string (display ID, e.g. "KRM-42")
|
|
9
|
+
title: string
|
|
10
|
+
priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
|
|
11
|
+
labels: string[]
|
|
12
|
+
dueDate: string | null
|
|
13
|
+
isBlocked: boolean
|
|
14
|
+
visibility: 'INTERNAL' | 'EVERYONE'
|
|
15
|
+
owner: BoardMember | null
|
|
16
|
+
assignees: BoardMember[]
|
|
17
|
+
subtaskCount: number
|
|
18
|
+
subtasksDone: number
|
|
19
|
+
|
|
20
|
+
## BoardMember
|
|
21
|
+
id: string
|
|
22
|
+
name: string
|
|
23
|
+
image: string | null
|
|
24
|
+
|
|
25
|
+
## BoardColumn
|
|
26
|
+
id: string
|
|
27
|
+
name: string
|
|
28
|
+
isClientVisible: boolean (optional)
|
|
29
|
+
wipLimit: number (optional)
|
|
30
|
+
tasks: BoardTask[]
|
|
31
|
+
|
|
32
|
+
## BoardData
|
|
33
|
+
columns: BoardColumn[]
|
|
34
|
+
|
|
35
|
+
## BoardFilters
|
|
36
|
+
search: string
|
|
37
|
+
assignees: string[]
|
|
38
|
+
priorities: string[]
|
|
39
|
+
labels: string[]
|
|
40
|
+
dueDateRange: 'overdue' | 'today' | 'this-week' | 'none' | null
|
|
41
|
+
|
|
42
|
+
## BoardViewMode
|
|
43
|
+
'default' | 'compact'
|
|
44
|
+
|
|
45
|
+
## NewTaskOptions
|
|
46
|
+
title: string
|
|
47
|
+
ownerId: string | null (optional)
|
|
48
|
+
dueDate: string | null (optional)
|
|
49
|
+
|
|
50
|
+
## BulkAction
|
|
51
|
+
type: 'move' | 'priority' | 'assign' | 'label' | 'dueDate' | 'delete' | 'visibility'
|
|
52
|
+
taskIds: string[]
|
|
53
|
+
value: string | null (optional)
|
|
54
|
+
|
|
55
|
+
## Gotchas
|
|
56
|
+
- BoardTask.taskId is the human-readable display ID (e.g. "KRM-42"), not the same as BoardTask.id (database UUID).
|
|
57
|
+
- BoardColumn.wipLimit is optional; when set and exceeded, the column renders in error state.
|
|
58
|
+
- BoardFilters.dueDateRange can be null or 'none' to indicate no filter.
|
|
59
|
+
|
|
60
|
+
## Changes
|
|
61
|
+
### v0.18.0
|
|
62
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# BulkActionBar
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
...HTMLAttributes<HTMLDivElement>
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
- Animates in/out when tasks are selected (AnimatePresence)
|
|
12
|
+
- Shows selection count with clear button
|
|
13
|
+
- Dropdown actions: Move to column, Set priority, Assign, Set visibility
|
|
14
|
+
- Delete button (right-aligned, error-colored)
|
|
15
|
+
- All actions trigger onBulkAction from context then clear selection
|
|
16
|
+
|
|
17
|
+
## Bulk Action Shape
|
|
18
|
+
{ type: 'move' | 'priority' | 'assign' | 'label' | 'dueDate' | 'delete' | 'visibility', taskIds: string[], value?: string | null }
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
{/* Rendered automatically by KanbanBoard, or manually inside BoardProvider */}
|
|
23
|
+
<BoardProvider initialData={data} onBulkAction={handleBulk}>
|
|
24
|
+
<BulkActionBar />
|
|
25
|
+
</BoardProvider>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
- Must be rendered inside a BoardProvider context.
|
|
30
|
+
- No props needed — all state comes from context.
|
|
31
|
+
- Only visible when selectedTaskIds.size > 0.
|
|
32
|
+
- Assign dropdown only renders when members exist.
|
|
33
|
+
- Forwards ref to outer div.
|
|
34
|
+
- Uses aria-live="polite" for screen reader announcements.
|
|
35
|
+
|
|
36
|
+
## Changes
|
|
37
|
+
### v0.18.0
|
|
38
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ColumnEmpty
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
index: number (REQUIRED) — used to cycle through 4 illustration variants
|
|
9
|
+
onAddTask: () => void
|
|
10
|
+
isDropTarget: boolean (default: false)
|
|
11
|
+
...HTMLAttributes<HTMLDivElement>
|
|
12
|
+
|
|
13
|
+
## Defaults
|
|
14
|
+
isDropTarget=false
|
|
15
|
+
|
|
16
|
+
## Illustrations
|
|
17
|
+
Cycles through 4 SVG illustrations by column index:
|
|
18
|
+
0: Clipboard, 1: Stacked Cards, 2: Checkmark Circle, 3: Inbox
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<ColumnEmpty index={0} onAddTask={() => addTask(columnId)} />
|
|
23
|
+
<ColumnEmpty index={1} isDropTarget />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Gotchas
|
|
27
|
+
- When isDropTarget=true, shows "Drop tasks here" text instead of the default empty state with "Add a task" button.
|
|
28
|
+
- Illustrations use currentColor (inherits text-surface-fg-subtle).
|
|
29
|
+
- Forwards ref to outer div.
|
|
30
|
+
|
|
31
|
+
## Changes
|
|
32
|
+
### v0.18.0
|
|
33
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ColumnHeader
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
column: BoardColumn (REQUIRED)
|
|
9
|
+
index: number (REQUIRED)
|
|
10
|
+
...HTMLAttributes<HTMLDivElement>
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
- Color-coded accent dot (cycles through COLUMN_ACCENT_COLORS by index)
|
|
14
|
+
- Column name with task count badge
|
|
15
|
+
- Double-click to rename (inline Input)
|
|
16
|
+
- WIP limit display with exceeded state (error color)
|
|
17
|
+
- Inline WIP limit editor
|
|
18
|
+
- Quick-add task form (title, owner picker, due date picker)
|
|
19
|
+
- Column options dropdown: Rename, Set WIP Limit, Show/Hide from client, Delete column
|
|
20
|
+
- Avatar stack of unique members in the column (AvatarGroup, max 3)
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
```jsx
|
|
24
|
+
{/* Rendered automatically by BoardColumn */}
|
|
25
|
+
<ColumnHeader column={column} index={0} />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
- Must be rendered inside a BoardProvider context.
|
|
30
|
+
- Reads members, onColumnRename, onColumnDelete, onColumnToggleVisibility, onTaskAdd from context.
|
|
31
|
+
- Quick-add form expands with animation (AnimatePresence + framer-motion).
|
|
32
|
+
- Forwards ref to outer div.
|
|
33
|
+
|
|
34
|
+
## Changes
|
|
35
|
+
### v0.18.0
|
|
36
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# KanbanBoard
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
initialData: BoardData (REQUIRED)
|
|
9
|
+
currentUserId: string | null (default: null)
|
|
10
|
+
members: BoardMember[] (explicit member list; falls back to deriving from task assignees)
|
|
11
|
+
onTaskMove: (taskId: string, toColumnId: string, newOrder: number) => void
|
|
12
|
+
onTaskAdd: (columnId: string, options: NewTaskOptions) => void
|
|
13
|
+
onBulkAction: (action: BulkAction) => void
|
|
14
|
+
onColumnReorder: (columnId: string, newIndex: number) => void
|
|
15
|
+
onColumnRename: (columnId: string, name: string) => void
|
|
16
|
+
onColumnDelete: (columnId: string) => void
|
|
17
|
+
onColumnToggleVisibility: (columnId: string, visible: boolean) => void
|
|
18
|
+
onColumnWipLimitChange: (columnId: string, limit: number | null) => void
|
|
19
|
+
onClickTask: (taskId: string) => void
|
|
20
|
+
onAddColumn: () => void
|
|
21
|
+
onQuickPriorityChange: (taskId: string, priority: string) => void
|
|
22
|
+
onQuickAssign: (taskId: string, userId: string) => void
|
|
23
|
+
onQuickDueDateChange: (taskId: string, date: string | null) => void
|
|
24
|
+
onQuickLabelAdd: (taskId: string, label: string) => void
|
|
25
|
+
onQuickVisibilityChange: (taskId: string, visibility: string) => void
|
|
26
|
+
onQuickDelete: (taskId: string) => void
|
|
27
|
+
className: string
|
|
28
|
+
|
|
29
|
+
## Defaults
|
|
30
|
+
currentUserId=null
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
```jsx
|
|
34
|
+
<KanbanBoard
|
|
35
|
+
initialData={{ columns: [...] }}
|
|
36
|
+
currentUserId="user-1"
|
|
37
|
+
members={teamMembers}
|
|
38
|
+
onTaskMove={(taskId, toCol, order) => moveTask(taskId, toCol, order)}
|
|
39
|
+
onClickTask={(taskId) => openDetail(taskId)}
|
|
40
|
+
onAddColumn={() => createColumn()}
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Gotchas
|
|
45
|
+
- This is the top-level orchestrator. It composes BoardProvider, BoardToolbar, BulkActionBar, and BoardColumn internally.
|
|
46
|
+
- All callback props are optional and default to no-op. Wire them up to persist changes.
|
|
47
|
+
- Extends Omit<BoardProviderProps, 'children'> plus className. Forwards ref to outer div.
|
|
48
|
+
- Drag-and-drop uses @dnd-kit (PointerSensor, TouchSensor, KeyboardSensor).
|
|
49
|
+
- The "Add column" button is always rendered at the end of the horizontal scroll area.
|
|
50
|
+
|
|
51
|
+
## Changes
|
|
52
|
+
### v0.18.0
|
|
53
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# TaskCard / TaskCardCompact / TaskCardOverlay / TaskCardCompactOverlay
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## TaskCard Props
|
|
8
|
+
task: BoardTask (REQUIRED)
|
|
9
|
+
...HTMLAttributes<HTMLDivElement>
|
|
10
|
+
|
|
11
|
+
## TaskCardCompact Props
|
|
12
|
+
task: BoardTask (REQUIRED)
|
|
13
|
+
...HTMLAttributes<HTMLDivElement>
|
|
14
|
+
|
|
15
|
+
## TaskCardOverlay Props
|
|
16
|
+
task: BoardTask (REQUIRED)
|
|
17
|
+
...HTMLAttributes<HTMLDivElement>
|
|
18
|
+
|
|
19
|
+
## TaskCardCompactOverlay Props
|
|
20
|
+
task: BoardTask (REQUIRED)
|
|
21
|
+
...HTMLAttributes<HTMLDivElement>
|
|
22
|
+
|
|
23
|
+
## Card Variants (CVA)
|
|
24
|
+
state: "default" | "dragging" | "overlay" (default: "default")
|
|
25
|
+
blocked: boolean (default: false) — adds left error border
|
|
26
|
+
selected: boolean (default: false) — adds accent ring
|
|
27
|
+
dimmed: boolean (default: false) — reduces opacity
|
|
28
|
+
|
|
29
|
+
## Compact Card Variants (CVA)
|
|
30
|
+
selected: boolean (default: false)
|
|
31
|
+
dimmed: boolean (default: false)
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
```jsx
|
|
35
|
+
{/* Used automatically by BoardColumn based on viewMode */}
|
|
36
|
+
<TaskCard task={task} />
|
|
37
|
+
<TaskCardCompact task={task} />
|
|
38
|
+
|
|
39
|
+
{/* Overlay variants used inside DragOverlay */}
|
|
40
|
+
<TaskCardOverlay task={task} />
|
|
41
|
+
<TaskCardCompactOverlay task={task} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Visual Elements
|
|
45
|
+
- Default card: taskId, priority icon, drag handle, title (2-line clamp), due date, subtask count, visibility/blocked badges, avatar stack (owner with glow + up to 3 assignees)
|
|
46
|
+
- Compact card: single row with priority icon, taskId, title (1-line clamp), subtask count, lead avatar
|
|
47
|
+
|
|
48
|
+
## Gotchas
|
|
49
|
+
- Must be rendered inside a BoardProvider context (reads selectedTaskIds, focusedTaskId, currentUserId, highlightMyTasks, onClickTask).
|
|
50
|
+
- TaskCard and TaskCardCompact use @dnd-kit useSortable hooks internally for drag-and-drop.
|
|
51
|
+
- TaskCardOverlay and TaskCardCompactOverlay have NO sortable hooks — they are for DragOverlay only.
|
|
52
|
+
- Selection checkbox appears on hover or when any tasks are selected.
|
|
53
|
+
- highlightMyTasks dims cards where the current user is not owner or assignee.
|
|
54
|
+
- All four variants forward ref.
|
|
55
|
+
|
|
56
|
+
## Changes
|
|
57
|
+
### v0.18.0
|
|
58
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TaskContextMenu
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/board
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: board
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
taskId: string (REQUIRED)
|
|
9
|
+
children: ReactNode (REQUIRED)
|
|
10
|
+
className: string
|
|
11
|
+
|
|
12
|
+
## Menu Items
|
|
13
|
+
- Set Priority (submenu: Low, Medium, High, Urgent with icons)
|
|
14
|
+
- Assign (submenu: member list, only shown when members exist)
|
|
15
|
+
- Add Label (submenu: labels derived from board data)
|
|
16
|
+
- Set Due Date (opens native date picker)
|
|
17
|
+
- Visibility (submenu: Internal only, Visible to all)
|
|
18
|
+
- Delete (destructive, separated by divider)
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
```jsx
|
|
22
|
+
<TaskContextMenu taskId={task.id}>
|
|
23
|
+
<TaskCard task={task} />
|
|
24
|
+
</TaskContextMenu>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Gotchas
|
|
28
|
+
- Must be rendered inside a BoardProvider context.
|
|
29
|
+
- Right-click triggers the context menu via Radix ContextMenu.
|
|
30
|
+
- Callbacks come from context: onQuickPriorityChange, onQuickAssign, onQuickLabelAdd, onQuickDueDateChange, onQuickVisibilityChange, onQuickDelete.
|
|
31
|
+
- Due date uses a hidden native date input with showPicker().
|
|
32
|
+
- Forwards ref to ContextMenuTrigger (HTMLSpanElement).
|
|
33
|
+
|
|
34
|
+
## Changes
|
|
35
|
+
### v0.18.0
|
|
36
|
+
- **Added** Initial release
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# ChatInput
|
|
2
|
+
|
|
3
|
+
- Import: @devalok/shilp-sutra-karm/chat
|
|
4
|
+
- Server-safe: No
|
|
5
|
+
- Category: chat
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
onSubmit: (message: string) => void (REQUIRED)
|
|
9
|
+
onCancel: () => void
|
|
10
|
+
isStreaming: boolean (default: false)
|
|
11
|
+
placeholder: string (default: "Ask Karm AI...")
|
|
12
|
+
disclaimer: string (default: "AI responses may be inaccurate. Verify important information.")
|
|
13
|
+
className: string
|
|
14
|
+
|
|
15
|
+
## Defaults
|
|
16
|
+
isStreaming=false, placeholder="Ask Karm AI...", disclaimer="AI responses may be inaccurate. Verify important information."
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
```jsx
|
|
20
|
+
<ChatInput
|
|
21
|
+
onSubmit={(msg) => sendMessage(msg)}
|
|
22
|
+
onCancel={() => cancelStream()}
|
|
23
|
+
isStreaming={isStreaming}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Gotchas
|
|
28
|
+
- Enter sends the message; Shift+Enter inserts a newline
|
|
29
|
+
- When isStreaming=true, the send button becomes a red stop button that calls onCancel
|
|
30
|
+
- The textarea auto-resizes up to 160px max height
|
|
31
|
+
- Trims whitespace before submitting — empty/whitespace-only messages are blocked
|
|
32
|
+
- Extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSubmit'> — the native onSubmit is replaced
|
|
33
|
+
- Set disclaimer="" (empty string) to hide the disclaimer text
|
|
34
|
+
|
|
35
|
+
## Changes
|
|
36
|
+
### v0.18.0
|
|
37
|
+
- **Added** Initial release
|