@crmy/web 0.5.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.
Files changed (119) hide show
  1. package/index.html +23 -0
  2. package/package.json +76 -0
  3. package/postcss.config.js +6 -0
  4. package/public/android-chrome-192x192.png +0 -0
  5. package/public/android-chrome-512x512.png +0 -0
  6. package/public/apple-touch-icon.png +0 -0
  7. package/public/favicon-16x16.png +0 -0
  8. package/public/favicon-32x32.png +0 -0
  9. package/public/favicon.ico +0 -0
  10. package/public/favicon.svg +13 -0
  11. package/public/site.webmanifest +1 -0
  12. package/src/App.tsx +158 -0
  13. package/src/api/client.ts +82 -0
  14. package/src/api/hooks.ts +689 -0
  15. package/src/assets/crmy-logo.png +0 -0
  16. package/src/components/CustomFields.tsx +240 -0
  17. package/src/components/NavLink.tsx +28 -0
  18. package/src/components/crm/AIFab.tsx +37 -0
  19. package/src/components/crm/AccountDrawer.tsx +372 -0
  20. package/src/components/crm/ActivityTimeline.tsx +115 -0
  21. package/src/components/crm/AssignmentDrawer.tsx +396 -0
  22. package/src/components/crm/BriefingPanel.tsx +217 -0
  23. package/src/components/crm/CommandPalette.tsx +254 -0
  24. package/src/components/crm/ContactAvatar.tsx +49 -0
  25. package/src/components/crm/ContactDrawer.tsx +438 -0
  26. package/src/components/crm/ContextPanel.tsx +200 -0
  27. package/src/components/crm/CrmWidgets.tsx +417 -0
  28. package/src/components/crm/DrawerShell.tsx +77 -0
  29. package/src/components/crm/ListToolbar.tsx +252 -0
  30. package/src/components/crm/OpportunityDrawer.tsx +372 -0
  31. package/src/components/crm/PaginationBar.tsx +111 -0
  32. package/src/components/crm/QuickAddDrawer.tsx +652 -0
  33. package/src/components/crm/ShortcutsOverlay.tsx +65 -0
  34. package/src/components/crm/UseCaseDrawer.tsx +454 -0
  35. package/src/components/layout/MobileNav.tsx +49 -0
  36. package/src/components/layout/Sidebar.tsx +157 -0
  37. package/src/components/layout/TopBar.tsx +54 -0
  38. package/src/components/settings/ActorsSettings.tsx +1190 -0
  39. package/src/components/ui/accordion.tsx +52 -0
  40. package/src/components/ui/alert-dialog.tsx +104 -0
  41. package/src/components/ui/alert.tsx +43 -0
  42. package/src/components/ui/aspect-ratio.tsx +5 -0
  43. package/src/components/ui/avatar.tsx +38 -0
  44. package/src/components/ui/badge.tsx +29 -0
  45. package/src/components/ui/breadcrumb.tsx +90 -0
  46. package/src/components/ui/button.tsx +47 -0
  47. package/src/components/ui/calendar.tsx +54 -0
  48. package/src/components/ui/card.tsx +43 -0
  49. package/src/components/ui/carousel.tsx +224 -0
  50. package/src/components/ui/chart.tsx +303 -0
  51. package/src/components/ui/checkbox.tsx +26 -0
  52. package/src/components/ui/collapsible.tsx +9 -0
  53. package/src/components/ui/command.tsx +132 -0
  54. package/src/components/ui/context-menu.tsx +178 -0
  55. package/src/components/ui/date-picker.tsx +313 -0
  56. package/src/components/ui/dialog.tsx +95 -0
  57. package/src/components/ui/drawer.tsx +87 -0
  58. package/src/components/ui/dropdown-menu.tsx +179 -0
  59. package/src/components/ui/form.tsx +129 -0
  60. package/src/components/ui/hover-card.tsx +27 -0
  61. package/src/components/ui/input-otp.tsx +61 -0
  62. package/src/components/ui/input.tsx +22 -0
  63. package/src/components/ui/label.tsx +17 -0
  64. package/src/components/ui/menubar.tsx +207 -0
  65. package/src/components/ui/navigation-menu.tsx +120 -0
  66. package/src/components/ui/pagination.tsx +81 -0
  67. package/src/components/ui/popover.tsx +29 -0
  68. package/src/components/ui/progress.tsx +23 -0
  69. package/src/components/ui/radio-group.tsx +36 -0
  70. package/src/components/ui/resizable.tsx +37 -0
  71. package/src/components/ui/scroll-area.tsx +38 -0
  72. package/src/components/ui/select.tsx +143 -0
  73. package/src/components/ui/separator.tsx +20 -0
  74. package/src/components/ui/sheet.tsx +107 -0
  75. package/src/components/ui/sidebar.tsx +637 -0
  76. package/src/components/ui/skeleton.tsx +7 -0
  77. package/src/components/ui/slider.tsx +23 -0
  78. package/src/components/ui/sonner.tsx +24 -0
  79. package/src/components/ui/switch.tsx +27 -0
  80. package/src/components/ui/table.tsx +72 -0
  81. package/src/components/ui/tabs.tsx +53 -0
  82. package/src/components/ui/textarea.tsx +21 -0
  83. package/src/components/ui/toast.tsx +111 -0
  84. package/src/components/ui/toaster.tsx +24 -0
  85. package/src/components/ui/toggle-group.tsx +49 -0
  86. package/src/components/ui/toggle.tsx +37 -0
  87. package/src/components/ui/tooltip.tsx +28 -0
  88. package/src/components/ui/use-toast.ts +1 -0
  89. package/src/components/ui/utils.ts +9 -0
  90. package/src/contexts/AgentSettingsContext.tsx +24 -0
  91. package/src/hooks/use-mobile.tsx +19 -0
  92. package/src/hooks/use-toast.ts +186 -0
  93. package/src/hooks/useKeyboardShortcuts.ts +95 -0
  94. package/src/hooks/useTheme.ts +24 -0
  95. package/src/index.css +245 -0
  96. package/src/lib/entityColors.ts +18 -0
  97. package/src/lib/stageConfig.ts +32 -0
  98. package/src/lib/utils.ts +6 -0
  99. package/src/main.tsx +25 -0
  100. package/src/pages/Accounts.tsx +205 -0
  101. package/src/pages/Activities.tsx +251 -0
  102. package/src/pages/Agent.tsx +237 -0
  103. package/src/pages/AgentSettings.tsx +544 -0
  104. package/src/pages/Assignments.tsx +750 -0
  105. package/src/pages/Contacts.tsx +200 -0
  106. package/src/pages/Dashboard.tsx +143 -0
  107. package/src/pages/Inbox.tsx +615 -0
  108. package/src/pages/NotFound.tsx +24 -0
  109. package/src/pages/Opportunities.tsx +386 -0
  110. package/src/pages/SearchResults.tsx +49 -0
  111. package/src/pages/Settings.tsx +1884 -0
  112. package/src/pages/UseCases.tsx +396 -0
  113. package/src/pages/auth/Login.tsx +261 -0
  114. package/src/pages/hitl/HITL.tsx +101 -0
  115. package/src/store/appStore.ts +103 -0
  116. package/src/vite-env.d.ts +14 -0
  117. package/tailwind.config.js +121 -0
  118. package/tsconfig.json +24 -0
  119. package/vite.config.ts +27 -0
@@ -0,0 +1,111 @@
1
+ // Copyright 2026 CRMy Contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { ChevronLeft, ChevronRight } from 'lucide-react';
5
+ import { cn } from '@/lib/utils';
6
+
7
+ const PAGE_SIZE_OPTIONS = [25, 50, 100];
8
+
9
+ function pageNumbers(current: number, total: number): (number | '...')[] {
10
+ if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
11
+ const pages: (number | '...')[] = [1];
12
+ if (current > 3) pages.push('...');
13
+ for (let i = Math.max(2, current - 1); i <= Math.min(total - 1, current + 1); i++) {
14
+ pages.push(i);
15
+ }
16
+ if (current < total - 2) pages.push('...');
17
+ pages.push(total);
18
+ return pages;
19
+ }
20
+
21
+ export interface PaginationBarProps {
22
+ page: number;
23
+ pageSize: number;
24
+ total: number;
25
+ onPageChange: (page: number) => void;
26
+ onPageSizeChange?: (size: number) => void;
27
+ className?: string;
28
+ }
29
+
30
+ export function PaginationBar({ page, pageSize, total, onPageChange, onPageSizeChange, className }: PaginationBarProps) {
31
+ if (total <= pageSize) return null;
32
+
33
+ const totalPages = Math.ceil(total / pageSize);
34
+ const start = (page - 1) * pageSize + 1;
35
+ const end = Math.min(page * pageSize, total);
36
+ const pages = pageNumbers(page, totalPages);
37
+
38
+ return (
39
+ <div className={cn('flex flex-wrap items-center justify-between gap-3 pt-3 pb-1', className)}>
40
+ {/* Count */}
41
+ <span className="text-xs text-muted-foreground whitespace-nowrap">
42
+ Showing {start}–{end} of {total}
43
+ </span>
44
+
45
+ {/* Page buttons */}
46
+ <div className="flex items-center gap-0.5">
47
+ <button
48
+ onClick={() => onPageChange(page - 1)}
49
+ disabled={page === 1}
50
+ className="p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
51
+ aria-label="Previous page"
52
+ >
53
+ <ChevronLeft className="w-4 h-4" />
54
+ </button>
55
+
56
+ {pages.map((p, i) =>
57
+ p === '...' ? (
58
+ <span key={`ellipsis-${i}`} className="w-8 text-center text-xs text-muted-foreground select-none">
59
+
60
+ </span>
61
+ ) : (
62
+ <button
63
+ key={p}
64
+ onClick={() => onPageChange(p as number)}
65
+ className={cn(
66
+ 'w-8 h-8 rounded-lg text-xs font-semibold transition-colors',
67
+ page === p
68
+ ? 'bg-primary text-primary-foreground'
69
+ : 'text-muted-foreground hover:text-foreground hover:bg-muted',
70
+ )}
71
+ >
72
+ {p}
73
+ </button>
74
+ ),
75
+ )}
76
+
77
+ <button
78
+ onClick={() => onPageChange(page + 1)}
79
+ disabled={page === totalPages}
80
+ className="p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted disabled:opacity-30 disabled:cursor-not-allowed transition-colors"
81
+ aria-label="Next page"
82
+ >
83
+ <ChevronRight className="w-4 h-4" />
84
+ </button>
85
+ </div>
86
+
87
+ {/* Page size */}
88
+ {onPageSizeChange && (
89
+ <div className="flex items-center gap-1.5">
90
+ <span className="text-xs text-muted-foreground">Per page:</span>
91
+ <div className="flex items-center gap-0.5 bg-muted rounded-lg p-0.5">
92
+ {PAGE_SIZE_OPTIONS.map(size => (
93
+ <button
94
+ key={size}
95
+ onClick={() => { onPageSizeChange(size); onPageChange(1); }}
96
+ className={cn(
97
+ 'px-2 py-1 rounded-md text-xs font-medium transition-colors',
98
+ pageSize === size
99
+ ? 'bg-card text-foreground shadow-sm'
100
+ : 'text-muted-foreground hover:text-foreground',
101
+ )}
102
+ >
103
+ {size}
104
+ </button>
105
+ ))}
106
+ </div>
107
+ </div>
108
+ )}
109
+ </div>
110
+ );
111
+ }