@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
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pattern-stack/frontend-patterns",
3
3
  "description": "Production-ready React frontend template with atomic architecture patterns. Build ultra-lean applications by importing shared UI foundation patterns.",
4
4
  "private": false,
5
- "version": "0.0.4",
5
+ "version": "0.0.5",
6
6
  "keywords": [
7
7
  "react",
8
8
  "typescript",
@@ -44,7 +44,7 @@
44
44
  "scripts": {
45
45
  "dev": "vite",
46
46
  "build": "tsc -b && vite build",
47
- "build:lib": "npm run clean && vite build --mode library && tsc -p tsconfig.lib.json",
47
+ "build:lib": "npm run clean && vite build --mode library",
48
48
  "clean": "rm -rf dist",
49
49
  "lint": "eslint .",
50
50
  "lint:fix": "eslint . --fix",
@@ -102,9 +102,12 @@
102
102
  "@vitejs/plugin-react": "^4.4.1",
103
103
  "@vitest/coverage-v8": "^3.2.1",
104
104
  "autoprefixer": "^10.4.21",
105
+ "concurrently": "^9.1.2",
106
+ "cors": "^2.8.5",
105
107
  "eslint": "^9.25.0",
106
108
  "eslint-plugin-react-hooks": "^5.2.0",
107
109
  "eslint-plugin-react-refresh": "^0.4.19",
110
+ "express": "^5.1.0",
108
111
  "globals": "^16.0.0",
109
112
  "jsdom": "^26.1.0",
110
113
  "postcss": "^8.5.3",
@@ -115,4 +118,4 @@
115
118
  "vite": "^6.3.5",
116
119
  "vitest": "^3.2.1"
117
120
  }
118
- }
121
+ }
package/src/App.tsx CHANGED
@@ -15,8 +15,12 @@ import {
15
15
  ComponentShowcase,
16
16
  AdminDashboardShowcase,
17
17
  AdminCRUDShowcase,
18
- AdminDetailShowcase
18
+ AdminDetailShowcase,
19
+ SalesPerformanceDashboard,
20
+ EntityPerformanceShowcase,
21
+ EntityManagementShowcase
19
22
  } from './pages';
23
+ import { EntityTemplateExample } from './pages/EntityTemplateExample';
20
24
 
21
25
  function App() {
22
26
  return (
@@ -41,6 +45,12 @@ function App() {
41
45
  <Route path="admin/dashboard" element={<ErrorBoundary><AdminDashboardShowcase /></ErrorBoundary>} />
42
46
  <Route path="admin/users" element={<ErrorBoundary><AdminCRUDShowcase /></ErrorBoundary>} />
43
47
  <Route path="admin/user/:id" element={<ErrorBoundary><AdminDetailShowcase /></ErrorBoundary>} />
48
+ <Route path="admin/sales" element={<ErrorBoundary><SalesPerformanceDashboard /></ErrorBoundary>} />
49
+
50
+ {/* Entity Template Showcases */}
51
+ <Route path="entity/performance" element={<ErrorBoundary><EntityPerformanceShowcase /></ErrorBoundary>} />
52
+ <Route path="entity/management" element={<ErrorBoundary><EntityManagementShowcase /></ErrorBoundary>} />
53
+ <Route path="entity/template-example" element={<ErrorBoundary><EntityTemplateExample /></ErrorBoundary>} />
44
54
 
45
55
  {/* Fallback */}
46
56
  <Route path="*" element={<ErrorBoundary><ComponentShowcasePage /></ErrorBoundary>} />
@@ -0,0 +1,116 @@
1
+ import React from 'react';
2
+ import { DataBadge } from '../DataBadge';
3
+ import { Button } from '../../ui/button';
4
+ import {
5
+ Target,
6
+ ExternalLink
7
+ } from 'lucide-react';
8
+
9
+ interface SalesPanelProps {
10
+ sales: Array<{
11
+ id: string;
12
+ customer: string;
13
+ product: string;
14
+ amount: number;
15
+ stage: string;
16
+ salesperson: string;
17
+ region: string;
18
+ closeDate: string;
19
+ dealSize: string;
20
+ }>;
21
+ onSaleClick?: (sale: any) => void;
22
+ onClose?: () => void;
23
+ }
24
+
25
+ const getStageStatus = (stage: string) => {
26
+ switch (stage) {
27
+ case 'Closed Won': return 'success';
28
+ case 'Negotiation': return 'warning';
29
+ case 'Proposal Sent': return 'info';
30
+ case 'Qualified': return 'info';
31
+ case 'Discovery': return 'neutral';
32
+ default: return 'neutral';
33
+ }
34
+ };
35
+
36
+ export const SalesPanel: React.FC<SalesPanelProps> = ({
37
+ sales,
38
+ onSaleClick,
39
+ onClose
40
+ }) => {
41
+ const topDeals = sales.slice(0, 5); // Show only top 5 recent deals
42
+ const totalValue = sales.reduce((sum, sale) => sum + sale.amount, 0);
43
+
44
+ return (
45
+ <div className="fixed right-0 top-16 h-[calc(100vh-4rem)] w-72 bg-background border-l border-border shadow-lg flex flex-col z-30">
46
+ {/* Header */}
47
+ <div className="p-3 border-b border-border">
48
+ <div className="flex items-center justify-between">
49
+ <h3 className="font-medium flex items-center gap-2">
50
+ <Target className="w-4 h-4" />
51
+ Pipeline
52
+ </h3>
53
+ {onClose && (
54
+ <Button variant="ghost" size="sm" onClick={onClose}>
55
+ ×
56
+ </Button>
57
+ )}
58
+ </div>
59
+ </div>
60
+
61
+ {/* Quick Stats */}
62
+ <div className="p-3 border-b border-border">
63
+ <div className="space-y-2">
64
+ <div className="flex justify-between">
65
+ <span className="text-sm text-muted-foreground">Total Value</span>
66
+ <span className="font-semibold text-green-600">${totalValue.toLocaleString()}</span>
67
+ </div>
68
+ <div className="flex justify-between">
69
+ <span className="text-sm text-muted-foreground">Active Deals</span>
70
+ <span className="font-semibold">{sales.length}</span>
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ {/* Recent Deals */}
76
+ <div className="flex-1 overflow-auto p-3">
77
+ <h4 className="text-sm font-medium mb-3">Recent Opportunities</h4>
78
+ <div className="space-y-2">
79
+ {topDeals.map((sale) => (
80
+ <div
81
+ key={sale.id}
82
+ className="p-2 border border-border rounded-md hover:bg-muted/50 cursor-pointer transition-colors"
83
+ onClick={() => onSaleClick?.(sale)}
84
+ >
85
+ <div className="flex justify-between items-start mb-1">
86
+ <div className="flex-1 min-w-0">
87
+ <p className="text-sm font-medium truncate">{sale.customer}</p>
88
+ <p className="text-xs text-muted-foreground truncate">{sale.product}</p>
89
+ </div>
90
+ <div className="text-right ml-2">
91
+ <p className="text-sm font-semibold text-green-600">
92
+ ${sale.amount.toLocaleString()}
93
+ </p>
94
+ </div>
95
+ </div>
96
+ <div className="flex justify-between items-center">
97
+ <DataBadge variant="status" status={getStageStatus(sale.stage)}>
98
+ {sale.stage}
99
+ </DataBadge>
100
+ <span className="text-xs text-muted-foreground">{sale.salesperson}</span>
101
+ </div>
102
+ </div>
103
+ ))}
104
+ </div>
105
+ </div>
106
+
107
+ {/* Footer */}
108
+ <div className="p-3 border-t border-border">
109
+ <Button variant="outline" size="sm" className="w-full">
110
+ <ExternalLink className="w-4 h-4 mr-2" />
111
+ View All Deals
112
+ </Button>
113
+ </div>
114
+ </div>
115
+ );
116
+ };
@@ -0,0 +1 @@
1
+ export { SalesPanel } from './SalesPanel';
@@ -0,0 +1,151 @@
1
+ // Mock sales data for demonstrations
2
+ export const mockSalesData = [
3
+ {
4
+ id: 'SALE-2024-001',
5
+ customer: 'TechCorp Industries',
6
+ product: 'Enterprise License',
7
+ amount: 45000,
8
+ stage: 'Closed Won',
9
+ salesperson: 'Sarah Chen',
10
+ region: 'North America',
11
+ closeDate: '2024-06-08',
12
+ dealSize: 'Large'
13
+ },
14
+ {
15
+ id: 'SALE-2024-002',
16
+ customer: 'StartupXYZ',
17
+ product: 'Professional Plan',
18
+ amount: 12000,
19
+ stage: 'Proposal Sent',
20
+ salesperson: 'Mike Johnson',
21
+ region: 'North America',
22
+ closeDate: '2024-06-15',
23
+ dealSize: 'Medium'
24
+ },
25
+ {
26
+ id: 'SALE-2024-003',
27
+ customer: 'Global Enterprises Ltd',
28
+ product: 'Enterprise Suite',
29
+ amount: 78000,
30
+ stage: 'Negotiation',
31
+ salesperson: 'Lisa Wang',
32
+ region: 'Europe',
33
+ closeDate: '2024-06-20',
34
+ dealSize: 'Large'
35
+ },
36
+ {
37
+ id: 'SALE-2024-004',
38
+ customer: 'Innovation Labs',
39
+ product: 'Starter Package',
40
+ amount: 5000,
41
+ stage: 'Qualified',
42
+ salesperson: 'David Kim',
43
+ region: 'Asia Pacific',
44
+ closeDate: '2024-06-25',
45
+ dealSize: 'Small'
46
+ },
47
+ {
48
+ id: 'SALE-2024-005',
49
+ customer: 'FutureTech Solutions',
50
+ product: 'Custom Integration',
51
+ amount: 95000,
52
+ stage: 'Discovery',
53
+ salesperson: 'Sarah Chen',
54
+ region: 'North America',
55
+ closeDate: '2024-07-01',
56
+ dealSize: 'Large'
57
+ }
58
+ ];
59
+
60
+ // Sales configuration for entity template
61
+ export const salesConfig = {
62
+ entityType: 'performance' as const,
63
+ display: {
64
+ title: 'Sales Performance',
65
+ subtitle: 'Monitor sales metrics, team performance, and revenue trends',
66
+ category: 3 as const
67
+ },
68
+ metrics: [
69
+ {
70
+ key: 'revenue',
71
+ label: 'Total Revenue',
72
+ type: 'currency' as const,
73
+ aggregate: 'sum',
74
+ showTrend: true,
75
+ category: 2
76
+ },
77
+ {
78
+ key: 'deals',
79
+ label: 'Deals Closed',
80
+ type: 'number' as const,
81
+ aggregate: 'count',
82
+ showTrend: true,
83
+ category: 3
84
+ },
85
+ {
86
+ key: 'conversion',
87
+ label: 'Conversion Rate',
88
+ type: 'percentage' as const,
89
+ aggregate: 'average',
90
+ showTrend: true,
91
+ category: 1
92
+ },
93
+ {
94
+ key: 'pipeline',
95
+ label: 'Pipeline Value',
96
+ type: 'currency' as const,
97
+ aggregate: 'sum',
98
+ showTrend: true,
99
+ category: 4
100
+ }
101
+ ],
102
+ categories: [
103
+ { key: 'region', label: 'By Region', type: 'categorical' },
104
+ { key: 'product', label: 'By Product', type: 'categorical' },
105
+ { key: 'stage', label: 'By Stage', type: 'categorical' }
106
+ ],
107
+ trends: {
108
+ periods: ['7d', '30d', '90d', '1y'],
109
+ defaultPeriod: '30d'
110
+ }
111
+ };
112
+
113
+ // Sample sales performance data
114
+ export const salesPerformanceData = [
115
+ {
116
+ id: 'sale-1',
117
+ revenue: 45000,
118
+ deals: 12,
119
+ conversion: 0.24,
120
+ pipeline: 125000,
121
+ region: 'North America',
122
+ product: 'Enterprise',
123
+ stage: 'Closed Won',
124
+ date: '2024-06-01',
125
+ salesperson: 'Sarah Chen'
126
+ },
127
+ {
128
+ id: 'sale-2',
129
+ revenue: 32000,
130
+ deals: 8,
131
+ conversion: 0.18,
132
+ pipeline: 89000,
133
+ region: 'Europe',
134
+ product: 'Professional',
135
+ stage: 'Negotiation',
136
+ date: '2024-06-02',
137
+ salesperson: 'Mike Johnson'
138
+ },
139
+ {
140
+ id: 'sale-3',
141
+ revenue: 67000,
142
+ deals: 15,
143
+ conversion: 0.31,
144
+ pipeline: 156000,
145
+ region: 'Asia Pacific',
146
+ product: 'Enterprise',
147
+ stage: 'Closed Won',
148
+ date: '2024-06-03',
149
+ salesperson: 'Lisa Wang'
150
+ }
151
+ ];
@@ -1,5 +1,6 @@
1
1
  // Business-specific shared components
2
2
  export { DataBadge } from './DataBadge';
3
+ export { SalesPanel } from './SalesPanel';
3
4
  export { StatCard } from './StatCard';
4
5
  export { DetailedCard } from './DetailedCard';
5
6
  export { EmptyState } from './EmptyState';
@@ -0,0 +1,127 @@
1
+ import * as React from 'react';
2
+
3
+ export type EntityType = 'transactional' | 'categorical' | 'temporal';
4
+
5
+ export type MetricType = 'currency' | 'percentage' | 'count' | 'duration' | 'ratio';
6
+
7
+ export type AggregationType = 'sum' | 'avg' | 'count' | 'min' | 'max';
8
+
9
+ export type TemporalCycle = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly';
10
+
11
+ export type ForecastingAlgorithm = 'linear' | 'seasonal' | 'ml';
12
+
13
+ export type ActionType = 'primary' | 'secondary' | 'danger';
14
+
15
+ export interface FormatConfig {
16
+ decimals?: number;
17
+ prefix?: string;
18
+ suffix?: string;
19
+ thousands?: boolean;
20
+ }
21
+
22
+ export interface MetricConfig {
23
+ key: string;
24
+ label: string;
25
+ type: MetricType;
26
+ format?: FormatConfig;
27
+ trend?: boolean;
28
+ target?: number | ((data: EntityData[]) => number);
29
+ aggregation?: AggregationType;
30
+ icon?: React.ComponentType;
31
+ }
32
+
33
+ export interface TemporalConfig {
34
+ cycles: TemporalCycle[];
35
+ defaultCycle: TemporalCycle;
36
+ enableComparisons: boolean;
37
+ forecasting?: {
38
+ enabled: boolean;
39
+ periods: number;
40
+ algorithm: ForecastingAlgorithm;
41
+ };
42
+ }
43
+
44
+ export interface CategoryConfig {
45
+ hierarchy: string[];
46
+ defaultGroupBy: string;
47
+ enableDrillDown: boolean;
48
+ colorCoding?: boolean;
49
+ }
50
+
51
+ export interface ActionConfig {
52
+ label: string;
53
+ type: ActionType;
54
+ onClick: (context: { selectedItems?: EntityData[]; data?: EntityData[]; config?: EntityTemplateConfig }) => void | Promise<void>;
55
+ icon?: React.ComponentType;
56
+ permissions?: string[];
57
+ validation?: (context: { selectedItems?: EntityData[]; data?: EntityData[]; config?: EntityTemplateConfig }) => boolean;
58
+ }
59
+
60
+ export interface BusinessRulesConfig<T> {
61
+ validation?: (item: T) => string[];
62
+ constraints?: {
63
+ [key: string]: {
64
+ min?: number;
65
+ max?: number;
66
+ required?: boolean;
67
+ pattern?: RegExp;
68
+ };
69
+ };
70
+ workflows?: {
71
+ [status: string]: string[];
72
+ };
73
+ }
74
+
75
+ export interface EntityDisplayConfig {
76
+ title: string;
77
+ description?: string;
78
+ category?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
79
+ }
80
+
81
+ export interface EntityTemplateConfig<T = EntityData> {
82
+ entityType: EntityType;
83
+ display: EntityDisplayConfig;
84
+ metrics: MetricConfig[];
85
+ temporal?: TemporalConfig;
86
+ categories?: CategoryConfig;
87
+ businessRules?: BusinessRulesConfig<T>;
88
+ actions?: ActionConfig[];
89
+ }
90
+
91
+ export interface EntityData {
92
+ id: string | number;
93
+ [key: string]: unknown;
94
+ }
95
+
96
+ export interface MetricValue {
97
+ current: number;
98
+ previous?: number;
99
+ trend?: 'up' | 'down' | 'neutral';
100
+ target?: number;
101
+ formattedValue: string;
102
+ }
103
+
104
+ export interface CategoryBreakdown {
105
+ category: string;
106
+ value: number;
107
+ percentage: number;
108
+ color?: string;
109
+ subcategories?: CategoryBreakdown[];
110
+ }
111
+
112
+ export interface TrendDataPoint {
113
+ date: string;
114
+ value: number;
115
+ label?: string;
116
+ }
117
+
118
+ export interface EntityAnalyticsData {
119
+ metrics: Record<string, MetricValue>;
120
+ categories: CategoryBreakdown[];
121
+ trends: Record<string, TrendDataPoint[]>;
122
+ insights?: {
123
+ type: 'positive' | 'negative' | 'neutral';
124
+ message: string;
125
+ value?: number;
126
+ }[];
127
+ }
@@ -1,4 +1,5 @@
1
1
  // Export all type definitions
2
2
  export * from './generated';
3
3
  export * from './loading';
4
- export * from './auth';
4
+ export * from './auth';
5
+ export * from './entity-config';