@pattern-stack/frontend-patterns 0.0.4 → 0.0.5

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 (283) hide show
  1. package/dist/frontend-patterns.css +1 -1
  2. package/dist/index.es.js +1917 -2
  3. package/dist/index.es.js.map +1 -1
  4. package/dist/index.js +1916 -1
  5. package/dist/index.js.map +1 -1
  6. package/package.json +6 -3
  7. package/src/App.tsx +11 -1
  8. package/src/atoms/composed/SalesPanel/SalesPanel.tsx +116 -0
  9. package/src/atoms/composed/SalesPanel/index.ts +1 -0
  10. package/src/atoms/composed/SalesPanel/mockSalesData.ts +151 -0
  11. package/src/atoms/composed/index.ts +1 -0
  12. package/src/atoms/types/entity-config.ts +127 -0
  13. package/src/atoms/types/index.ts +2 -1
  14. package/src/atoms/utils/metric-engine.ts +236 -0
  15. package/src/atoms/utils/utils.ts +2 -1
  16. package/src/molecules/layout/DashboardWithSidePanel/DashboardWithSidePanel.tsx +42 -0
  17. package/src/molecules/layout/DashboardWithSidePanel/index.ts +1 -0
  18. package/src/molecules/layout/Sidebar.tsx +10 -2
  19. package/src/molecules/layout/index.ts +1 -0
  20. package/src/organisms/entity/CategoryBreakdownPanel.tsx +427 -0
  21. package/src/organisms/entity/EntityListPanel.tsx +339 -0
  22. package/src/organisms/entity/MetricsOverviewPanel.tsx +236 -0
  23. package/src/organisms/entity/TrendAnalysisPanel.tsx +337 -0
  24. package/src/organisms/entity/index.ts +4 -0
  25. package/src/organisms/index.ts +4 -1
  26. package/src/pages/AdminShowcase/AdminDashboardShowcase.tsx +77 -75
  27. package/src/pages/AdminShowcase/SalesPerformanceDashboard.tsx +158 -0
  28. package/src/pages/AdminShowcase/index.tsx +2 -1
  29. package/src/pages/EntityShowcase/EntityManagementShowcase.tsx +137 -0
  30. package/src/pages/EntityShowcase/EntityPerformanceShowcase.tsx +117 -0
  31. package/src/pages/EntityShowcase/index.ts +2 -0
  32. package/src/pages/EntityTemplateExample.tsx +229 -0
  33. package/src/pages/TestEntityTemplate.tsx +40 -0
  34. package/src/pages/index.ts +2 -1
  35. package/src/templates/entity/EntityManagementTemplate.tsx +430 -0
  36. package/src/templates/entity/EntityPerformanceDashboardTemplate.tsx +277 -0
  37. package/src/templates/entity/configs/financial-config.ts +141 -0
  38. package/src/templates/entity/configs/index.ts +1 -0
  39. package/src/templates/entity/index.ts +3 -0
  40. package/src/templates/financial/FinancialDashboardTemplate.tsx +326 -0
  41. package/src/templates/index.ts +3 -0
  42. package/dist/atoms/composed/Accordion/Accordion.d.ts +0 -20
  43. package/dist/atoms/composed/Accordion/Accordion.d.ts.map +0 -1
  44. package/dist/atoms/composed/Accordion/index.d.ts +0 -2
  45. package/dist/atoms/composed/Accordion/index.d.ts.map +0 -1
  46. package/dist/atoms/composed/Alert/Alert.d.ts +0 -25
  47. package/dist/atoms/composed/Alert/Alert.d.ts.map +0 -1
  48. package/dist/atoms/composed/Alert/index.d.ts +0 -2
  49. package/dist/atoms/composed/Alert/index.d.ts.map +0 -1
  50. package/dist/atoms/composed/Breadcrumb/Breadcrumb.d.ts +0 -17
  51. package/dist/atoms/composed/Breadcrumb/Breadcrumb.d.ts.map +0 -1
  52. package/dist/atoms/composed/Breadcrumb/index.d.ts +0 -2
  53. package/dist/atoms/composed/Breadcrumb/index.d.ts.map +0 -1
  54. package/dist/atoms/composed/Chart/Chart.d.ts +0 -37
  55. package/dist/atoms/composed/Chart/Chart.d.ts.map +0 -1
  56. package/dist/atoms/composed/Chart/index.d.ts +0 -3
  57. package/dist/atoms/composed/Chart/index.d.ts.map +0 -1
  58. package/dist/atoms/composed/ColorSwatch/ColorSwatch.d.ts +0 -19
  59. package/dist/atoms/composed/ColorSwatch/ColorSwatch.d.ts.map +0 -1
  60. package/dist/atoms/composed/ColorSwatch/index.d.ts +0 -2
  61. package/dist/atoms/composed/ColorSwatch/index.d.ts.map +0 -1
  62. package/dist/atoms/composed/DarkModeToggle.d.ts +0 -4
  63. package/dist/atoms/composed/DarkModeToggle.d.ts.map +0 -1
  64. package/dist/atoms/composed/DataBadge/DataBadge.d.ts +0 -13
  65. package/dist/atoms/composed/DataBadge/DataBadge.d.ts.map +0 -1
  66. package/dist/atoms/composed/DataBadge/index.d.ts +0 -2
  67. package/dist/atoms/composed/DataBadge/index.d.ts.map +0 -1
  68. package/dist/atoms/composed/DataTable/DataTable.d.ts +0 -28
  69. package/dist/atoms/composed/DataTable/DataTable.d.ts.map +0 -1
  70. package/dist/atoms/composed/DataTable/TableCellWithTooltip.d.ts +0 -10
  71. package/dist/atoms/composed/DataTable/TableCellWithTooltip.d.ts.map +0 -1
  72. package/dist/atoms/composed/DataTable/index.d.ts +0 -3
  73. package/dist/atoms/composed/DataTable/index.d.ts.map +0 -1
  74. package/dist/atoms/composed/DateTimePicker/DateTimePicker.d.ts +0 -45
  75. package/dist/atoms/composed/DateTimePicker/DateTimePicker.d.ts.map +0 -1
  76. package/dist/atoms/composed/DateTimePicker/index.d.ts +0 -3
  77. package/dist/atoms/composed/DateTimePicker/index.d.ts.map +0 -1
  78. package/dist/atoms/composed/DetailedCard/DetailedCard.d.ts +0 -30
  79. package/dist/atoms/composed/DetailedCard/DetailedCard.d.ts.map +0 -1
  80. package/dist/atoms/composed/DetailedCard/index.d.ts +0 -3
  81. package/dist/atoms/composed/DetailedCard/index.d.ts.map +0 -1
  82. package/dist/atoms/composed/EmptyState/EmptyState.d.ts +0 -18
  83. package/dist/atoms/composed/EmptyState/EmptyState.d.ts.map +0 -1
  84. package/dist/atoms/composed/EmptyState/index.d.ts +0 -2
  85. package/dist/atoms/composed/EmptyState/index.d.ts.map +0 -1
  86. package/dist/atoms/composed/FileUpload/FileUpload.d.ts +0 -46
  87. package/dist/atoms/composed/FileUpload/FileUpload.d.ts.map +0 -1
  88. package/dist/atoms/composed/FileUpload/index.d.ts +0 -3
  89. package/dist/atoms/composed/FileUpload/index.d.ts.map +0 -1
  90. package/dist/atoms/composed/FormField/FormField.d.ts +0 -23
  91. package/dist/atoms/composed/FormField/FormField.d.ts.map +0 -1
  92. package/dist/atoms/composed/FormField/index.d.ts +0 -2
  93. package/dist/atoms/composed/FormField/index.d.ts.map +0 -1
  94. package/dist/atoms/composed/GlobalSearch/GlobalSearch.d.ts +0 -8
  95. package/dist/atoms/composed/GlobalSearch/GlobalSearch.d.ts.map +0 -1
  96. package/dist/atoms/composed/GlobalSearch/index.d.ts +0 -2
  97. package/dist/atoms/composed/GlobalSearch/index.d.ts.map +0 -1
  98. package/dist/atoms/composed/IconBadge/IconBadge.d.ts +0 -16
  99. package/dist/atoms/composed/IconBadge/IconBadge.d.ts.map +0 -1
  100. package/dist/atoms/composed/IconBadge/index.d.ts +0 -3
  101. package/dist/atoms/composed/IconBadge/index.d.ts.map +0 -1
  102. package/dist/atoms/composed/Modal/Modal.d.ts +0 -18
  103. package/dist/atoms/composed/Modal/Modal.d.ts.map +0 -1
  104. package/dist/atoms/composed/Modal/index.d.ts +0 -3
  105. package/dist/atoms/composed/Modal/index.d.ts.map +0 -1
  106. package/dist/atoms/composed/PaletteSwitcher.d.ts +0 -7
  107. package/dist/atoms/composed/PaletteSwitcher.d.ts.map +0 -1
  108. package/dist/atoms/composed/ProgressBar/ProgressBar.d.ts +0 -25
  109. package/dist/atoms/composed/ProgressBar/ProgressBar.d.ts.map +0 -1
  110. package/dist/atoms/composed/ProgressBar/index.d.ts +0 -2
  111. package/dist/atoms/composed/ProgressBar/index.d.ts.map +0 -1
  112. package/dist/atoms/composed/StatCard/StatCard.d.ts +0 -21
  113. package/dist/atoms/composed/StatCard/StatCard.d.ts.map +0 -1
  114. package/dist/atoms/composed/StatCard/index.d.ts +0 -2
  115. package/dist/atoms/composed/StatCard/index.d.ts.map +0 -1
  116. package/dist/atoms/composed/StyleGuide.d.ts +0 -3
  117. package/dist/atoms/composed/StyleGuide.d.ts.map +0 -1
  118. package/dist/atoms/composed/Toast/Toast.d.ts +0 -40
  119. package/dist/atoms/composed/Toast/Toast.d.ts.map +0 -1
  120. package/dist/atoms/composed/Toast/index.d.ts +0 -2
  121. package/dist/atoms/composed/Toast/index.d.ts.map +0 -1
  122. package/dist/atoms/composed/Tooltip/Tooltip.d.ts +0 -16
  123. package/dist/atoms/composed/Tooltip/Tooltip.d.ts.map +0 -1
  124. package/dist/atoms/composed/Tooltip/index.d.ts +0 -2
  125. package/dist/atoms/composed/Tooltip/index.d.ts.map +0 -1
  126. package/dist/atoms/composed/UserAvatar/UserAvatar.d.ts +0 -8
  127. package/dist/atoms/composed/UserAvatar/UserAvatar.d.ts.map +0 -1
  128. package/dist/atoms/composed/UserAvatar/index.d.ts +0 -2
  129. package/dist/atoms/composed/UserAvatar/index.d.ts.map +0 -1
  130. package/dist/atoms/composed/UserMenu/UserMenu.d.ts +0 -8
  131. package/dist/atoms/composed/UserMenu/UserMenu.d.ts.map +0 -1
  132. package/dist/atoms/composed/UserMenu/index.d.ts +0 -2
  133. package/dist/atoms/composed/UserMenu/index.d.ts.map +0 -1
  134. package/dist/atoms/composed/index.d.ts +0 -25
  135. package/dist/atoms/composed/index.d.ts.map +0 -1
  136. package/dist/atoms/hooks/useApi.d.ts +0 -25
  137. package/dist/atoms/hooks/useApi.d.ts.map +0 -1
  138. package/dist/atoms/hooks/useHealth.d.ts +0 -19
  139. package/dist/atoms/hooks/useHealth.d.ts.map +0 -1
  140. package/dist/atoms/index.d.ts +0 -9
  141. package/dist/atoms/index.d.ts.map +0 -1
  142. package/dist/atoms/services/api/client.d.ts +0 -20
  143. package/dist/atoms/services/api/client.d.ts.map +0 -1
  144. package/dist/atoms/services/auth-service.d.ts +0 -24
  145. package/dist/atoms/services/auth-service.d.ts.map +0 -1
  146. package/dist/atoms/services/health.d.ts +0 -7
  147. package/dist/atoms/services/health.d.ts.map +0 -1
  148. package/dist/atoms/services/index.d.ts +0 -4
  149. package/dist/atoms/services/index.d.ts.map +0 -1
  150. package/dist/atoms/shared/config/constants.d.ts +0 -15
  151. package/dist/atoms/shared/config/constants.d.ts.map +0 -1
  152. package/dist/atoms/shared/config/dashboard-sizes.d.ts +0 -83
  153. package/dist/atoms/shared/config/dashboard-sizes.d.ts.map +0 -1
  154. package/dist/atoms/shared/config/environment.d.ts +0 -10
  155. package/dist/atoms/shared/config/environment.d.ts.map +0 -1
  156. package/dist/atoms/shared/index.d.ts +0 -4
  157. package/dist/atoms/shared/index.d.ts.map +0 -1
  158. package/dist/atoms/types/auth.d.ts +0 -56
  159. package/dist/atoms/types/auth.d.ts.map +0 -1
  160. package/dist/atoms/types/generated.d.ts +0 -1469
  161. package/dist/atoms/types/generated.d.ts.map +0 -1
  162. package/dist/atoms/types/index.d.ts +0 -4
  163. package/dist/atoms/types/index.d.ts.map +0 -1
  164. package/dist/atoms/types/loading.d.ts +0 -26
  165. package/dist/atoms/types/loading.d.ts.map +0 -1
  166. package/dist/atoms/ui/Badge.d.ts +0 -10
  167. package/dist/atoms/ui/Badge.d.ts.map +0 -1
  168. package/dist/atoms/ui/ErrorBoundary.d.ts +0 -18
  169. package/dist/atoms/ui/ErrorBoundary.d.ts.map +0 -1
  170. package/dist/atoms/ui/Select.d.ts +0 -28
  171. package/dist/atoms/ui/Select.d.ts.map +0 -1
  172. package/dist/atoms/ui/Switch.d.ts +0 -9
  173. package/dist/atoms/ui/Switch.d.ts.map +0 -1
  174. package/dist/atoms/ui/Tabs.d.ts +0 -30
  175. package/dist/atoms/ui/Tabs.d.ts.map +0 -1
  176. package/dist/atoms/ui/avatar.d.ts +0 -7
  177. package/dist/atoms/ui/avatar.d.ts.map +0 -1
  178. package/dist/atoms/ui/button.d.ts +0 -14
  179. package/dist/atoms/ui/button.d.ts.map +0 -1
  180. package/dist/atoms/ui/card.d.ts +0 -12
  181. package/dist/atoms/ui/card.d.ts.map +0 -1
  182. package/dist/atoms/ui/dropdown-menu.d.ts +0 -28
  183. package/dist/atoms/ui/dropdown-menu.d.ts.map +0 -1
  184. package/dist/atoms/ui/index.d.ts +0 -15
  185. package/dist/atoms/ui/index.d.ts.map +0 -1
  186. package/dist/atoms/ui/input.d.ts +0 -5
  187. package/dist/atoms/ui/input.d.ts.map +0 -1
  188. package/dist/atoms/ui/label.d.ts +0 -6
  189. package/dist/atoms/ui/label.d.ts.map +0 -1
  190. package/dist/atoms/ui/skeleton.d.ts +0 -3
  191. package/dist/atoms/ui/skeleton.d.ts.map +0 -1
  192. package/dist/atoms/ui/spinner.d.ts +0 -14
  193. package/dist/atoms/ui/spinner.d.ts.map +0 -1
  194. package/dist/atoms/ui/table.d.ts +0 -11
  195. package/dist/atoms/ui/table.d.ts.map +0 -1
  196. package/dist/atoms/utils/animations.d.ts +0 -65
  197. package/dist/atoms/utils/animations.d.ts.map +0 -1
  198. package/dist/atoms/utils/tooltip-helpers.d.ts +0 -71
  199. package/dist/atoms/utils/tooltip-helpers.d.ts.map +0 -1
  200. package/dist/atoms/utils/utils.d.ts +0 -4
  201. package/dist/atoms/utils/utils.d.ts.map +0 -1
  202. package/dist/features/auth/components/LoginForm.d.ts +0 -2
  203. package/dist/features/auth/components/LoginForm.d.ts.map +0 -1
  204. package/dist/features/auth/components/LogoutButton.d.ts +0 -2
  205. package/dist/features/auth/components/LogoutButton.d.ts.map +0 -1
  206. package/dist/features/auth/components/ProtectedRoute.d.ts +0 -10
  207. package/dist/features/auth/components/ProtectedRoute.d.ts.map +0 -1
  208. package/dist/features/auth/components/index.d.ts +0 -4
  209. package/dist/features/auth/components/index.d.ts.map +0 -1
  210. package/dist/features/auth/hooks/index.d.ts +0 -3
  211. package/dist/features/auth/hooks/index.d.ts.map +0 -1
  212. package/dist/features/auth/hooks/useAuth.d.ts +0 -10
  213. package/dist/features/auth/hooks/useAuth.d.ts.map +0 -1
  214. package/dist/features/auth/hooks/usePermissions.d.ts +0 -13
  215. package/dist/features/auth/hooks/usePermissions.d.ts.map +0 -1
  216. package/dist/features/auth/index.d.ts +0 -3
  217. package/dist/features/auth/index.d.ts.map +0 -1
  218. package/dist/features/index.d.ts +0 -2
  219. package/dist/features/index.d.ts.map +0 -1
  220. package/dist/index.d.ts +0 -10
  221. package/dist/index.d.ts.map +0 -1
  222. package/dist/molecules/forms/FormGroup.d.ts +0 -17
  223. package/dist/molecules/forms/FormGroup.d.ts.map +0 -1
  224. package/dist/molecules/forms/SearchInput.d.ts +0 -36
  225. package/dist/molecules/forms/SearchInput.d.ts.map +0 -1
  226. package/dist/molecules/forms/index.d.ts +0 -3
  227. package/dist/molecules/forms/index.d.ts.map +0 -1
  228. package/dist/molecules/index.d.ts +0 -4
  229. package/dist/molecules/index.d.ts.map +0 -1
  230. package/dist/molecules/layout/AppHeader/AppHeader.d.ts +0 -7
  231. package/dist/molecules/layout/AppHeader/AppHeader.d.ts.map +0 -1
  232. package/dist/molecules/layout/AppHeader/index.d.ts +0 -2
  233. package/dist/molecules/layout/AppHeader/index.d.ts.map +0 -1
  234. package/dist/molecules/layout/AppLayout.d.ts +0 -2
  235. package/dist/molecules/layout/AppLayout.d.ts.map +0 -1
  236. package/dist/molecules/layout/PageTemplate.d.ts +0 -19
  237. package/dist/molecules/layout/PageTemplate.d.ts.map +0 -1
  238. package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts +0 -24
  239. package/dist/molecules/layout/SectionHeader/SectionHeader.d.ts.map +0 -1
  240. package/dist/molecules/layout/SectionHeader/index.d.ts +0 -2
  241. package/dist/molecules/layout/SectionHeader/index.d.ts.map +0 -1
  242. package/dist/molecules/layout/ShowcaseSection.d.ts +0 -22
  243. package/dist/molecules/layout/ShowcaseSection.d.ts.map +0 -1
  244. package/dist/molecules/layout/Sidebar.d.ts +0 -6
  245. package/dist/molecules/layout/Sidebar.d.ts.map +0 -1
  246. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts +0 -13
  247. package/dist/molecules/layout/SidebarButton/SidebarButton.d.ts.map +0 -1
  248. package/dist/molecules/layout/SidebarButton/index.d.ts +0 -2
  249. package/dist/molecules/layout/SidebarButton/index.d.ts.map +0 -1
  250. package/dist/molecules/layout/SidebarContext.d.ts +0 -12
  251. package/dist/molecules/layout/SidebarContext.d.ts.map +0 -1
  252. package/dist/molecules/layout/index.d.ts +0 -8
  253. package/dist/molecules/layout/index.d.ts.map +0 -1
  254. package/dist/molecules/navigation/NavMenu.d.ts +0 -20
  255. package/dist/molecules/navigation/NavMenu.d.ts.map +0 -1
  256. package/dist/molecules/navigation/Pagination.d.ts +0 -14
  257. package/dist/molecules/navigation/Pagination.d.ts.map +0 -1
  258. package/dist/molecules/navigation/index.d.ts +0 -3
  259. package/dist/molecules/navigation/index.d.ts.map +0 -1
  260. package/dist/organisms/index.d.ts +0 -2
  261. package/dist/organisms/index.d.ts.map +0 -1
  262. package/dist/organisms/showcase/ComponentShowcasePage.d.ts +0 -3
  263. package/dist/organisms/showcase/ComponentShowcasePage.d.ts.map +0 -1
  264. package/dist/templates/AuthTemplate.d.ts +0 -68
  265. package/dist/templates/AuthTemplate.d.ts.map +0 -1
  266. package/dist/templates/ComponentShowcaseTemplate.d.ts +0 -53
  267. package/dist/templates/ComponentShowcaseTemplate.d.ts.map +0 -1
  268. package/dist/templates/DashboardTemplate.d.ts +0 -62
  269. package/dist/templates/DashboardTemplate.d.ts.map +0 -1
  270. package/dist/templates/DataTemplate.d.ts +0 -78
  271. package/dist/templates/DataTemplate.d.ts.map +0 -1
  272. package/dist/templates/admin/AdminCRUDTemplate.d.ts +0 -105
  273. package/dist/templates/admin/AdminCRUDTemplate.d.ts.map +0 -1
  274. package/dist/templates/admin/AdminDashboardTemplate.d.ts +0 -89
  275. package/dist/templates/admin/AdminDashboardTemplate.d.ts.map +0 -1
  276. package/dist/templates/admin/AdminDetailTemplate.d.ts +0 -132
  277. package/dist/templates/admin/AdminDetailTemplate.d.ts.map +0 -1
  278. package/dist/templates/admin/index.d.ts +0 -4
  279. package/dist/templates/admin/index.d.ts.map +0 -1
  280. package/dist/templates/factory.d.ts +0 -28
  281. package/dist/templates/factory.d.ts.map +0 -1
  282. package/dist/templates/index.d.ts +0 -7
  283. package/dist/templates/index.d.ts.map +0 -1
@@ -0,0 +1,158 @@
1
+ import React, { useState } from 'react';
2
+ import { DashboardWithSidePanel } from '../../molecules/layout';
3
+ import { SalesPanel } from '../../atoms/composed/SalesPanel';
4
+ import { DataTable, StatCard, Chart } from '../../atoms/composed';
5
+ import { Card } from '../../atoms/ui/card';
6
+ import { mockSalesData } from '../../atoms/composed/SalesPanel/mockSalesData';
7
+ import { Button } from '../../atoms/ui/button';
8
+ import { Eye, Filter, Calendar, TrendingUp, Users, Target, DollarSign } from 'lucide-react';
9
+
10
+
11
+ // Mock data for main dashboard
12
+ const salesMetrics = [
13
+ { title: 'Total Revenue', value: '$1.2M', trend: { value: 15.3, label: 'from last month' }, icon: <DollarSign className="w-5 h-5" />, category: 2 as const },
14
+ { title: 'Deals Closed', value: '47', trend: { value: 12.8, label: 'from last month' }, icon: <Target className="w-5 h-5" />, category: 3 as const },
15
+ { title: 'Conversion Rate', value: '24.5%', trend: { value: -2.1, label: 'from last month' }, icon: <TrendingUp className="w-5 h-5" />, category: 1 as const },
16
+ { title: 'Active Prospects', value: '156', trend: { value: 8.7, label: 'from last month' }, icon: <Users className="w-5 h-5" />, category: 4 as const }
17
+ ];
18
+
19
+ const salesTrendData = [
20
+ { label: 'Jan', value: 85000 },
21
+ { label: 'Feb', value: 92000 },
22
+ { label: 'Mar', value: 108000 },
23
+ { label: 'Apr', value: 125000 },
24
+ { label: 'May', value: 118000 },
25
+ { label: 'Jun', value: 135000 }
26
+ ];
27
+
28
+ const allSalesColumns = [
29
+ { key: 'customer', header: 'Customer', render: (value: string) => <div className="font-medium">{value}</div> },
30
+ { key: 'product', header: 'Product', render: (value: string) => <div className="text-sm">{value}</div> },
31
+ { key: 'amount', header: 'Value', render: (value: number) => <div className="font-semibold text-green-600">${value.toLocaleString()}</div> },
32
+ { key: 'stage', header: 'Stage', render: (value: string) => <span className="text-sm">{value}</span> },
33
+ { key: 'salesperson', header: 'Sales Rep', render: (value: string) => <div className="text-sm">{value}</div> },
34
+ { key: 'region', header: 'Region', render: (value: string) => <div className="text-sm">{value}</div> }
35
+ ];
36
+
37
+ export const SalesPerformanceDashboard: React.FC = () => {
38
+ const [showSidePanel, setShowSidePanel] = useState(true);
39
+
40
+ const handleSaleClick = (sale: any) => {
41
+ console.log('Deal selected:', sale);
42
+ };
43
+
44
+ return (
45
+ <DashboardWithSidePanel
46
+ showSidePanel={showSidePanel}
47
+ sidePanel={
48
+ <SalesPanel
49
+ sales={mockSalesData}
50
+ onSaleClick={handleSaleClick}
51
+ onClose={() => setShowSidePanel(false)}
52
+ />
53
+ }
54
+ >
55
+ <div className="p-6 space-y-6">
56
+ {/* Header */}
57
+ <div className="flex items-center justify-between">
58
+ <div>
59
+ <h1 className="text-2xl font-bold">Sales Performance</h1>
60
+ <p className="text-muted-foreground">Monitor sales metrics, team performance, and revenue trends</p>
61
+ </div>
62
+ <div className="flex gap-2">
63
+ <Button
64
+ variant="outline"
65
+ size="sm"
66
+ onClick={() => setShowSidePanel(!showSidePanel)}
67
+ >
68
+ <Eye className="w-4 h-4 mr-2" />
69
+ {showSidePanel ? 'Hide' : 'Show'} Pipeline
70
+ </Button>
71
+ <Button variant="outline" size="sm">
72
+ <Filter className="w-4 h-4 mr-2" />
73
+ Filter by Region
74
+ </Button>
75
+ <Button variant="outline" size="sm">
76
+ <Calendar className="w-4 h-4 mr-2" />
77
+ Date Range
78
+ </Button>
79
+ </div>
80
+ </div>
81
+
82
+ {/* Metrics */}
83
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
84
+ {salesMetrics.map((metric, index) => (
85
+ <StatCard
86
+ key={index}
87
+ title={metric.title}
88
+ value={metric.value}
89
+ trend={metric.trend}
90
+ icon={metric.icon}
91
+ category={metric.category}
92
+ />
93
+ ))}
94
+ </div>
95
+
96
+ {/* Charts */}
97
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
98
+ <Card className="p-6">
99
+ <Chart
100
+ title="Revenue Trend"
101
+ type="line"
102
+ data={salesTrendData}
103
+ category={2}
104
+ noWrapper={true}
105
+ />
106
+ </Card>
107
+
108
+ <Card className="p-6">
109
+ <h3 className="font-semibold mb-4">Sales by Region</h3>
110
+ <div className="space-y-3">
111
+ <div className="flex justify-between items-center">
112
+ <span>North America</span>
113
+ <div className="flex items-center gap-2">
114
+ <div className="w-24 h-2 bg-muted rounded-full overflow-hidden">
115
+ <div className="w-3/5 h-full bg-category-2 rounded-full"></div>
116
+ </div>
117
+ <span className="text-sm font-medium">$750K</span>
118
+ </div>
119
+ </div>
120
+ <div className="flex justify-between items-center">
121
+ <span>Europe</span>
122
+ <div className="flex items-center gap-2">
123
+ <div className="w-24 h-2 bg-muted rounded-full overflow-hidden">
124
+ <div className="w-2/5 h-full bg-category-1 rounded-full"></div>
125
+ </div>
126
+ <span className="text-sm font-medium">$320K</span>
127
+ </div>
128
+ </div>
129
+ <div className="flex justify-between items-center">
130
+ <span>Asia Pacific</span>
131
+ <div className="flex items-center gap-2">
132
+ <div className="w-24 h-2 bg-muted rounded-full overflow-hidden">
133
+ <div className="w-1/4 h-full bg-category-3 rounded-full"></div>
134
+ </div>
135
+ <span className="text-sm font-medium">$130K</span>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </Card>
140
+ </div>
141
+
142
+ {/* Detailed Sales Table */}
143
+ <Card className="p-6">
144
+ <h3 className="font-semibold mb-4">All Sales Opportunities</h3>
145
+ <DataTable
146
+ data={mockSalesData}
147
+ columns={allSalesColumns}
148
+ showSearch={true}
149
+ searchPlaceholder="Search deals, customers, or products..."
150
+ onRowClick={handleSaleClick}
151
+ />
152
+ </Card>
153
+ </div>
154
+ </DashboardWithSidePanel>
155
+ );
156
+ };
157
+
158
+ export default SalesPerformanceDashboard;
@@ -1,3 +1,4 @@
1
1
  export { AdminDashboardShowcase } from './AdminDashboardShowcase';
2
2
  export { AdminCRUDShowcase } from './AdminCRUDShowcase';
3
- export { AdminDetailShowcase } from './AdminDetailShowcase';
3
+ export { AdminDetailShowcase } from './AdminDetailShowcase';
4
+ export { SalesPerformanceDashboard } from './SalesPerformanceDashboard';
@@ -0,0 +1,137 @@
1
+ import React, { useState } from 'react';
2
+ import { EntityListPanel } from '../../organisms/entity';
3
+ import { financialConfig, sampleFinancialData, type FinancialTransaction } from '../../templates/entity/configs/financial-config';
4
+ import { ShowcaseSection } from '../../molecules/layout/ShowcaseSection';
5
+ import { IconBadge } from '../../atoms/composed/IconBadge';
6
+ import { Switch } from '../../atoms/ui/Switch';
7
+ import { Button } from '../../atoms/ui/button';
8
+ import { Database, Filter, Search, Download, Plus, Layers } from 'lucide-react';
9
+
10
+ export const EntityManagementShowcase: React.FC = () => {
11
+ const [enableSearch, setEnableSearch] = useState(true);
12
+ const [enableFiltering, setEnableFiltering] = useState(true);
13
+ const [enableBulkActions, setEnableBulkActions] = useState(true);
14
+ const [enableExport, setEnableExport] = useState(true);
15
+
16
+ return (
17
+ <div className="min-h-screen bg-background">
18
+ <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12">
19
+ <div className="flex items-center justify-between mb-12">
20
+ <div className="flex items-center space-x-4">
21
+ <IconBadge
22
+ variant="category"
23
+ category={7}
24
+ size="lg"
25
+ icon={<Database className="w-6 h-6" />}
26
+ />
27
+ <div>
28
+ <h1 className="text-4xl font-bold text-foreground">Entity Management</h1>
29
+ <p className="text-lg text-muted-foreground mt-2">
30
+ Cross-domain template for CRUD operations with intelligent search, filtering, and bulk actions
31
+ </p>
32
+ </div>
33
+ </div>
34
+
35
+ <div className="flex items-center space-x-3">
36
+ <Button variant="outline" size="sm">
37
+ <Plus className="w-4 h-4 mr-2" />
38
+ Add Transaction
39
+ </Button>
40
+ <div className="flex items-center gap-3 bg-card/80 backdrop-blur-sm border border-border/50 rounded px-3 py-2">
41
+ <Layers className="w-4 h-4 text-muted-foreground" />
42
+ <span className="text-sm font-medium text-foreground">Demo Mode</span>
43
+ <Switch checked={true} disabled />
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ {/* Feature Toggles */}
49
+ <div className="mb-8">
50
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
51
+ <div className="flex items-center gap-3 bg-card/50 backdrop-blur-sm border border-border/30 rounded px-3 py-2">
52
+ <Search className="w-4 h-4 text-muted-foreground" />
53
+ <span className="text-sm font-medium text-foreground">Search</span>
54
+ <Switch
55
+ checked={enableSearch}
56
+ onCheckedChange={setEnableSearch}
57
+ />
58
+ </div>
59
+ <div className="flex items-center gap-3 bg-card/50 backdrop-blur-sm border border-border/30 rounded px-3 py-2">
60
+ <Filter className="w-4 h-4 text-muted-foreground" />
61
+ <span className="text-sm font-medium text-foreground">Filters</span>
62
+ <Switch
63
+ checked={enableFiltering}
64
+ onCheckedChange={setEnableFiltering}
65
+ />
66
+ </div>
67
+ <div className="flex items-center gap-3 bg-card/50 backdrop-blur-sm border border-border/30 rounded px-3 py-2">
68
+ <Database className="w-4 h-4 text-muted-foreground" />
69
+ <span className="text-sm font-medium text-foreground">Bulk Actions</span>
70
+ <Switch
71
+ checked={enableBulkActions}
72
+ onCheckedChange={setEnableBulkActions}
73
+ />
74
+ </div>
75
+ <div className="flex items-center gap-3 bg-card/50 backdrop-blur-sm border border-border/30 rounded px-3 py-2">
76
+ <Download className="w-4 h-4 text-muted-foreground" />
77
+ <span className="text-sm font-medium text-foreground">Export</span>
78
+ <Switch
79
+ checked={enableExport}
80
+ onCheckedChange={setEnableExport}
81
+ />
82
+ </div>
83
+ </div>
84
+ </div>
85
+
86
+ <div className="space-y-12">
87
+ <ShowcaseSection
88
+ title="Entity List with Advanced Features"
89
+ description="Smart data table with domain-aware column rendering, search, filtering, and bulk operations"
90
+ badge={{
91
+ text: "Full Featured",
92
+ variant: "category",
93
+ category: 3
94
+ }}
95
+ >
96
+ <EntityListPanel
97
+ config={financialConfig}
98
+ data={sampleFinancialData}
99
+ isLoading={false}
100
+ enableSearch={enableSearch}
101
+ enableFiltering={enableFiltering}
102
+ enableBulkActions={enableBulkActions}
103
+ enableExport={enableExport}
104
+ onItemClick={(item: FinancialTransaction) => {
105
+ console.log('Item clicked:', item);
106
+ }}
107
+ onItemEdit={(item: FinancialTransaction) => {
108
+ console.log('Item edit:', item);
109
+ }}
110
+ onItemDelete={(item: FinancialTransaction) => {
111
+ console.log('Item delete:', item);
112
+ }}
113
+ onBulkAction={(action: string, items: FinancialTransaction[]) => {
114
+ console.log('Bulk action:', action, items);
115
+ }}
116
+ onSearch={(query: string) => {
117
+ console.log('Search:', query);
118
+ }}
119
+ onFilter={(filters: Record<string, any>) => {
120
+ console.log('Filter:', filters);
121
+ }}
122
+ onSort={(field: string, direction: 'asc' | 'desc') => {
123
+ console.log('Sort:', field, direction);
124
+ }}
125
+ onExport={(format: 'csv' | 'json' | 'xlsx') => {
126
+ console.log('Export:', format);
127
+ return Promise.resolve();
128
+ }}
129
+ />
130
+ </ShowcaseSection>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ );
135
+ };
136
+
137
+ export default EntityManagementShowcase;
@@ -0,0 +1,117 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ MetricsOverviewWithInsightsPanel,
4
+ TrendAnalysisPanel,
5
+ CategoryBreakdownPanel
6
+ } from '../../organisms/entity';
7
+ import { financialConfig, sampleFinancialData } from '../../templates/entity/configs/financial-config';
8
+ import { ShowcaseSection } from '../../molecules/layout/ShowcaseSection';
9
+ import { IconBadge } from '../../atoms/composed/IconBadge';
10
+ import { Switch } from '../../atoms/ui/Switch';
11
+ import { BarChart3, TrendingUp, PieChart, Layers } from 'lucide-react';
12
+
13
+ export const EntityPerformanceShowcase: React.FC = () => {
14
+ const [showInsights, setShowInsights] = useState(true);
15
+ const [showTrends, setShowTrends] = useState(true);
16
+ const [showCategories, setShowCategories] = useState(true);
17
+
18
+ return (
19
+ <div className="min-h-screen bg-background">
20
+ <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12">
21
+ <div className="flex items-center justify-between mb-12">
22
+ <div className="flex items-center space-x-4">
23
+ <IconBadge
24
+ variant="category"
25
+ category={6}
26
+ size="lg"
27
+ icon={<BarChart3 className="w-6 h-6" />}
28
+ />
29
+ <div>
30
+ <h1 className="text-4xl font-bold text-foreground">Performance Dashboard</h1>
31
+ <p className="text-lg text-muted-foreground mt-2">
32
+ Cross-domain entity template showcasing configurable performance metrics and analytics
33
+ </p>
34
+ </div>
35
+ </div>
36
+
37
+ <div className="flex items-center space-x-3">
38
+ <div className="flex items-center gap-3 bg-card/80 backdrop-blur-sm border border-border/50 rounded px-3 py-2">
39
+ <Layers className="w-4 h-4 text-muted-foreground" />
40
+ <span className="text-sm font-medium text-foreground">Live Data</span>
41
+ <Switch checked={true} disabled />
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ <div className="space-y-12">
47
+ {showInsights && (
48
+ <ShowcaseSection
49
+ title="Metrics Overview with Insights"
50
+ description="Configurable KPI displays with automated insights and trend indicators"
51
+ badge={{
52
+ text: "Interactive",
53
+ variant: "category",
54
+ category: 2
55
+ }}
56
+ >
57
+ <MetricsOverviewWithInsightsPanel
58
+ metrics={financialConfig.metrics}
59
+ data={sampleFinancialData}
60
+ isLoading={false}
61
+ showInsights={true}
62
+ onMetricClick={(metric, value) => {
63
+ console.log('Metric clicked:', metric.label, value);
64
+ }}
65
+ />
66
+ </ShowcaseSection>
67
+ )}
68
+
69
+ {showTrends && (
70
+ <ShowcaseSection
71
+ title="Trend Analysis"
72
+ description="Time-series visualizations with forecasting and period comparison"
73
+ badge={{
74
+ text: "Dynamic",
75
+ variant: "category",
76
+ category: 4
77
+ }}
78
+ >
79
+ <TrendAnalysisPanel
80
+ metrics={financialConfig.metrics}
81
+ data={sampleFinancialData}
82
+ isLoading={false}
83
+ onTrendPeriodChange={(period) => {
84
+ console.log('Trend period changed:', period);
85
+ }}
86
+ />
87
+ </ShowcaseSection>
88
+ )}
89
+
90
+ {showCategories && (
91
+ <ShowcaseSection
92
+ title="Category Breakdown"
93
+ description="Hierarchical data visualization with drill-down capabilities"
94
+ badge={{
95
+ text: "Explorable",
96
+ variant: "category",
97
+ category: 7
98
+ }}
99
+ >
100
+ <CategoryBreakdownPanel
101
+ categoryConfig={financialConfig.categories}
102
+ valueField="amount"
103
+ data={sampleFinancialData}
104
+ isLoading={false}
105
+ onCategoryClick={(category) => {
106
+ console.log('Category clicked:', category);
107
+ }}
108
+ />
109
+ </ShowcaseSection>
110
+ )}
111
+ </div>
112
+ </div>
113
+ </div>
114
+ );
115
+ };
116
+
117
+ export default EntityPerformanceShowcase;
@@ -0,0 +1,2 @@
1
+ export { EntityPerformanceShowcase } from './EntityPerformanceShowcase';
2
+ export { EntityManagementShowcase } from './EntityManagementShowcase';
@@ -0,0 +1,229 @@
1
+ import React, { useState } from 'react';
2
+ import { EntityPerformanceDashboardTemplate } from '../templates/entity';
3
+ import { DashboardWithSidePanel } from '../molecules/layout';
4
+ import { financialConfig, sampleFinancialData } from '../templates/entity/configs/financial-config';
5
+ import { DataTable } from '../atoms/composed/DataTable';
6
+ import { DataBadge } from '../atoms/composed/DataBadge';
7
+ import { Card } from '../atoms/ui/card';
8
+ import { Button } from '../atoms/ui/button';
9
+ import { DollarSign, TrendingUp, TrendingDown, Eye, Filter } from 'lucide-react';
10
+
11
+ // Enhanced transaction data for side panel
12
+ const recentTransactions = [
13
+ {
14
+ id: 'TXN-001',
15
+ description: 'Product Sale - Premium Package',
16
+ amount: 2499.99,
17
+ type: 'income',
18
+ category: 'Sales',
19
+ date: '2024-06-08',
20
+ status: 'completed',
21
+ customer: 'Acme Corp'
22
+ },
23
+ {
24
+ id: 'TXN-002',
25
+ description: 'Subscription Revenue',
26
+ amount: 149.99,
27
+ type: 'income',
28
+ category: 'Recurring',
29
+ date: '2024-06-08',
30
+ status: 'completed',
31
+ customer: 'TechStart Inc'
32
+ },
33
+ {
34
+ id: 'TXN-003',
35
+ description: 'Refund - Service Cancellation',
36
+ amount: -299.99,
37
+ type: 'expense',
38
+ category: 'Refunds',
39
+ date: '2024-06-07',
40
+ status: 'processed',
41
+ customer: 'Beta Solutions'
42
+ },
43
+ {
44
+ id: 'TXN-004',
45
+ description: 'Consulting Services',
46
+ amount: 1200.00,
47
+ type: 'income',
48
+ category: 'Services',
49
+ date: '2024-06-07',
50
+ status: 'completed',
51
+ customer: 'Global Enterprises'
52
+ },
53
+ {
54
+ id: 'TXN-005',
55
+ description: 'Platform License',
56
+ amount: 599.99,
57
+ type: 'income',
58
+ category: 'Licenses',
59
+ date: '2024-06-06',
60
+ status: 'pending',
61
+ customer: 'StartupXYZ'
62
+ }
63
+ ];
64
+
65
+ const transactionColumns = [
66
+ {
67
+ key: 'id',
68
+ header: 'Transaction ID',
69
+ render: (value: string) => (
70
+ <code className="text-xs bg-muted px-2 py-1 rounded">{value}</code>
71
+ )
72
+ },
73
+ {
74
+ key: 'description',
75
+ header: 'Description',
76
+ render: (value: string) => (
77
+ <div className="max-w-[200px] truncate" title={value}>
78
+ {value}
79
+ </div>
80
+ )
81
+ },
82
+ {
83
+ key: 'amount',
84
+ header: 'Amount',
85
+ render: (value: number) => (
86
+ <div className={`font-medium ${value >= 0 ? 'text-green-600' : 'text-red-600'}`}>
87
+ {value >= 0 ? '+' : ''}${Math.abs(value).toLocaleString()}
88
+ </div>
89
+ )
90
+ },
91
+ {
92
+ key: 'category',
93
+ header: 'Category',
94
+ render: (value: string) => (
95
+ <DataBadge variant="category" category={1}>
96
+ {value}
97
+ </DataBadge>
98
+ )
99
+ },
100
+ {
101
+ key: 'status',
102
+ header: 'Status',
103
+ render: (value: string) => (
104
+ <DataBadge variant="status" status={value === 'completed' ? 'success' : value === 'pending' ? 'warning' : 'info'}>
105
+ {value}
106
+ </DataBadge>
107
+ )
108
+ }
109
+ ];
110
+
111
+ export const EntityTemplateExample: React.FC = () => {
112
+ const [showSidePanel, setShowSidePanel] = useState(true);
113
+
114
+ const handleTransactionClick = (transaction: any) => {
115
+ console.log('Transaction selected:', transaction);
116
+ };
117
+
118
+ return (
119
+ <DashboardWithSidePanel
120
+ showSidePanel={showSidePanel}
121
+ sidePanelWidth={80}
122
+ sidePanel={
123
+ <div className="fixed right-0 top-16 h-[calc(100vh-4rem)] w-80 bg-background border-l border-border shadow-lg flex flex-col z-30">
124
+ {/* Side Panel Header */}
125
+ <div className="p-4 border-b border-border bg-muted/30">
126
+ <div className="flex items-center justify-between">
127
+ <h3 className="font-semibold">Recent Transactions</h3>
128
+ <Button
129
+ variant="ghost"
130
+ size="sm"
131
+ onClick={() => setShowSidePanel(false)}
132
+ >
133
+ ×
134
+ </Button>
135
+ </div>
136
+ <p className="text-sm text-muted-foreground mt-1">
137
+ Latest financial activity
138
+ </p>
139
+ </div>
140
+
141
+ {/* Transaction Summary Cards */}
142
+ <div className="p-4 space-y-3 border-b border-border">
143
+ <Card className="p-3">
144
+ <div className="flex items-center justify-between">
145
+ <div className="flex items-center gap-2">
146
+ <TrendingUp className="w-4 h-4 text-green-600" />
147
+ <span className="text-sm font-medium">Today's Income</span>
148
+ </div>
149
+ <span className="text-green-600 font-semibold">+$2,649.98</span>
150
+ </div>
151
+ </Card>
152
+
153
+ <Card className="p-3">
154
+ <div className="flex items-center justify-between">
155
+ <div className="flex items-center gap-2">
156
+ <TrendingDown className="w-4 h-4 text-red-600" />
157
+ <span className="text-sm font-medium">Today's Expenses</span>
158
+ </div>
159
+ <span className="text-red-600 font-semibold">-$299.99</span>
160
+ </div>
161
+ </Card>
162
+ </div>
163
+
164
+ {/* Transaction List */}
165
+ <div className="flex-1 overflow-auto p-4">
166
+ <DataTable
167
+ data={recentTransactions}
168
+ columns={transactionColumns}
169
+ showSearch={true}
170
+ searchPlaceholder="Search transactions..."
171
+ showPagination={false}
172
+ onRowClick={handleTransactionClick}
173
+ className="text-xs"
174
+ compact={true}
175
+ />
176
+ </div>
177
+
178
+ {/* Side Panel Footer */}
179
+ <div className="p-4 border-t border-border bg-muted/30">
180
+ <Button variant="outline" size="sm" className="w-full">
181
+ <DollarSign className="w-4 h-4 mr-2" />
182
+ View All Transactions
183
+ </Button>
184
+ </div>
185
+ </div>
186
+ }
187
+ >
188
+ <EntityPerformanceDashboardTemplate
189
+ config={financialConfig}
190
+ data={sampleFinancialData}
191
+ isLoading={false}
192
+ layout="standard"
193
+ showInsights={true}
194
+ showTrends={true}
195
+ showCategories={true}
196
+ onMetricClick={(metric, value) => {
197
+ console.log('Metric clicked:', metric.label, value);
198
+ }}
199
+ onCategoryClick={(category) => {
200
+ console.log('Category clicked:', category);
201
+ }}
202
+ onTrendPeriodChange={(period) => {
203
+ console.log('Trend period changed:', period);
204
+ }}
205
+ onExport={(type, data) => {
206
+ console.log('Export requested:', type, data);
207
+ }}
208
+ headerSlot={
209
+ <div className="flex gap-2">
210
+ <Button
211
+ variant="outline"
212
+ size="sm"
213
+ onClick={() => setShowSidePanel(!showSidePanel)}
214
+ >
215
+ <Eye className="w-4 h-4 mr-2" />
216
+ {showSidePanel ? 'Hide' : 'Show'} Transactions
217
+ </Button>
218
+ <Button variant="outline" size="sm">
219
+ <Filter className="w-4 h-4 mr-2" />
220
+ Filter Data
221
+ </Button>
222
+ </div>
223
+ }
224
+ />
225
+ </DashboardWithSidePanel>
226
+ );
227
+ };
228
+
229
+ export default EntityTemplateExample;