@devalok/shilp-sutra-karm 0.18.1 → 0.20.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 (185) hide show
  1. package/dist/_chunks/render-adjustment-type.js +50 -48
  2. package/dist/_chunks/sidebar-scratchpad.js +714 -326
  3. package/dist/_chunks/task-detail-panel.js +1638 -1175
  4. package/dist/_chunks/vendor.js +1154 -1123
  5. package/dist/dashboard/index.d.ts +20 -0
  6. package/dist/dashboard/index.d.ts.map +1 -1
  7. package/dist/dashboard/index.js +451 -5
  8. package/dist/dashboard/project-health-card.d.ts +22 -0
  9. package/dist/dashboard/project-health-card.d.ts.map +1 -0
  10. package/dist/dashboard/scratchpad/index.d.ts +13 -0
  11. package/dist/dashboard/scratchpad/index.d.ts.map +1 -0
  12. package/dist/dashboard/scratchpad/scratchpad-add-input.d.ts +11 -0
  13. package/dist/dashboard/scratchpad/scratchpad-add-input.d.ts.map +1 -0
  14. package/dist/dashboard/scratchpad/scratchpad-collapse.d.ts +15 -0
  15. package/dist/dashboard/scratchpad/scratchpad-collapse.d.ts.map +1 -0
  16. package/dist/dashboard/scratchpad/scratchpad-context.d.ts +44 -0
  17. package/dist/dashboard/scratchpad/scratchpad-context.d.ts.map +1 -0
  18. package/dist/dashboard/scratchpad/scratchpad-empty-state.d.ts +13 -0
  19. package/dist/dashboard/scratchpad/scratchpad-empty-state.d.ts.map +1 -0
  20. package/dist/dashboard/scratchpad/scratchpad-filter-toggle.d.ts +7 -0
  21. package/dist/dashboard/scratchpad/scratchpad-filter-toggle.d.ts.map +1 -0
  22. package/dist/dashboard/scratchpad/scratchpad-header.d.ts +9 -0
  23. package/dist/dashboard/scratchpad/scratchpad-header.d.ts.map +1 -0
  24. package/dist/dashboard/scratchpad/scratchpad-item.d.ts +13 -0
  25. package/dist/dashboard/scratchpad/scratchpad-item.d.ts.map +1 -0
  26. package/dist/dashboard/scratchpad/scratchpad-list.d.ts +9 -0
  27. package/dist/dashboard/scratchpad/scratchpad-list.d.ts.map +1 -0
  28. package/dist/dashboard/scratchpad/scratchpad-progress-ring.d.ts +11 -0
  29. package/dist/dashboard/scratchpad/scratchpad-progress-ring.d.ts.map +1 -0
  30. package/dist/dashboard/scratchpad/scratchpad-root.d.ts +8 -0
  31. package/dist/dashboard/scratchpad/scratchpad-root.d.ts.map +1 -0
  32. package/dist/dashboard/scratchpad/scratchpad.d.ts +29 -0
  33. package/dist/dashboard/scratchpad/scratchpad.d.ts.map +1 -0
  34. package/dist/dashboard/scratchpad-widget.d.ts +5 -5
  35. package/dist/dashboard/scratchpad-widget.d.ts.map +1 -1
  36. package/dist/dashboard/sidebar-scratchpad.d.ts +8 -1
  37. package/dist/dashboard/sidebar-scratchpad.d.ts.map +1 -1
  38. package/dist/dashboard/week-heatmap/index.d.ts +10 -0
  39. package/dist/dashboard/week-heatmap/index.d.ts.map +1 -0
  40. package/dist/dashboard/week-heatmap/week-heatmap-context.d.ts +31 -0
  41. package/dist/dashboard/week-heatmap/week-heatmap-context.d.ts.map +1 -0
  42. package/dist/dashboard/week-heatmap/week-heatmap-day-strip.d.ts +7 -0
  43. package/dist/dashboard/week-heatmap/week-heatmap-day-strip.d.ts.map +1 -0
  44. package/dist/dashboard/week-heatmap/week-heatmap-day.d.ts +15 -0
  45. package/dist/dashboard/week-heatmap/week-heatmap-day.d.ts.map +1 -0
  46. package/dist/dashboard/week-heatmap/week-heatmap-progress-bar.d.ts +7 -0
  47. package/dist/dashboard/week-heatmap/week-heatmap-progress-bar.d.ts.map +1 -0
  48. package/dist/dashboard/week-heatmap/week-heatmap-root.d.ts +8 -0
  49. package/dist/dashboard/week-heatmap/week-heatmap-root.d.ts.map +1 -0
  50. package/dist/dashboard/week-heatmap/week-heatmap-streak.d.ts +7 -0
  51. package/dist/dashboard/week-heatmap/week-heatmap-streak.d.ts.map +1 -0
  52. package/dist/dashboard/week-heatmap/week-heatmap-summary.d.ts +7 -0
  53. package/dist/dashboard/week-heatmap/week-heatmap-summary.d.ts.map +1 -0
  54. package/dist/dashboard/week-heatmap/week-heatmap.d.ts +33 -0
  55. package/dist/dashboard/week-heatmap/week-heatmap.d.ts.map +1 -0
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +57 -56
  59. package/dist/tasks/activity-tab.d.ts +2 -11
  60. package/dist/tasks/activity-tab.d.ts.map +1 -1
  61. package/dist/tasks/conversation-tab.d.ts +2 -21
  62. package/dist/tasks/conversation-tab.d.ts.map +1 -1
  63. package/dist/tasks/files-tab.d.ts +2 -18
  64. package/dist/tasks/files-tab.d.ts.map +1 -1
  65. package/dist/tasks/index.d.ts +13 -6
  66. package/dist/tasks/index.d.ts.map +1 -1
  67. package/dist/tasks/index.js +766 -8
  68. package/dist/tasks/pickers/index.d.ts +16 -0
  69. package/dist/tasks/pickers/index.d.ts.map +1 -0
  70. package/dist/tasks/pickers/task-assignee-picker.d.ts +14 -0
  71. package/dist/tasks/pickers/task-assignee-picker.d.ts.map +1 -0
  72. package/dist/tasks/pickers/task-column-picker.d.ts +13 -0
  73. package/dist/tasks/pickers/task-column-picker.d.ts.map +1 -0
  74. package/dist/tasks/pickers/task-date-picker.d.ts +12 -0
  75. package/dist/tasks/pickers/task-date-picker.d.ts.map +1 -0
  76. package/dist/tasks/pickers/task-label-editor.d.ts +13 -0
  77. package/dist/tasks/pickers/task-label-editor.d.ts.map +1 -0
  78. package/dist/tasks/pickers/task-member-picker.d.ts +14 -0
  79. package/dist/tasks/pickers/task-member-picker.d.ts.map +1 -0
  80. package/dist/tasks/pickers/task-priority-picker.d.ts +12 -0
  81. package/dist/tasks/pickers/task-priority-picker.d.ts.map +1 -0
  82. package/dist/tasks/pickers/task-visibility-picker.d.ts +13 -0
  83. package/dist/tasks/pickers/task-visibility-picker.d.ts.map +1 -0
  84. package/dist/tasks/review-tab.d.ts +4 -20
  85. package/dist/tasks/review-tab.d.ts.map +1 -1
  86. package/dist/tasks/subtasks-tab.d.ts +2 -18
  87. package/dist/tasks/subtasks-tab.d.ts.map +1 -1
  88. package/dist/tasks/tabs/activity-entry.d.ts +9 -0
  89. package/dist/tasks/tabs/activity-entry.d.ts.map +1 -0
  90. package/dist/tasks/tabs/activity-timeline.d.ts +8 -0
  91. package/dist/tasks/tabs/activity-timeline.d.ts.map +1 -0
  92. package/dist/tasks/tabs/file-drop-zone.d.ts +10 -0
  93. package/dist/tasks/tabs/file-drop-zone.d.ts.map +1 -0
  94. package/dist/tasks/tabs/file-item.d.ts +11 -0
  95. package/dist/tasks/tabs/file-item.d.ts.map +1 -0
  96. package/dist/tasks/tabs/file-list.d.ts +8 -0
  97. package/dist/tasks/tabs/file-list.d.ts.map +1 -0
  98. package/dist/tasks/tabs/index.d.ts +34 -0
  99. package/dist/tasks/tabs/index.d.ts.map +1 -0
  100. package/dist/tasks/tabs/message-bubble.d.ts +14 -0
  101. package/dist/tasks/tabs/message-bubble.d.ts.map +1 -0
  102. package/dist/tasks/tabs/message-input.d.ts +16 -0
  103. package/dist/tasks/tabs/message-input.d.ts.map +1 -0
  104. package/dist/tasks/tabs/message-list.d.ts +9 -0
  105. package/dist/tasks/tabs/message-list.d.ts.map +1 -0
  106. package/dist/tasks/tabs/review-card.d.ts +10 -0
  107. package/dist/tasks/tabs/review-card.d.ts.map +1 -0
  108. package/dist/tasks/tabs/review-request-button.d.ts +10 -0
  109. package/dist/tasks/tabs/review-request-button.d.ts.map +1 -0
  110. package/dist/tasks/tabs/review-response-form.d.ts +11 -0
  111. package/dist/tasks/tabs/review-response-form.d.ts.map +1 -0
  112. package/dist/tasks/tabs/subtask-add-form.d.ts +9 -0
  113. package/dist/tasks/tabs/subtask-add-form.d.ts.map +1 -0
  114. package/dist/tasks/tabs/subtask-item.d.ts +12 -0
  115. package/dist/tasks/tabs/subtask-item.d.ts.map +1 -0
  116. package/dist/tasks/tabs/subtask-list.d.ts +8 -0
  117. package/dist/tasks/tabs/subtask-list.d.ts.map +1 -0
  118. package/dist/tasks/tabs/subtask-progress.d.ts +9 -0
  119. package/dist/tasks/tabs/subtask-progress.d.ts.map +1 -0
  120. package/dist/tasks/tabs/visibility-warning.d.ts +7 -0
  121. package/dist/tasks/tabs/visibility-warning.d.ts.map +1 -0
  122. package/dist/tasks/task-action-row/index.d.ts +3 -0
  123. package/dist/tasks/task-action-row/index.d.ts.map +1 -0
  124. package/dist/tasks/task-action-row/task-action-row-checkbox.d.ts +8 -0
  125. package/dist/tasks/task-action-row/task-action-row-checkbox.d.ts.map +1 -0
  126. package/dist/tasks/task-action-row/task-action-row-context.d.ts +21 -0
  127. package/dist/tasks/task-action-row/task-action-row-context.d.ts.map +1 -0
  128. package/dist/tasks/task-action-row/task-action-row-due-date.d.ts +5 -0
  129. package/dist/tasks/task-action-row/task-action-row-due-date.d.ts.map +1 -0
  130. package/dist/tasks/task-action-row/task-action-row-labels.d.ts +8 -0
  131. package/dist/tasks/task-action-row/task-action-row-labels.d.ts.map +1 -0
  132. package/dist/tasks/task-action-row/task-action-row-navigate.d.ts +9 -0
  133. package/dist/tasks/task-action-row/task-action-row-navigate.d.ts.map +1 -0
  134. package/dist/tasks/task-action-row/task-action-row-priority.d.ts +5 -0
  135. package/dist/tasks/task-action-row/task-action-row-priority.d.ts.map +1 -0
  136. package/dist/tasks/task-action-row/task-action-row-project-badge.d.ts +8 -0
  137. package/dist/tasks/task-action-row/task-action-row-project-badge.d.ts.map +1 -0
  138. package/dist/tasks/task-action-row/task-action-row-root.d.ts +14 -0
  139. package/dist/tasks/task-action-row/task-action-row-root.d.ts.map +1 -0
  140. package/dist/tasks/task-action-row/task-action-row-status-badge.d.ts +5 -0
  141. package/dist/tasks/task-action-row/task-action-row-status-badge.d.ts.map +1 -0
  142. package/dist/tasks/task-action-row/task-action-row-title.d.ts +9 -0
  143. package/dist/tasks/task-action-row/task-action-row-title.d.ts.map +1 -0
  144. package/dist/tasks/task-action-row/task-action-row.d.ts +48 -0
  145. package/dist/tasks/task-action-row/task-action-row.d.ts.map +1 -0
  146. package/dist/tasks/task-detail-panel.d.ts.map +1 -1
  147. package/dist/tasks/task-panel.d.ts +104 -0
  148. package/dist/tasks/task-panel.d.ts.map +1 -0
  149. package/dist/tasks/task-properties.d.ts +2 -12
  150. package/dist/tasks/task-properties.d.ts.map +1 -1
  151. package/dist/tasks/task-types.d.ts +104 -0
  152. package/dist/tasks/task-types.d.ts.map +1 -0
  153. package/docs/components/admin/admin-dashboard.md +6 -6
  154. package/docs/components/admin/admin-utils.md +2 -2
  155. package/docs/components/admin/break-admin.md +14 -14
  156. package/docs/components/board/board-provider.md +16 -0
  157. package/docs/components/board/column-empty.md +1 -1
  158. package/docs/components/board/task-card.md +4 -0
  159. package/docs/components/chat/streaming-text.md +1 -1
  160. package/docs/components/client/client-portal-header.md +2 -2
  161. package/docs/components/dashboard/attendance-cta.md +3 -3
  162. package/docs/components/dashboard/daily-brief.md +1 -1
  163. package/docs/components/dashboard/project-health-card.md +90 -0
  164. package/docs/components/dashboard/scratchpad-widget.md +17 -0
  165. package/docs/components/dashboard/scratchpad.md +151 -0
  166. package/docs/components/dashboard/sidebar-scratchpad.md +29 -5
  167. package/docs/components/dashboard/week-heatmap.md +95 -0
  168. package/docs/components/tasks/activity-tab.md +4 -0
  169. package/docs/components/tasks/conversation-tab.md +4 -0
  170. package/docs/components/tasks/files-tab.md +4 -0
  171. package/docs/components/tasks/review-tab.md +5 -1
  172. package/docs/components/tasks/subtasks-tab.md +5 -0
  173. package/docs/components/tasks/task-action-row.md +159 -0
  174. package/docs/components/tasks/task-assignee-picker.md +36 -0
  175. package/docs/components/tasks/task-column-picker.md +37 -0
  176. package/docs/components/tasks/task-date-picker.md +49 -0
  177. package/docs/components/tasks/task-detail-panel.md +256 -84
  178. package/docs/components/tasks/task-label-editor.md +42 -0
  179. package/docs/components/tasks/task-member-picker.md +35 -0
  180. package/docs/components/tasks/task-panel.md +89 -0
  181. package/docs/components/tasks/task-priority-picker.md +37 -0
  182. package/docs/components/tasks/task-properties.md +5 -0
  183. package/docs/components/tasks/task-visibility-picker.md +38 -0
  184. package/llms.txt +40 -13
  185. package/package.json +1 -1
@@ -0,0 +1,90 @@
1
+ # ProjectHealthCard
2
+
3
+ Props-driven card showing project completion progress, status badge, sparkline trend, and context line.
4
+
5
+ - Import: @devalok/shilp-sutra-karm/dashboard
6
+ - Server-safe: No
7
+ - Category: dashboard
8
+
9
+ ## Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ |------|------|---------|-------------|
13
+ | project | ProjectHealthData | REQUIRED | Project data object |
14
+ | onClick | () => void | — | Makes card clickable with hover state and keyboard activation |
15
+ | loading | boolean | false | Shows skeleton placeholder when true |
16
+ | className | string | — | Additional CSS classes |
17
+
18
+ ## Related Types
19
+
20
+ ```typescript
21
+ interface ProjectHealthData {
22
+ id: string
23
+ name: string
24
+ completed: number
25
+ total: number
26
+ overdue?: number
27
+ urgent?: number
28
+ contextLine?: string
29
+ /** 7 values (0-1) for sparkline trend chart */
30
+ trend?: number[]
31
+ }
32
+ ```
33
+
34
+ ## Status Badge Severity
35
+
36
+ | Condition | Badge |
37
+ |-----------|-------|
38
+ | urgent > 0 | `solid` / `error` — "{urgent} urgent" |
39
+ | overdue > 0 (no urgent) | `subtle` / `warning` — "{overdue} overdue" |
40
+ | neither | `subtle` / `success` — "on track" |
41
+
42
+ ## Progress Bar Color
43
+
44
+ | Percentage | Color |
45
+ |------------|-------|
46
+ | > 75% | success |
47
+ | 25%–75% | warning |
48
+ | < 25% | error |
49
+
50
+ ## Sparkline
51
+
52
+ - Rendered as an inline SVG (48x20) when `trend` has >= 2 values
53
+ - Uses Catmull-Rom spline interpolation for smooth curves
54
+ - Color determined by comparing average of first 3 vs last 3 values:
55
+ - Improving (diff > 0.05): success stroke/fill
56
+ - Declining (diff < -0.05): error stroke/fill
57
+ - Flat: warning stroke/fill
58
+ - Fewer than 6 data points always renders warning color
59
+
60
+ ## Defaults
61
+ loading=false
62
+
63
+ ## Example
64
+
65
+ ```tsx
66
+ <ProjectHealthCard
67
+ project={{
68
+ id: 'proj-1',
69
+ name: 'Website Redesign',
70
+ completed: 12,
71
+ total: 20,
72
+ overdue: 3,
73
+ contextLine: 'Sprint 4 of 6',
74
+ trend: [0.3, 0.4, 0.5, 0.55, 0.6, 0.65, 0.7],
75
+ }}
76
+ onClick={() => navigateToProject('proj-1')}
77
+ />
78
+ ```
79
+
80
+ ## Gotchas
81
+ - Extends `Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'>` — native onClick is replaced by the typed onClick prop
82
+ - When `onClick` is provided, the card gets `role="button"`, `tabIndex={0}`, and keyboard activation (Enter/Space)
83
+ - When `onClick` is provided, the card uses `whileTap={{ scale: 0.98 }}` for press feedback
84
+ - `loading=true` renders a skeleton with no project data — use for async loading states
85
+ - The sparkline is `aria-hidden="true"` — it is decorative only
86
+ - `contextLine` and overdue count are combined in a third row separated by a middot
87
+
88
+ ## Changes
89
+ ### v0.20.0
90
+ - **Added** Initial release — project health card with progress bar, status badge, sparkline, and loading skeleton
@@ -10,6 +10,9 @@
10
10
  onToggle: (id: string, done: boolean) => void (REQUIRED)
11
11
  onAdd: (text: string) => void (REQUIRED)
12
12
  onDelete: (id: string) => void (REQUIRED)
13
+ onEdit: (id: string, text: string) => void — enables inline editing (double-click)
14
+ onReorder: (items: ScratchpadItem[]) => void — enables drag-to-reorder via @dnd-kit
15
+ onPromote: (id: string) => void — enables promote-to-task button on items
13
16
  title: string (default: "My Scratchpad")
14
17
  resetLabel: string
15
18
  emptyText: string (default: "Nothing here yet. Add a task!")
@@ -30,6 +33,9 @@
30
33
  onToggle={(id, done) => toggleItem(id, done)}
31
34
  onAdd={(text) => addItem(text)}
32
35
  onDelete={(id) => deleteItem(id)}
36
+ onEdit={(id, text) => editItem(id, text)}
37
+ onReorder={(items) => reorderItems(items)}
38
+ onPromote={(id) => promoteToTask(id)}
33
39
  maxItems={5}
34
40
  />
35
41
  ```
@@ -46,7 +52,18 @@
46
52
  - resetLabel renders as footer text below the item list (e.g., "Resets daily at midnight")
47
53
  - When loading=true, shows a shimmer skeleton placeholder
48
54
  - Uses framer-motion AnimatePresence for item enter/exit animations
55
+ - Internally uses the composable Scratchpad compound component — see scratchpad.md for details
56
+ - onEdit, onReorder, onPromote are optional; features auto-enable when callbacks are provided
57
+ - onEdit: double-click item text to enter inline edit mode; Enter confirms, Escape cancels
58
+ - onReorder: items become draggable with @dnd-kit; drag handle appears on hover
59
+ - onPromote: arrow-up button appears on each item on hover
49
60
 
50
61
  ## Changes
62
+ ### v0.20.0
63
+ - **Added** `onEdit` prop — inline editing via double-click
64
+ - **Added** `onReorder` prop — drag-to-reorder via @dnd-kit
65
+ - **Added** `onPromote` prop — promote-to-task button on items
66
+ - **Changed** Internally rebuilt on composable Scratchpad compound component
67
+
51
68
  ### v0.18.0
52
69
  - **Added** Initial release
@@ -0,0 +1,151 @@
1
+ # Scratchpad (Composable)
2
+
3
+ Compound component for building custom scratchpad UIs with drag-to-reorder, inline editing, promote-to-task, and filter completed toggle.
4
+
5
+ - Import: @devalok/shilp-sutra-karm/dashboard
6
+ - Server-safe: No
7
+ - Category: dashboard
8
+
9
+ ## Compound Parts
10
+
11
+ | Part | Description |
12
+ |------|-------------|
13
+ | `Scratchpad.Root` | Context provider + layout div. All other parts must be children. |
14
+ | `Scratchpad.Header` | Title bar with optional children slot (e.g. ProgressRing, FilterToggle) |
15
+ | `Scratchpad.List` | Item list with optional @dnd-kit drag-to-reorder and AnimatePresence |
16
+ | `Scratchpad.Item` | Single item row: checkbox, text, inline edit, drag handle, promote/delete buttons |
17
+ | `Scratchpad.AddInput` | "Add a task" trigger that expands to an inline input + Add button |
18
+ | `Scratchpad.EmptyState` | Empty placeholder shown when visibleItems is empty |
19
+ | `Scratchpad.ProgressRing` | SVG ring showing items.length / maxItems with completion pulse |
20
+ | `Scratchpad.FilterToggle` | Eye icon button toggling show/hide completed items |
21
+ | `Scratchpad.Collapse` | Collapsible section with chevron header, CSS grid-rows transition, badge count |
22
+
23
+ ## Props (Root)
24
+
25
+ | Prop | Type | Default | Description |
26
+ |------|------|---------|-------------|
27
+ | items | ScratchpadItem[] | REQUIRED | Full item list |
28
+ | onToggle | (id: string, done: boolean) => void | REQUIRED | Toggle item completion |
29
+ | onAdd | (text: string) => void | — | Enables AddInput when provided |
30
+ | onDelete | (id: string) => void | — | Enables delete button on items |
31
+ | onEdit | (id: string, text: string) => void | — | Enables inline editing (double-click) |
32
+ | onReorder | (items: ScratchpadItem[]) => void | — | Enables drag-to-reorder via @dnd-kit |
33
+ | onPromote | (id: string) => void | — | Enables promote-to-task button on items |
34
+ | maxItems | number | 20 | Maximum item count; AddInput hides when reached |
35
+ | defaultShowCompleted | boolean | true | Initial filter toggle state |
36
+ | className | string | — | Additional CSS classes |
37
+
38
+ ## Props (Header)
39
+
40
+ | Prop | Type | Default | Description |
41
+ |------|------|---------|-------------|
42
+ | title | string | "Scratchpad" | Header title text |
43
+ | children | ReactNode | — | Slot for ProgressRing, FilterToggle, etc. |
44
+
45
+ ## Props (List)
46
+
47
+ | Prop | Type | Default | Description |
48
+ |------|------|---------|-------------|
49
+ | compact | boolean | false | Compact layout passed to each item |
50
+
51
+ ## Props (Item)
52
+
53
+ | Prop | Type | Default | Description |
54
+ |------|------|---------|-------------|
55
+ | item | ScratchpadItem | REQUIRED | The item data |
56
+ | compact | boolean | false | Compact sizing |
57
+ | sortable | boolean | false | Whether dnd-kit drag is active |
58
+
59
+ ## Props (AddInput)
60
+
61
+ | Prop | Type | Default | Description |
62
+ |------|------|---------|-------------|
63
+ | placeholder | string | "What needs doing?" | Input placeholder |
64
+ | triggerLabel | string | "+ Add a task..." | Button label before expanding |
65
+
66
+ ## Props (EmptyState)
67
+
68
+ | Prop | Type | Default | Description |
69
+ |------|------|---------|-------------|
70
+ | icon | React.ComponentType<{ className?: string }> | — | Icon shown above message |
71
+ | message | string | "Nothing here yet. Add a task!" | Empty state text |
72
+
73
+ ## Props (ProgressRing)
74
+
75
+ | Prop | Type | Default | Description |
76
+ |------|------|---------|-------------|
77
+ | size | "sm" \| "md" | "md" | Ring diameter: sm=16px, md=20px |
78
+
79
+ ## Props (FilterToggle)
80
+
81
+ No custom props. Extends `Omit<ButtonHTMLAttributes, 'children'>`.
82
+
83
+ ## Props (Collapse)
84
+
85
+ | Prop | Type | Default | Description |
86
+ |------|------|---------|-------------|
87
+ | label | string | "Scratchpad" | Header label text |
88
+ | defaultOpen | boolean | true | Whether expanded initially |
89
+ | badgeCount | number | — | Badge pill count in header (hidden when 0 or undefined) |
90
+ | headerClassName | string | — | Override header text styling |
91
+
92
+ ## Related Types
93
+
94
+ ```typescript
95
+ interface ScratchpadItem {
96
+ id: string
97
+ text: string
98
+ done: boolean
99
+ }
100
+ ```
101
+
102
+ ## Context-Driven Feature Visibility
103
+
104
+ Features auto-enable based on which callbacks are provided to Root:
105
+
106
+ | Callback | Enables |
107
+ |----------|---------|
108
+ | onAdd | AddInput component renders |
109
+ | onDelete | Delete (X) button on each item |
110
+ | onEdit | Double-click inline editing on items |
111
+ | onReorder | Drag handles + @dnd-kit SortableContext on List |
112
+ | onPromote | Promote (arrow-up) button on each item |
113
+
114
+ ## Example
115
+
116
+ ```tsx
117
+ <Scratchpad.Root
118
+ items={items}
119
+ onToggle={toggle}
120
+ onAdd={add}
121
+ onDelete={del}
122
+ onEdit={edit}
123
+ onReorder={reorder}
124
+ onPromote={promote}
125
+ >
126
+ <Scratchpad.Header title="My Scratchpad">
127
+ <Scratchpad.FilterToggle />
128
+ <Scratchpad.ProgressRing />
129
+ </Scratchpad.Header>
130
+ <Scratchpad.EmptyState />
131
+ <Scratchpad.List />
132
+ <Scratchpad.AddInput />
133
+ </Scratchpad.Root>
134
+ ```
135
+
136
+ ## Gotchas
137
+ - All sub-components must be inside `Scratchpad.Root` — they use React context
138
+ - Root extends `Omit<HTMLDivElement, 'onToggle'>` to avoid conflict with native onToggle
139
+ - Drag-to-reorder uses @dnd-kit with PointerSensor (5px activation distance) and KeyboardSensor
140
+ - When sortable, List does NOT render `role="list"` because dnd-kit adds `role="button"` to items
141
+ - Inline editing activates on double-click; Enter confirms, Escape cancels, blur confirms
142
+ - AddInput auto-hides when items.length >= maxItems
143
+ - EmptyState auto-hides when visibleItems.length > 0
144
+ - FilterToggle shows IconEye when completed shown, IconEyeOff when hidden
145
+ - ProgressRing pulses (scale animation) when all items are done
146
+ - Items animate in/out with framer-motion (opacity + x slide)
147
+ - Collapse uses CSS `grid-template-rows` transition for smooth open/close
148
+
149
+ ## Changes
150
+ ### v0.20.0
151
+ - **Added** Initial release — 9-part composable scratchpad: Root, Header, List, Item, AddInput, EmptyState, ProgressRing, FilterToggle, Collapse
@@ -7,33 +7,57 @@
7
7
  ## Props
8
8
  items: ScratchpadItem[] (REQUIRED)
9
9
  onToggle: (id: string, done: boolean) => void (REQUIRED)
10
+ onAdd: (text: string) => void — enables quick-add input
11
+ onDelete: (id: string) => void — enables delete button on items
12
+ onEdit: (id: string, text: string) => void — enables inline editing (double-click)
13
+ onReorder: (items: ScratchpadItem[]) => void — enables drag-to-reorder
14
+ onPromote: (id: string) => void — enables promote-to-task button
15
+ maxItems: number (default: 20)
10
16
  defaultOpen: boolean (default: true)
11
17
  badgeCount: number
12
18
  className: string
13
19
 
14
20
  ## Related Types
15
- ScratchpadItem: { id: string; text: string; done: boolean } (imported from scratchpad-widget)
21
+ ScratchpadItem: { id: string; text: string; done: boolean }
16
22
 
17
23
  ## Defaults
18
- defaultOpen=true
24
+ maxItems=20, defaultOpen=true
19
25
 
20
26
  ## Example
21
27
  ```jsx
22
28
  <SidebarScratchpad
23
29
  items={scratchpadItems}
24
30
  onToggle={(id, done) => toggleItem(id, done)}
31
+ onAdd={(text) => addItem(text)}
32
+ onDelete={(id) => deleteItem(id)}
33
+ onEdit={(id, text) => editItem(id, text)}
34
+ onReorder={(items) => reorderItems(items)}
35
+ onPromote={(id) => promoteToTask(id)}
36
+ maxItems={20}
25
37
  badgeCount={scratchpadItems.filter(i => !i.done).length}
26
38
  />
27
39
  ```
28
40
 
29
41
  ## 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
42
+ - Compact sidebar layout built on the composable Scratchpad compound component
43
+ - Renders Scratchpad.Collapse > Scratchpad.List (compact) + Scratchpad.AddInput
33
44
  - Collapsible header with chevron; uses CSS grid-rows transition for smooth collapse
34
45
  - badgeCount shows a pill badge in the header; hidden when badgeCount is undefined, null, or 0
35
46
  - Extends React.HTMLAttributes<HTMLDivElement>
47
+ - onAdd, onDelete, onEdit, onReorder, onPromote are all optional; features auto-enable when callbacks are provided
48
+ - AddInput uses compact placeholders: "Quick add..." and "+ Add..."
49
+ - List renders in compact mode (smaller text and spacing)
36
50
 
37
51
  ## Changes
52
+ ### v0.20.0
53
+ - **Added** `onAdd` prop — enables quick-add input
54
+ - **Added** `onDelete` prop — enables delete button on items
55
+ - **Added** `onEdit` prop — inline editing via double-click
56
+ - **Added** `onReorder` prop — drag-to-reorder via @dnd-kit
57
+ - **Added** `onPromote` prop — promote-to-task button
58
+ - **Added** `maxItems` prop (default: 20)
59
+ - **Changed** Internally rebuilt on composable Scratchpad compound component
60
+ - **Changed** No longer read-only — supports full CRUD when callbacks provided
61
+
38
62
  ### v0.18.0
39
63
  - **Added** Initial release
@@ -0,0 +1,95 @@
1
+ # WeekHeatmap
2
+
3
+ Composable weekly task-completion heatmap with day cells, streak indicator, summary stats, and progress bar.
4
+
5
+ - Import: @devalok/shilp-sutra-karm/dashboard
6
+ - Server-safe: No
7
+ - Category: dashboard
8
+
9
+ ## Compound Parts
10
+
11
+ | Part | Description |
12
+ |------|-------------|
13
+ | `WeekHeatmap` | Props shorthand — renders Root + DayStrip + Streak + Summary + ProgressBar |
14
+ | `WeekHeatmap.Root` | Context provider + layout wrapper |
15
+ | `WeekHeatmap.DayStrip` | 7-column grid of Day cells with keyboard navigation and MotionStagger animation |
16
+ | `WeekHeatmap.Day` | Individual day cell with tooltip, status color, and click/keyboard activation |
17
+ | `WeekHeatmap.Summary` | Text line showing completed/remaining/overdue counts |
18
+ | `WeekHeatmap.ProgressBar` | Progress bar colored by success, driven by totalCompleted/totalTasks |
19
+ | `WeekHeatmap.Streak` | Streak badge (hidden when streak <= 1) |
20
+
21
+ ## Props (Root / Shorthand)
22
+
23
+ | Prop | Type | Default | Description |
24
+ |------|------|---------|-------------|
25
+ | days | WeekDay[] | REQUIRED | Array of 7 day objects |
26
+ | onDayClick | (date: string) => void | — | Called when a past or today day cell is clicked |
27
+ | overdue | number | — | Overdue task count shown in Summary |
28
+ | today | string | — | ISO date override for "today" (defaults to actual today) |
29
+ | className | string | — | Additional CSS classes |
30
+
31
+ ## Props (DayStrip)
32
+
33
+ | Prop | Type | Default | Description |
34
+ |------|------|---------|-------------|
35
+ | className | string | — | Additional CSS classes |
36
+
37
+ ## Props (Summary, ProgressBar, Streak)
38
+
39
+ All accept `className` and standard `HTMLDivElement` attributes. They read data from context.
40
+
41
+ ## Related Types
42
+
43
+ ```typescript
44
+ interface WeekDay {
45
+ date: string // ISO date string (YYYY-MM-DD)
46
+ completed: number
47
+ total: number
48
+ }
49
+
50
+ type DayStatus = 'complete' | 'partial' | 'none' | 'today' | 'future' | 'empty'
51
+ ```
52
+
53
+ ## Day Status Colors
54
+
55
+ | Status | Condition | Color |
56
+ |--------|-----------|-------|
57
+ | complete | Past day, completed === total | success-9 |
58
+ | partial | Past day, completed > 0 but < total | warning-9 |
59
+ | none | Past day, completed === 0 | error-9 |
60
+ | today | date === today | info-9 with ring |
61
+ | future | date > today | surface-3 |
62
+ | empty | total === 0 | surface-2 dashed border |
63
+
64
+ ## Defaults
65
+ today = new Date().toISOString().split('T')[0]
66
+
67
+ ## Example
68
+
69
+ ```tsx
70
+ // Props shorthand
71
+ <WeekHeatmap days={days} onDayClick={(date) => navigate(date)} overdue={2} />
72
+
73
+ // Composable — custom arrangement
74
+ <WeekHeatmap.Root days={days} onDayClick={fn}>
75
+ <WeekHeatmap.DayStrip />
76
+ <WeekHeatmap.Streak />
77
+ <WeekHeatmap.Summary />
78
+ <WeekHeatmap.ProgressBar />
79
+ </WeekHeatmap.Root>
80
+ ```
81
+
82
+ ## Gotchas
83
+ - DayStrip uses `role="grid"` with `role="row"` and `role="gridcell"` for a11y
84
+ - Keyboard navigation: ArrowLeft/ArrowRight moves focus between days, Home/End jump to first/last, Enter/Space activates onDayClick
85
+ - Uses roving tabIndex pattern — only the focused day has tabIndex=0
86
+ - Today's cell gets a MotionPop bounce animation; other days use MotionStagger fade-in
87
+ - Clicking a future or empty day does nothing (no onDayClick fired)
88
+ - Streak counts consecutive past days where completed === total; hidden when streak <= 1
89
+ - ProgressBar uses core Progress component with `color="success"` and `size="sm"`
90
+ - Each Day cell shows a Tooltip with full date and completion count on hover
91
+ - Extends `React.HTMLAttributes<HTMLDivElement>` (Root omits `onDayClick` from native HTML)
92
+
93
+ ## Changes
94
+ ### v0.20.0
95
+ - **Added** Initial release — composable WeekHeatmap with Root, DayStrip, Day, Summary, ProgressBar, Streak
@@ -37,5 +37,9 @@
37
37
  - Forwards ref to outer div.
38
38
 
39
39
  ## Changes
40
+ ### v0.19.0
41
+ - **Added** Decomposed into composable pieces: `ActivityTimeline`, `ActivityEntry` — importable from `@devalok/shilp-sutra-karm/tasks`
42
+ - ActivityTab remains as a pre-assembled default; use the pieces for custom layouts
43
+
40
44
  ### v0.18.0
41
45
  - **Added** Initial release
@@ -48,5 +48,9 @@
48
48
  - Forwards ref to outer div.
49
49
 
50
50
  ## Changes
51
+ ### v0.19.0
52
+ - **Added** Decomposed into composable pieces: `MessageList`, `MessageBubble`, `MessageInput`, `VisibilityWarning` — importable from `@devalok/shilp-sutra-karm/tasks`
53
+ - ConversationTab remains as a pre-assembled default; use the pieces for custom layouts
54
+
51
55
  ### v0.18.0
52
56
  - **Added** Initial release
@@ -47,5 +47,9 @@
47
47
  - Forwards ref to outer div.
48
48
 
49
49
  ## Changes
50
+ ### v0.19.0
51
+ - **Added** Decomposed into composable pieces: `FileDropZone`, `FileList`, `FileItem` — importable from `@devalok/shilp-sutra-karm/tasks`
52
+ - FilesTab remains as a pre-assembled default; use the pieces for custom layouts
53
+
50
54
  ### v0.18.0
51
55
  - **Added** Initial release
@@ -24,7 +24,7 @@
24
24
  ## Member Shape
25
25
  id: string
26
26
  name: string
27
- image: string | null (optional)
27
+ image?: string | null
28
28
 
29
29
  ## Example
30
30
  ```jsx
@@ -45,5 +45,9 @@
45
45
  - Forwards ref to outer div.
46
46
 
47
47
  ## Changes
48
+ ### v0.19.0
49
+ - **Added** Decomposed into composable pieces: `ReviewCard`, `ReviewResponseForm`, `ReviewRequestButton` — importable from `@devalok/shilp-sutra-karm/tasks`
50
+ - ReviewTab remains as a pre-assembled default; use the pieces for custom layouts
51
+
48
52
  ### v0.18.0
49
53
  - **Added** Initial release
@@ -48,9 +48,14 @@
48
48
  - Clicking a subtask row triggers onClickSubtask (if provided).
49
49
  - In readOnly mode, checkboxes are non-interactive and the "Add subtask" button is hidden.
50
50
  - "Add subtask" inline form with Enter to submit, Escape to cancel.
51
+ - projectId, parentTaskId, and defaultColumnId are defined in the interface and required by the type but are not currently used in the component's rendering logic. They are reserved for future navigation/creation features.
51
52
  - Empty state: "No subtasks".
52
53
  - Forwards ref to outer div.
53
54
 
54
55
  ## Changes
56
+ ### v0.19.0
57
+ - **Added** Decomposed into composable pieces: `SubtaskProgress`, `SubtaskList`, `SubtaskItem`, `SubtaskAddForm` — importable from `@devalok/shilp-sutra-karm/tasks`
58
+ - SubtasksTab remains as a pre-assembled default; use the pieces for custom layouts
59
+
55
60
  ### v0.18.0
56
61
  - **Added** Initial release
@@ -0,0 +1,159 @@
1
+ # TaskActionRow
2
+
3
+ Composable task row for action lists, "my tasks", and dashboard views. Shows checkbox, priority, title, labels, project badge, due date, status badge, and navigate button.
4
+
5
+ - Import: @devalok/shilp-sutra-karm/tasks
6
+ - Server-safe: No
7
+ - Category: tasks
8
+
9
+ ## Compound Parts
10
+
11
+ | Part | Description |
12
+ |------|-------------|
13
+ | `TaskActionRow` | Props shorthand — renders selected sub-components via show* flags |
14
+ | `TaskActionRow.Root` | Context provider + row wrapper with separator, click, and keyboard activation |
15
+ | `TaskActionRow.Checkbox` | Completion checkbox; stops propagation to avoid triggering row click |
16
+ | `TaskActionRow.Priority` | PriorityIndicator in compact display mode |
17
+ | `TaskActionRow.Title` | Task title text with optional truncation |
18
+ | `TaskActionRow.Labels` | Label badges with overflow count (+N) |
19
+ | `TaskActionRow.ProjectBadge` | Project name badge with optional click handler |
20
+ | `TaskActionRow.DueDate` | Formatted short date with overdue/today color coding |
21
+ | `TaskActionRow.StatusBadge` | StatusBadge mapped from task.stage |
22
+ | `TaskActionRow.Navigate` | Hover-reveal chevron button for opening the task |
23
+
24
+ ## Props (Shorthand)
25
+
26
+ | Prop | Type | Default | Description |
27
+ |------|------|---------|-------------|
28
+ | task | TaskActionRowTask | REQUIRED | Task data object |
29
+ | onClick | () => void | — | Row click handler; adds role="button" and keyboard activation |
30
+ | onComplete | (taskId: string) => void \| Promise<void> | — | Checkbox completion callback |
31
+ | onContextMenu | (e: React.MouseEvent) => void | — | Right-click handler |
32
+ | showCheckbox | boolean | — | Show completion checkbox |
33
+ | showPriority | boolean | — | Show priority indicator |
34
+ | showLabels | boolean | — | Show label badges |
35
+ | showProject | boolean | — | Show project name badge |
36
+ | showDueDate | boolean | — | Show due date |
37
+ | showNavigate | boolean | — | Show navigate chevron button |
38
+ | showStatusBadge | boolean | — | Show stage status badge |
39
+ | truncateTitle | boolean | — | Truncate long titles with ellipsis |
40
+ | showSeparator | boolean | true | Show bottom border separator |
41
+ | maxLabels | number | 2 | Max visible labels before +N overflow |
42
+ | navigateHref | string | — | URL for navigate button |
43
+ | onProjectClick | (e: React.MouseEvent) => void | — | Project badge click handler |
44
+ | onNavigateClick | (e: React.MouseEvent) => void | — | Navigate button click handler |
45
+ | className | string | — | Additional CSS classes |
46
+
47
+ ## Props (Root)
48
+
49
+ | Prop | Type | Default | Description |
50
+ |------|------|---------|-------------|
51
+ | task | TaskActionRowTask | REQUIRED | Task data object |
52
+ | children | ReactNode | REQUIRED | Sub-components |
53
+ | onClick | () => void | — | Row click handler |
54
+ | onContextMenu | (e: React.MouseEvent) => void | — | Right-click handler |
55
+ | showSeparator | boolean | true | Show bottom border |
56
+ | className | string | — | Additional CSS classes |
57
+
58
+ ## Props (Checkbox)
59
+
60
+ | Prop | Type | Default | Description |
61
+ |------|------|---------|-------------|
62
+ | onComplete | (taskId: string) => void \| Promise<void> | — | Called when checkbox is checked |
63
+
64
+ ## Props (Title)
65
+
66
+ | Prop | Type | Default | Description |
67
+ |------|------|---------|-------------|
68
+ | truncate | boolean | — | Enable text truncation |
69
+ | className | string | — | Additional CSS classes |
70
+
71
+ ## Props (Labels)
72
+
73
+ | Prop | Type | Default | Description |
74
+ |------|------|---------|-------------|
75
+ | max | number | — | Max visible labels; overflow shows +N badge |
76
+
77
+ ## Props (ProjectBadge)
78
+
79
+ | Prop | Type | Default | Description |
80
+ |------|------|---------|-------------|
81
+ | onClick | (e: React.MouseEvent) => void | — | Click handler; stops propagation |
82
+
83
+ ## Props (Navigate)
84
+
85
+ | Prop | Type | Default | Description |
86
+ |------|------|---------|-------------|
87
+ | href | string | — | URL to navigate to on click |
88
+ | onClick | (e: React.MouseEvent) => void | — | Click handler (takes priority over href) |
89
+
90
+ ## Related Types
91
+
92
+ ```typescript
93
+ type Priority = 'LOW' | 'MEDIUM' | 'HIGH' | 'URGENT'
94
+
95
+ interface TaskActionRowTask {
96
+ id: string
97
+ title: string
98
+ priority: Priority
99
+ dueDate?: string | null
100
+ projectName?: string
101
+ projectId?: string
102
+ stage?: string
103
+ isOverdue?: boolean
104
+ labels?: string[]
105
+ }
106
+ ```
107
+
108
+ ## Due Date Colors
109
+
110
+ | Condition | Color |
111
+ |-----------|-------|
112
+ | isOverdue | error-11 + font-medium |
113
+ | today | warning-11 |
114
+ | default | surface-fg-muted |
115
+
116
+ ## Defaults
117
+ showSeparator=true, maxLabels=2
118
+
119
+ ## Example
120
+
121
+ ```tsx
122
+ // Props shorthand
123
+ <TaskActionRow
124
+ task={task}
125
+ onClick={() => openTask(task.id)}
126
+ onComplete={(id) => completeTask(id)}
127
+ showCheckbox
128
+ showPriority
129
+ showLabels
130
+ showDueDate
131
+ showNavigate
132
+ truncateTitle
133
+ />
134
+
135
+ // Composable — custom layout
136
+ <TaskActionRow.Root task={task} onClick={() => openTask(task.id)}>
137
+ <TaskActionRow.Checkbox onComplete={completeTask} />
138
+ <TaskActionRow.Priority />
139
+ <TaskActionRow.Title truncate />
140
+ <TaskActionRow.Labels max={3} />
141
+ <TaskActionRow.DueDate />
142
+ <TaskActionRow.Navigate onClick={(e) => handleNav(e)} />
143
+ </TaskActionRow.Root>
144
+ ```
145
+
146
+ ## Gotchas
147
+ - Root adds `role="button"` and `tabIndex={0}` only when `onClick` is provided
148
+ - Keyboard activation: Enter or Space triggers onClick on Root
149
+ - Checkbox stops click propagation to avoid triggering the row's onClick
150
+ - Navigate button is hover-reveal (opacity-0 by default, visible on group-hover/group-focus-within)
151
+ - ProjectBadge stops propagation on click to avoid triggering row onClick
152
+ - Navigate button stops propagation; if both href and onClick are provided, onClick takes priority
153
+ - Labels, ProjectBadge, DueDate, StatusBadge return null when their data is missing from the task
154
+ - StatusBadge maps task.stage (case-insensitive) to StatusBadge status values; unrecognized stages return null
155
+ - Priority, DueDate, and StatusBadge sub-components accept no custom props
156
+
157
+ ## Changes
158
+ ### v0.20.0
159
+ - **Added** Initial release — composable TaskActionRow with Root, Checkbox, Priority, Title, Labels, ProjectBadge, DueDate, StatusBadge, Navigate