@allpepper/task-orchestrator-tui 1.0.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 (50) hide show
  1. package/README.md +78 -0
  2. package/package.json +54 -0
  3. package/src/tui/app.tsx +308 -0
  4. package/src/tui/components/column-filter-bar.tsx +52 -0
  5. package/src/tui/components/confirm-dialog.tsx +45 -0
  6. package/src/tui/components/dependency-list.tsx +115 -0
  7. package/src/tui/components/empty-state.tsx +28 -0
  8. package/src/tui/components/entity-table.tsx +120 -0
  9. package/src/tui/components/error-message.tsx +41 -0
  10. package/src/tui/components/feature-kanban-card.tsx +216 -0
  11. package/src/tui/components/footer.tsx +34 -0
  12. package/src/tui/components/form-dialog.tsx +338 -0
  13. package/src/tui/components/header.tsx +54 -0
  14. package/src/tui/components/index.ts +16 -0
  15. package/src/tui/components/kanban-board.tsx +335 -0
  16. package/src/tui/components/kanban-card.tsx +70 -0
  17. package/src/tui/components/kanban-column.tsx +173 -0
  18. package/src/tui/components/priority-badge.tsx +16 -0
  19. package/src/tui/components/section-list.tsx +96 -0
  20. package/src/tui/components/status-actions.tsx +87 -0
  21. package/src/tui/components/status-badge.tsx +22 -0
  22. package/src/tui/components/tree-view.tsx +295 -0
  23. package/src/tui/components/view-mode-chips.tsx +23 -0
  24. package/src/tui/index.tsx +33 -0
  25. package/src/tui/screens/dashboard.tsx +248 -0
  26. package/src/tui/screens/feature-detail.tsx +312 -0
  27. package/src/tui/screens/index.ts +6 -0
  28. package/src/tui/screens/kanban-view.tsx +251 -0
  29. package/src/tui/screens/project-detail.tsx +305 -0
  30. package/src/tui/screens/project-view.tsx +498 -0
  31. package/src/tui/screens/search.tsx +257 -0
  32. package/src/tui/screens/task-detail.tsx +294 -0
  33. package/src/ui/adapters/direct.ts +429 -0
  34. package/src/ui/adapters/index.ts +14 -0
  35. package/src/ui/adapters/types.ts +269 -0
  36. package/src/ui/context/adapter-context.tsx +31 -0
  37. package/src/ui/context/theme-context.tsx +43 -0
  38. package/src/ui/hooks/index.ts +20 -0
  39. package/src/ui/hooks/use-data.ts +919 -0
  40. package/src/ui/hooks/use-debounce.ts +37 -0
  41. package/src/ui/hooks/use-feature-kanban.ts +151 -0
  42. package/src/ui/hooks/use-kanban.ts +96 -0
  43. package/src/ui/hooks/use-navigation.tsx +94 -0
  44. package/src/ui/index.ts +73 -0
  45. package/src/ui/lib/colors.ts +79 -0
  46. package/src/ui/lib/format.ts +114 -0
  47. package/src/ui/lib/types.ts +157 -0
  48. package/src/ui/themes/dark.ts +63 -0
  49. package/src/ui/themes/light.ts +63 -0
  50. package/src/ui/themes/types.ts +71 -0
@@ -0,0 +1,31 @@
1
+ import React, { createContext, useContext, type ReactNode } from 'react';
2
+ import type { DataAdapter } from '../adapters/types';
3
+
4
+ interface AdapterContextValue {
5
+ adapter: DataAdapter;
6
+ }
7
+
8
+ const AdapterContext = createContext<AdapterContextValue | undefined>(undefined);
9
+
10
+ interface AdapterProviderProps {
11
+ children: ReactNode;
12
+ adapter: DataAdapter;
13
+ }
14
+
15
+ export function AdapterProvider({ children, adapter }: AdapterProviderProps) {
16
+ const value: AdapterContextValue = {
17
+ adapter,
18
+ };
19
+
20
+ return <AdapterContext.Provider value={value}>{children}</AdapterContext.Provider>;
21
+ }
22
+
23
+ export function useAdapter(): AdapterContextValue {
24
+ const context = useContext(AdapterContext);
25
+
26
+ if (context === undefined) {
27
+ throw new Error('useAdapter must be used within an AdapterProvider');
28
+ }
29
+
30
+ return context;
31
+ }
@@ -0,0 +1,43 @@
1
+ import React, { createContext, useContext, useState, type ReactNode } from 'react';
2
+ import type { Theme } from '../themes/types';
3
+ import { darkTheme } from '../themes/dark';
4
+ import { lightTheme } from '../themes/light';
5
+
6
+ interface ThemeContextValue {
7
+ theme: Theme;
8
+ setTheme: (theme: Theme) => void;
9
+ toggleTheme: () => void;
10
+ }
11
+
12
+ const ThemeContext = createContext<ThemeContextValue | undefined>(undefined);
13
+
14
+ interface ThemeProviderProps {
15
+ children: ReactNode;
16
+ initialTheme?: Theme;
17
+ }
18
+
19
+ export function ThemeProvider({ children, initialTheme = darkTheme }: ThemeProviderProps) {
20
+ const [theme, setTheme] = useState<Theme>(initialTheme);
21
+
22
+ const toggleTheme = () => {
23
+ setTheme((current) => (current.name === 'dark' ? lightTheme : darkTheme));
24
+ };
25
+
26
+ const value: ThemeContextValue = {
27
+ theme,
28
+ setTheme,
29
+ toggleTheme,
30
+ };
31
+
32
+ return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
33
+ }
34
+
35
+ export function useTheme(): ThemeContextValue {
36
+ const context = useContext(ThemeContext);
37
+
38
+ if (context === undefined) {
39
+ throw new Error('useTheme must be used within a ThemeProvider');
40
+ }
41
+
42
+ return context;
43
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * UI Hooks
3
+ *
4
+ * Custom React hooks for the Task Orchestrator TUI
5
+ */
6
+
7
+ export {
8
+ useProjects,
9
+ useProjectOverview,
10
+ useProjectTree,
11
+ useTask,
12
+ useSearch,
13
+ calculateTaskCounts,
14
+ calculateTaskCountsByProject,
15
+ type TaskCounts,
16
+ type ProjectWithCounts,
17
+ } from './use-data';
18
+ export { useDebounce } from './use-debounce';
19
+ export { useNavigation } from './use-navigation';
20
+ export { useKanban } from './use-kanban';