@devalok/shilp-sutra-karm 0.18.0 → 0.19.0

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 (115) hide show
  1. package/dist/_chunks/task-detail-panel.js +1339 -1144
  2. package/dist/tasks/activity-tab.d.ts +2 -11
  3. package/dist/tasks/activity-tab.d.ts.map +1 -1
  4. package/dist/tasks/conversation-tab.d.ts +2 -21
  5. package/dist/tasks/conversation-tab.d.ts.map +1 -1
  6. package/dist/tasks/files-tab.d.ts +2 -18
  7. package/dist/tasks/files-tab.d.ts.map +1 -1
  8. package/dist/tasks/index.d.ts +12 -6
  9. package/dist/tasks/index.d.ts.map +1 -1
  10. package/dist/tasks/index.js +765 -8
  11. package/dist/tasks/pickers/index.d.ts +16 -0
  12. package/dist/tasks/pickers/index.d.ts.map +1 -0
  13. package/dist/tasks/pickers/task-assignee-picker.d.ts +14 -0
  14. package/dist/tasks/pickers/task-assignee-picker.d.ts.map +1 -0
  15. package/dist/tasks/pickers/task-column-picker.d.ts +13 -0
  16. package/dist/tasks/pickers/task-column-picker.d.ts.map +1 -0
  17. package/dist/tasks/pickers/task-date-picker.d.ts +12 -0
  18. package/dist/tasks/pickers/task-date-picker.d.ts.map +1 -0
  19. package/dist/tasks/pickers/task-label-editor.d.ts +13 -0
  20. package/dist/tasks/pickers/task-label-editor.d.ts.map +1 -0
  21. package/dist/tasks/pickers/task-member-picker.d.ts +14 -0
  22. package/dist/tasks/pickers/task-member-picker.d.ts.map +1 -0
  23. package/dist/tasks/pickers/task-priority-picker.d.ts +12 -0
  24. package/dist/tasks/pickers/task-priority-picker.d.ts.map +1 -0
  25. package/dist/tasks/pickers/task-visibility-picker.d.ts +13 -0
  26. package/dist/tasks/pickers/task-visibility-picker.d.ts.map +1 -0
  27. package/dist/tasks/review-tab.d.ts +4 -20
  28. package/dist/tasks/review-tab.d.ts.map +1 -1
  29. package/dist/tasks/subtasks-tab.d.ts +2 -18
  30. package/dist/tasks/subtasks-tab.d.ts.map +1 -1
  31. package/dist/tasks/tabs/activity-entry.d.ts +9 -0
  32. package/dist/tasks/tabs/activity-entry.d.ts.map +1 -0
  33. package/dist/tasks/tabs/activity-timeline.d.ts +8 -0
  34. package/dist/tasks/tabs/activity-timeline.d.ts.map +1 -0
  35. package/dist/tasks/tabs/file-drop-zone.d.ts +10 -0
  36. package/dist/tasks/tabs/file-drop-zone.d.ts.map +1 -0
  37. package/dist/tasks/tabs/file-item.d.ts +11 -0
  38. package/dist/tasks/tabs/file-item.d.ts.map +1 -0
  39. package/dist/tasks/tabs/file-list.d.ts +8 -0
  40. package/dist/tasks/tabs/file-list.d.ts.map +1 -0
  41. package/dist/tasks/tabs/index.d.ts +34 -0
  42. package/dist/tasks/tabs/index.d.ts.map +1 -0
  43. package/dist/tasks/tabs/message-bubble.d.ts +14 -0
  44. package/dist/tasks/tabs/message-bubble.d.ts.map +1 -0
  45. package/dist/tasks/tabs/message-input.d.ts +16 -0
  46. package/dist/tasks/tabs/message-input.d.ts.map +1 -0
  47. package/dist/tasks/tabs/message-list.d.ts +9 -0
  48. package/dist/tasks/tabs/message-list.d.ts.map +1 -0
  49. package/dist/tasks/tabs/review-card.d.ts +10 -0
  50. package/dist/tasks/tabs/review-card.d.ts.map +1 -0
  51. package/dist/tasks/tabs/review-request-button.d.ts +10 -0
  52. package/dist/tasks/tabs/review-request-button.d.ts.map +1 -0
  53. package/dist/tasks/tabs/review-response-form.d.ts +11 -0
  54. package/dist/tasks/tabs/review-response-form.d.ts.map +1 -0
  55. package/dist/tasks/tabs/subtask-add-form.d.ts +9 -0
  56. package/dist/tasks/tabs/subtask-add-form.d.ts.map +1 -0
  57. package/dist/tasks/tabs/subtask-item.d.ts +12 -0
  58. package/dist/tasks/tabs/subtask-item.d.ts.map +1 -0
  59. package/dist/tasks/tabs/subtask-list.d.ts +8 -0
  60. package/dist/tasks/tabs/subtask-list.d.ts.map +1 -0
  61. package/dist/tasks/tabs/subtask-progress.d.ts +9 -0
  62. package/dist/tasks/tabs/subtask-progress.d.ts.map +1 -0
  63. package/dist/tasks/tabs/visibility-warning.d.ts +7 -0
  64. package/dist/tasks/tabs/visibility-warning.d.ts.map +1 -0
  65. package/dist/tasks/task-panel.d.ts +104 -0
  66. package/dist/tasks/task-panel.d.ts.map +1 -0
  67. package/dist/tasks/task-properties.d.ts +2 -12
  68. package/dist/tasks/task-properties.d.ts.map +1 -1
  69. package/dist/tasks/task-types.d.ts +104 -0
  70. package/dist/tasks/task-types.d.ts.map +1 -0
  71. package/docs/components/admin/admin-dashboard.md +215 -0
  72. package/docs/components/admin/admin-types.md +167 -0
  73. package/docs/components/admin/admin-utils.md +165 -0
  74. package/docs/components/admin/break-admin.md +167 -0
  75. package/docs/components/board/board-column.md +35 -0
  76. package/docs/components/board/board-provider.md +89 -0
  77. package/docs/components/board/board-toolbar.md +36 -0
  78. package/docs/components/board/board-types.md +62 -0
  79. package/docs/components/board/bulk-action-bar.md +38 -0
  80. package/docs/components/board/column-empty.md +33 -0
  81. package/docs/components/board/column-header.md +36 -0
  82. package/docs/components/board/kanban-board.md +53 -0
  83. package/docs/components/board/task-card.md +62 -0
  84. package/docs/components/board/task-context-menu.md +36 -0
  85. package/docs/components/chat/chat-input.md +37 -0
  86. package/docs/components/chat/chat-panel.md +58 -0
  87. package/docs/components/chat/conversation-list.md +47 -0
  88. package/docs/components/chat/message-list.md +44 -0
  89. package/docs/components/chat/streaming-text.md +29 -0
  90. package/docs/components/client/accent-provider.md +29 -0
  91. package/docs/components/client/client-portal-header.md +40 -0
  92. package/docs/components/client/project-card.md +39 -0
  93. package/docs/components/dashboard/attendance-cta.md +47 -0
  94. package/docs/components/dashboard/daily-brief.md +45 -0
  95. package/docs/components/dashboard/scratchpad-widget.md +52 -0
  96. package/docs/components/dashboard/sidebar-scratchpad.md +39 -0
  97. package/docs/components/other/karm-command-registry.md +61 -0
  98. package/docs/components/other/page-skeletons.md +52 -0
  99. package/docs/components/tasks/activity-tab.md +45 -0
  100. package/docs/components/tasks/conversation-tab.md +56 -0
  101. package/docs/components/tasks/files-tab.md +55 -0
  102. package/docs/components/tasks/review-tab.md +53 -0
  103. package/docs/components/tasks/subtasks-tab.md +61 -0
  104. package/docs/components/tasks/task-assignee-picker.md +36 -0
  105. package/docs/components/tasks/task-column-picker.md +37 -0
  106. package/docs/components/tasks/task-date-picker.md +49 -0
  107. package/docs/components/tasks/task-detail-panel.md +275 -0
  108. package/docs/components/tasks/task-label-editor.md +42 -0
  109. package/docs/components/tasks/task-member-picker.md +35 -0
  110. package/docs/components/tasks/task-panel.md +89 -0
  111. package/docs/components/tasks/task-priority-picker.md +37 -0
  112. package/docs/components/tasks/task-properties.md +84 -0
  113. package/docs/components/tasks/task-visibility-picker.md +38 -0
  114. package/llms.txt +40 -13
  115. package/package.json +82 -80
@@ -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,62 @@
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
+ > **Note:** These are INTERNAL visual states derived from board context (selectedTaskIds, focusedTaskId, highlightMyTasks, drag state, task.isBlocked). Consumers only pass `task: BoardTask` and standard HTML attributes — the component resolves variant values internally.
30
+
31
+ ## Compact Card Variants (CVA)
32
+ selected: boolean (default: false)
33
+ dimmed: boolean (default: false)
34
+
35
+ > **Note:** Same as above — these are INTERNAL visual states. Consumers only pass `task: BoardTask` and standard HTML attributes.
36
+
37
+ ## Example
38
+ ```jsx
39
+ {/* Used automatically by BoardColumn based on viewMode */}
40
+ <TaskCard task={task} />
41
+ <TaskCardCompact task={task} />
42
+
43
+ {/* Overlay variants used inside DragOverlay */}
44
+ <TaskCardOverlay task={task} />
45
+ <TaskCardCompactOverlay task={task} />
46
+ ```
47
+
48
+ ## Visual Elements
49
+ - 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)
50
+ - Compact card: single row with priority icon, taskId, title (1-line clamp), subtask count, lead avatar
51
+
52
+ ## Gotchas
53
+ - Must be rendered inside a BoardProvider context (reads selectedTaskIds, focusedTaskId, currentUserId, highlightMyTasks, onClickTask).
54
+ - TaskCard and TaskCardCompact use @dnd-kit useSortable hooks internally for drag-and-drop.
55
+ - TaskCardOverlay and TaskCardCompactOverlay have NO sortable hooks — they are for DragOverlay only.
56
+ - Selection checkbox appears on hover or when any tasks are selected.
57
+ - highlightMyTasks dims cards where the current user is not owner or assignee.
58
+ - All four variants forward ref.
59
+
60
+ ## Changes
61
+ ### v0.18.0
62
+ - **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
@@ -0,0 +1,58 @@
1
+ # ChatPanel
2
+
3
+ - Import: @devalok/shilp-sutra-karm/chat
4
+ - Server-safe: No
5
+ - Category: chat
6
+
7
+ ## Props
8
+ isOpen: boolean (REQUIRED)
9
+ onOpenChange: (open: boolean) => void (REQUIRED)
10
+ messages: ChatMessage[] (REQUIRED)
11
+ conversations: Conversation[] (REQUIRED)
12
+ agents: Agent[] (default: DEFAULT_AGENTS — Devadoot, Prahari, Sutradhar, Sahayak, Vidwan, Sanchalak, Dwar-Palak)
13
+ selectedAgentId: string (default: "devadoot")
14
+ activeConversationId: string | null
15
+ isStreaming: boolean (default: false)
16
+ streamingText: string (default: "")
17
+ isLoadingMessages: boolean (default: false)
18
+ isLoadingConversations: boolean (default: false)
19
+ onSendMessage: (message: string) => void (REQUIRED)
20
+ onCancelStream: () => void
21
+ onSelectAgent: (agentId: string) => void
22
+ onStartNewChat: () => void
23
+ onSelectConversation: (id: string) => void
24
+ onArchiveConversation: (id: string) => void
25
+ onDeleteConversation: (id: string) => void
26
+ className: string
27
+
28
+ ## Related Types
29
+ Agent: { id: string; name: string; desc: string }
30
+ ChatMessage: { id: string; role: "USER" | "ASSISTANT" | "SYSTEM"; content: string }
31
+ Conversation: { id: string; title: string | null; updatedAt: string }
32
+
33
+ ## Defaults
34
+ agents=DEFAULT_AGENTS, selectedAgentId="devadoot", isStreaming=false, streamingText="", isLoadingMessages=false, isLoadingConversations=false
35
+
36
+ ## Example
37
+ ```jsx
38
+ <ChatPanel
39
+ isOpen={chatOpen}
40
+ onOpenChange={setChatOpen}
41
+ messages={messages}
42
+ conversations={conversations}
43
+ selectedAgentId="devadoot"
44
+ onSendMessage={(msg) => sendMessage(msg)}
45
+ onSelectConversation={(id) => loadConversation(id)}
46
+ />
47
+ ```
48
+
49
+ ## Gotchas
50
+ - Renders inside a Sheet (right side panel), capped at 480px max-width
51
+ - Toggles between MessageList (chat view) and ConversationList (history view) internally
52
+ - The Agent type is exported from this module — use it for custom agent arrays
53
+ - ChatMessage and Conversation types are re-exported from message-list and conversation-list respectively
54
+ - Extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> — children are not accepted
55
+
56
+ ## Changes
57
+ ### v0.18.0
58
+ - **Added** Initial release
@@ -0,0 +1,47 @@
1
+ # ConversationList
2
+
3
+ - Import: @devalok/shilp-sutra-karm/chat
4
+ - Server-safe: No
5
+ - Category: chat
6
+
7
+ ## Props
8
+ conversations: Conversation[] (REQUIRED)
9
+ activeConversationId: string | null
10
+ isLoading: boolean (default: false)
11
+ onSelect: (id: string) => void (REQUIRED)
12
+ onNewChat: () => void (REQUIRED)
13
+ onArchive: (id: string) => void
14
+ onDelete: (id: string) => void
15
+ className: string
16
+
17
+ ## Related Types
18
+ Conversation: { id: string; title: string | null; updatedAt: string }
19
+
20
+ ## Defaults
21
+ isLoading=false
22
+
23
+ ## Example
24
+ ```jsx
25
+ <ConversationList
26
+ conversations={conversations}
27
+ activeConversationId={currentConvoId}
28
+ onSelect={(id) => loadConversation(id)}
29
+ onNewChat={() => startNewChat()}
30
+ onArchive={(id) => archiveConversation(id)}
31
+ onDelete={(id) => deleteConversation(id)}
32
+ />
33
+ ```
34
+
35
+ ## Gotchas
36
+ - Extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> — the native onSelect is replaced
37
+ - Archive and delete buttons appear on hover for each conversation row
38
+ - If onArchive or onDelete are not provided, the corresponding action buttons are hidden
39
+ - Conversations with null title display as "Untitled conversation"
40
+ - updatedAt is formatted using formatRelativeTime (e.g., "2 hours ago")
41
+ - The active conversation is highlighted with bg-surface-2
42
+ - Shows a loading spinner when isLoading=true
43
+ - Shows "No conversations yet" empty state when the array is empty
44
+
45
+ ## Changes
46
+ ### v0.18.0
47
+ - **Added** Initial release
@@ -0,0 +1,44 @@
1
+ # MessageList
2
+
3
+ - Import: @devalok/shilp-sutra-karm/chat
4
+ - Server-safe: No
5
+ - Category: chat
6
+
7
+ ## Props
8
+ messages: ChatMessage[] (REQUIRED)
9
+ isStreaming: boolean (default: false)
10
+ streamingText: string (default: "")
11
+ isLoadingMessages: boolean (default: false)
12
+ emptyTitle: string (default: "Karm AI")
13
+ emptyDescription: string (default: "Ask me about tasks, projects, attendance, or anything else.")
14
+ className: string
15
+
16
+ ## Related Types
17
+ ChatMessage: { id: string; role: "USER" | "ASSISTANT" | "SYSTEM"; content: string }
18
+
19
+ ## Defaults
20
+ isStreaming=false, streamingText="", isLoadingMessages=false, emptyTitle="Karm AI", emptyDescription="Ask me about tasks, projects, attendance, or anything else."
21
+
22
+ ## Example
23
+ ```jsx
24
+ <MessageList
25
+ messages={messages}
26
+ isStreaming={isStreaming}
27
+ streamingText={currentStreamText}
28
+ isLoadingMessages={loading}
29
+ />
30
+ ```
31
+
32
+ ## Gotchas
33
+ - Auto-scrolls to bottom when messages or streamingText change
34
+ - Three message roles render differently: USER (right-aligned, accent bubble), ASSISTANT (left-aligned, markdown-rendered), SYSTEM (centered, error-styled)
35
+ - When isStreaming=true and streamingText is non-empty, renders a StreamingText component below the message list
36
+ - When isStreaming=true and streamingText is empty, shows animated bouncing dots
37
+ - ASSISTANT messages are rendered with ReactMarkdown — supports markdown formatting
38
+ - Shows a loading spinner when isLoadingMessages=true
39
+ - Shows an empty state with robot icon when no messages and not streaming
40
+ - Uses framer-motion AnimatePresence for enter/exit animations
41
+
42
+ ## Changes
43
+ ### v0.18.0
44
+ - **Added** Initial release
@@ -0,0 +1,29 @@
1
+ # StreamingText
2
+
3
+ - Import: @devalok/shilp-sutra-karm/chat
4
+ - Server-safe: No
5
+ - Category: chat
6
+
7
+ ## Props
8
+ text: string (REQUIRED)
9
+ isComplete: boolean (default: false)
10
+ className: string
11
+
12
+ ## Defaults
13
+ isComplete=false
14
+
15
+ ## Example
16
+ ```jsx
17
+ <StreamingText text={partialResponse} isComplete={!isStreaming} />
18
+ ```
19
+
20
+ ## Gotchas
21
+ - Shows a pulsing cursor block after the text while isComplete=false
22
+ - When isComplete=true, the cursor disappears and the full text is announced to screen readers via aria-live="polite"
23
+ - While streaming (isComplete=false), the sr-only announcement span outputs an empty string — aria-live='polite' is always present on the inner span but announces nothing until isComplete=true. The outer container always carries aria-live='off'.
24
+ - Text is rendered with ReactMarkdown — supports markdown formatting
25
+ - Extends React.HTMLAttributes<HTMLDivElement>
26
+
27
+ ## Changes
28
+ ### v0.18.0
29
+ - **Added** Initial release
@@ -0,0 +1,29 @@
1
+ # AccentProvider
2
+
3
+ - Import: @devalok/shilp-sutra-karm/client
4
+ - Server-safe: No
5
+ - Category: client
6
+
7
+ ## Props
8
+ accentCss: string | null (default: undefined)
9
+
10
+ ## Defaults
11
+ (no visual defaults — renders nothing)
12
+
13
+ ## Example
14
+ ```jsx
15
+ <AccentProvider accentCss="--color-accent: #d33163; --color-accent-light: #f7e9e9;" />
16
+ ```
17
+
18
+ ## Gotchas
19
+ - Renders null — this is a headless component with no visual output
20
+ - Does NOT accept children — it is not a wrapper/provider component in the React context sense
21
+ - Injects CSS custom properties directly onto document.documentElement via useEffect
22
+ - Properties are cleaned up (removed) when the component unmounts or when accentCss changes
23
+ - Pass a semicolon-separated CSS custom property string (e.g., "--color-accent: #d33163; --color-accent-light: #f7e9e9;")
24
+ - If accentCss is null or undefined, no properties are applied
25
+ - Does NOT extend React.HTMLAttributes — only accepts the accentCss prop
26
+
27
+ ## Changes
28
+ ### v0.18.0
29
+ - **Added** Initial release
@@ -0,0 +1,40 @@
1
+ # ClientPortalHeader
2
+
3
+ - Import: @devalok/shilp-sutra-karm/client
4
+ - Server-safe: No
5
+ - Category: client
6
+
7
+ ## Props
8
+ orgName: string (REQUIRED)
9
+ orgLogo?: string | null
10
+ userName: string (REQUIRED)
11
+ userAvatar?: string | null
12
+ children: ReactNode
13
+ className: string
14
+
15
+ ## Defaults
16
+ (no prop defaults)
17
+
18
+ ## Example
19
+ ```jsx
20
+ <ClientPortalHeader
21
+ orgName="Acme Corp"
22
+ orgLogo="/logos/acme.png"
23
+ userName="Jane Doe"
24
+ userAvatar="/avatars/jane.jpg"
25
+ >
26
+ <Button variant="ghost" size="sm">Settings</Button>
27
+ </ClientPortalHeader>
28
+ ```
29
+
30
+ ## Gotchas
31
+ - Renders a <header> element — extends React.HTMLAttributes<HTMLElement>
32
+ - If orgLogo is null/undefined, shows a fallback with the first two initials of orgName on an accent background
33
+ - If userAvatar is null/undefined, shows an Avatar fallback with the first two initials of userName
34
+ - children are rendered between the org branding (left) and user avatar (right) — use this slot for action buttons or navigation
35
+ - The user's full name is hidden on small screens (shown only on sm: and above)
36
+ - Fixed height of h-ds-lg with bottom border
37
+
38
+ ## Changes
39
+ ### v0.18.0
40
+ - **Added** Initial release
@@ -0,0 +1,39 @@
1
+ # ProjectCard
2
+
3
+ - Import: @devalok/shilp-sutra-karm/client
4
+ - Server-safe: No
5
+ - Category: client
6
+
7
+ ## Props
8
+ name: string (REQUIRED)
9
+ description: string | null
10
+ status: "active" | "completed" | "paused" (REQUIRED)
11
+ taskCount: number (default: 0)
12
+ completedTasks: number (default: 0)
13
+ className: string
14
+
15
+ ## Defaults
16
+ taskCount=0, completedTasks=0
17
+
18
+ ## Example
19
+ ```jsx
20
+ <ProjectCard
21
+ name="Website Redesign"
22
+ description="Complete overhaul of the marketing site"
23
+ status="active"
24
+ taskCount={24}
25
+ completedTasks={18}
26
+ />
27
+ ```
28
+
29
+ ## Gotchas
30
+ - Status maps to Badge colors: active=success, completed=info, paused=warning
31
+ - Progress bar shows completedTasks/taskCount as a percentage (rounded)
32
+ - If taskCount is 0, progress is 0% regardless of completedTasks
33
+ - Description is clamped to 2 lines with line-clamp-2
34
+ - Has cursor-pointer and hover shadow — attach onClick via spread props for navigation
35
+ - Extends React.HTMLAttributes<HTMLDivElement>
36
+
37
+ ## Changes
38
+ ### v0.18.0
39
+ - **Added** Initial release
@@ -0,0 +1,47 @@
1
+ # AttendanceCTA
2
+
3
+ - Import: @devalok/shilp-sutra-karm/dashboard
4
+ - Server-safe: No
5
+ - Category: dashboard
6
+
7
+ ## Props
8
+ userName: string (REQUIRED)
9
+ attendance: AttendanceData | null (REQUIRED)
10
+ canMarkAttendance: boolean (REQUIRED)
11
+ onMarkAttendance: () => void
12
+ isSubmitting: boolean (default: false)
13
+ formatTime: (timeStr: string) => string (default: IST toLocaleTimeString)
14
+ className: string
15
+
16
+ ## Related Types
17
+ AttendanceData: { attendance: { id: string; status: string; timeIn: string | null; timeOut: string | null }; breakReason: string | null }
18
+
19
+ ## Defaults
20
+ isSubmitting=false, formatTime=defaultFormatTime (IST, 12-hour)
21
+
22
+ ## Example
23
+ ```jsx
24
+ <AttendanceCTA
25
+ userName="Mudit Sharma"
26
+ attendance={attendanceData}
27
+ canMarkAttendance={true}
28
+ onMarkAttendance={() => markAttendance()}
29
+ isSubmitting={isMarking}
30
+ />
31
+ ```
32
+
33
+ ## Gotchas
34
+ - Renders four different states based on attendance data:
35
+ 1. **Unmarked + canMark**: Large greeting card with gradient background and "Mark Attendance" button
36
+ 2. **Marked (PRESENT)**: Greeting card with success badge showing check-in time
37
+ 3. **On Break (BREAK)**: Greeting card with warning badge showing break reason
38
+ 4. **Unmarked + cannot mark**: Greeting card with "Attendance window closed" info badge (no Mark button)
39
+ - Greeting is time-based: "Good morning" (before 12), "Good afternoon" (12-17), "Good evening" (after 17)
40
+ - Only the first name (split on space) is displayed in the greeting
41
+ - Date is formatted in en-IN locale with IST timezone
42
+ - The default formatTime uses en-IN locale with IST timezone and 12-hour format
43
+ - Extends React.HTMLAttributes<HTMLDivElement>
44
+
45
+ ## Changes
46
+ ### v0.18.0
47
+ - **Added** Initial release
@@ -0,0 +1,45 @@
1
+ # DailyBrief
2
+
3
+ - Import: @devalok/shilp-sutra-karm/dashboard
4
+ - Server-safe: No
5
+ - Category: dashboard
6
+
7
+ ## Props
8
+ data: BriefData | null (REQUIRED)
9
+ loading: boolean (default: false)
10
+ onRefresh: () => void
11
+ unavailable: boolean (default: false)
12
+ collapsible: boolean (default: true)
13
+ defaultCollapsed: boolean (default: false)
14
+ title?: string (default: "Morning Brief")
15
+ className: string
16
+
17
+ ## Related Types
18
+ BriefData: { brief: string[]; generatedAt: string }
19
+
20
+ ## Defaults
21
+ loading=false, unavailable=false, collapsible=true, defaultCollapsed=false, title="Morning Brief"
22
+
23
+ ## Example
24
+ ```jsx
25
+ <DailyBrief
26
+ data={{ brief: ["3 tasks due today", "Team standup at 10am"], generatedAt: new Date().toISOString() }}
27
+ onRefresh={() => refetchBrief()}
28
+ loading={isRefreshing}
29
+ />
30
+ ```
31
+
32
+ ## Gotchas
33
+ - Returns null if data is null or data.brief is empty (and not loading/unavailable)
34
+ - When loading=true and data is null, shows a shimmer skeleton placeholder
35
+ - When unavailable=true, shows a minimal "AI brief unavailable" strip
36
+ - Each brief item is rendered with ReactMarkdown — supports inline markdown (bold, code, links)
37
+ - Brief items get rotating colored dots (amber, teal, cyan, accent)
38
+ - Shows "Generated X ago" timestamp using formatRelativeTime
39
+ - The refresh button only appears when onRefresh is provided; it spins while loading=true
40
+ - Collapse/expand uses framer-motion AnimatePresence for smooth height animation
41
+ - Extends React.HTMLAttributes<HTMLDivElement>
42
+
43
+ ## Changes
44
+ ### v0.18.0
45
+ - **Added** Initial release
@@ -0,0 +1,52 @@
1
+ # ScratchpadWidget
2
+
3
+ - Import: @devalok/shilp-sutra-karm/dashboard
4
+ - Server-safe: No
5
+ - Category: dashboard
6
+
7
+ ## Props
8
+ items: ScratchpadItem[] (REQUIRED)
9
+ maxItems: number (default: 5)
10
+ onToggle: (id: string, done: boolean) => void (REQUIRED)
11
+ onAdd: (text: string) => void (REQUIRED)
12
+ onDelete: (id: string) => void (REQUIRED)
13
+ title: string (default: "My Scratchpad")
14
+ resetLabel: string
15
+ emptyText: string (default: "Nothing here yet. Add a task!")
16
+ emptyIcon: React.ComponentType<{ className?: string }>
17
+ loading: boolean (default: false)
18
+ className: string
19
+
20
+ ## Related Types
21
+ ScratchpadItem: { id: string; text: string; done: boolean }
22
+
23
+ ## Defaults
24
+ maxItems=5, title="My Scratchpad", emptyText="Nothing here yet. Add a task!", loading=false
25
+
26
+ ## Example
27
+ ```jsx
28
+ <ScratchpadWidget
29
+ items={scratchpadItems}
30
+ onToggle={(id, done) => toggleItem(id, done)}
31
+ onAdd={(text) => addItem(text)}
32
+ onDelete={(id) => deleteItem(id)}
33
+ maxItems={5}
34
+ />
35
+ ```
36
+
37
+ ## Gotchas
38
+ - Extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> — the native title attribute is replaced by the title prop
39
+ - The "Add a task" input appears only when items.length < maxItems
40
+ - After adding an item, the input stays open for rapid entry; press Escape to close
41
+ - Enter submits the new item; Escape cancels the add flow
42
+ - Blurring the input with empty text closes the add flow
43
+ - Shows a progress ring in the header displaying items.length / maxItems with accent/success color
44
+ - When all items are done, the progress ring pulses with a scale animation
45
+ - Each item has a delete button that appears on hover
46
+ - resetLabel renders as footer text below the item list (e.g., "Resets daily at midnight")
47
+ - When loading=true, shows a shimmer skeleton placeholder
48
+ - Uses framer-motion AnimatePresence for item enter/exit animations
49
+
50
+ ## Changes
51
+ ### v0.18.0
52
+ - **Added** Initial release
@@ -0,0 +1,39 @@
1
+ # SidebarScratchpad
2
+
3
+ - Import: @devalok/shilp-sutra-karm/dashboard
4
+ - Server-safe: No
5
+ - Category: dashboard
6
+
7
+ ## Props
8
+ items: ScratchpadItem[] (REQUIRED)
9
+ onToggle: (id: string, done: boolean) => void (REQUIRED)
10
+ defaultOpen: boolean (default: true)
11
+ badgeCount: number
12
+ className: string
13
+
14
+ ## Related Types
15
+ ScratchpadItem: { id: string; text: string; done: boolean } (imported from scratchpad-widget)
16
+
17
+ ## Defaults
18
+ defaultOpen=true
19
+
20
+ ## Example
21
+ ```jsx
22
+ <SidebarScratchpad
23
+ items={scratchpadItems}
24
+ onToggle={(id, done) => toggleItem(id, done)}
25
+ badgeCount={scratchpadItems.filter(i => !i.done).length}
26
+ />
27
+ ```
28
+
29
+ ## Gotchas
30
+ - This is a compact, read-only version of ScratchpadWidget designed for the app sidebar
31
+ - Does NOT support adding or deleting items — use ScratchpadWidget for full CRUD
32
+ - Only supports toggling done state via checkboxes
33
+ - Collapsible header with chevron; uses CSS grid-rows transition for smooth collapse
34
+ - badgeCount shows a pill badge in the header; hidden when badgeCount is undefined, null, or 0
35
+ - Extends React.HTMLAttributes<HTMLDivElement>
36
+
37
+ ## Changes
38
+ ### v0.18.0
39
+ - **Added** Initial release