@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.11

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 (306) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/components/ui/accessibility-demo.esm.js +30 -24
  3. package/dist/components/ui/accessibility-demo.js +30 -24
  4. package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
  5. package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
  6. package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
  7. package/dist/components/ui/advanced-transition-system-demo.js +110 -64
  8. package/dist/components/ui/advanced-transition-system.esm.js +166 -122
  9. package/dist/components/ui/advanced-transition-system.js +166 -122
  10. package/dist/components/ui/animation/animated-container.esm.js +52 -29
  11. package/dist/components/ui/animation/animated-container.js +52 -29
  12. package/dist/components/ui/animation/staggered-container.esm.js +18 -9
  13. package/dist/components/ui/animation/staggered-container.js +18 -9
  14. package/dist/components/ui/animation-demo.esm.js +67 -35
  15. package/dist/components/ui/animation-demo.js +67 -35
  16. package/dist/components/ui/badge.esm.js +9 -6
  17. package/dist/components/ui/badge.js +9 -6
  18. package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
  19. package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
  20. package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
  21. package/dist/components/ui/border-radius-shadow-demo.js +23 -12
  22. package/dist/components/ui/button.esm.js +8 -2
  23. package/dist/components/ui/button.js +8 -2
  24. package/dist/components/ui/card.esm.js +33 -8
  25. package/dist/components/ui/card.js +33 -8
  26. package/dist/components/ui/checkbox.esm.js +3 -3
  27. package/dist/components/ui/checkbox.js +3 -3
  28. package/dist/components/ui/color-preview.esm.js +68 -45
  29. package/dist/components/ui/color-preview.js +68 -45
  30. package/dist/components/ui/data-display/chart.esm.js +112 -84
  31. package/dist/components/ui/data-display/chart.js +112 -84
  32. package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
  33. package/dist/components/ui/data-display/data-grid-simple.js +1 -1
  34. package/dist/components/ui/data-display/data-grid.esm.js +80 -67
  35. package/dist/components/ui/data-display/data-grid.js +80 -67
  36. package/dist/components/ui/data-display/list.esm.js +53 -45
  37. package/dist/components/ui/data-display/list.js +53 -45
  38. package/dist/components/ui/data-display/table.esm.js +62 -54
  39. package/dist/components/ui/data-display/table.js +62 -54
  40. package/dist/components/ui/data-display/timeline.esm.js +39 -34
  41. package/dist/components/ui/data-display/timeline.js +39 -34
  42. package/dist/components/ui/data-display/tree.esm.js +116 -84
  43. package/dist/components/ui/data-display/tree.js +116 -84
  44. package/dist/components/ui/data-display/types.esm.js +389 -364
  45. package/dist/components/ui/data-display/types.js +389 -364
  46. package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
  47. package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
  48. package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
  49. package/dist/components/ui/enterprise-mobile-experience.js +124 -73
  50. package/dist/components/ui/feedback/alert.esm.js +22 -15
  51. package/dist/components/ui/feedback/alert.js +22 -15
  52. package/dist/components/ui/feedback/progress.esm.js +47 -24
  53. package/dist/components/ui/feedback/progress.js +47 -24
  54. package/dist/components/ui/feedback/skeleton.esm.js +39 -29
  55. package/dist/components/ui/feedback/skeleton.js +39 -29
  56. package/dist/components/ui/feedback/toast.esm.js +62 -38
  57. package/dist/components/ui/feedback/toast.js +62 -38
  58. package/dist/components/ui/feedback/types.esm.js +83 -83
  59. package/dist/components/ui/feedback/types.js +83 -83
  60. package/dist/components/ui/font-preview.esm.js +41 -39
  61. package/dist/components/ui/font-preview.js +41 -39
  62. package/dist/components/ui/form-demo.esm.js +150 -113
  63. package/dist/components/ui/form-demo.js +150 -113
  64. package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
  65. package/dist/components/ui/hardware-acceleration-demo.js +137 -87
  66. package/dist/components/ui/input.esm.js +4 -1
  67. package/dist/components/ui/input.js +4 -1
  68. package/dist/components/ui/layout-demo.esm.js +81 -56
  69. package/dist/components/ui/layout-demo.js +81 -56
  70. package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
  71. package/dist/components/ui/layouts/adaptive-layout.js +27 -8
  72. package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
  73. package/dist/components/ui/layouts/desktop-layout.js +39 -19
  74. package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
  75. package/dist/components/ui/layouts/mobile-layout.js +19 -9
  76. package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
  77. package/dist/components/ui/layouts/tablet-layout.js +28 -14
  78. package/dist/components/ui/mobile-form-validation.esm.js +120 -87
  79. package/dist/components/ui/mobile-form-validation.js +120 -87
  80. package/dist/components/ui/mobile-input-demo.esm.js +19 -13
  81. package/dist/components/ui/mobile-input-demo.js +19 -13
  82. package/dist/components/ui/mobile-input.esm.js +185 -120
  83. package/dist/components/ui/mobile-input.js +185 -120
  84. package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
  85. package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
  86. package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
  87. package/dist/components/ui/navigation/breadcrumb.js +17 -14
  88. package/dist/components/ui/navigation/index.esm.js +0 -1
  89. package/dist/components/ui/navigation/index.js +0 -1
  90. package/dist/components/ui/navigation/menu.esm.js +49 -35
  91. package/dist/components/ui/navigation/menu.js +49 -35
  92. package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
  93. package/dist/components/ui/navigation/navigation-demo.js +81 -74
  94. package/dist/components/ui/navigation/pagination.esm.js +62 -50
  95. package/dist/components/ui/navigation/pagination.js +62 -50
  96. package/dist/components/ui/navigation/sidebar.esm.js +56 -42
  97. package/dist/components/ui/navigation/sidebar.js +56 -42
  98. package/dist/components/ui/navigation/stepper.esm.js +34 -23
  99. package/dist/components/ui/navigation/stepper.js +34 -23
  100. package/dist/components/ui/navigation/tabs.esm.js +32 -21
  101. package/dist/components/ui/navigation/tabs.js +32 -21
  102. package/dist/components/ui/navigation/types.esm.js +196 -195
  103. package/dist/components/ui/navigation/types.js +196 -195
  104. package/dist/components/ui/overlay/backdrop.esm.js +17 -16
  105. package/dist/components/ui/overlay/backdrop.js +17 -16
  106. package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
  107. package/dist/components/ui/overlay/focus-manager.js +21 -19
  108. package/dist/components/ui/overlay/index.esm.js +0 -2
  109. package/dist/components/ui/overlay/index.js +0 -2
  110. package/dist/components/ui/overlay/modal.esm.js +38 -34
  111. package/dist/components/ui/overlay/modal.js +38 -34
  112. package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
  113. package/dist/components/ui/overlay/overlay-manager.js +25 -20
  114. package/dist/components/ui/overlay/popover.esm.js +74 -58
  115. package/dist/components/ui/overlay/popover.js +74 -58
  116. package/dist/components/ui/overlay/portal.esm.js +7 -7
  117. package/dist/components/ui/overlay/portal.js +7 -7
  118. package/dist/components/ui/overlay/tooltip.esm.js +54 -39
  119. package/dist/components/ui/overlay/tooltip.js +54 -39
  120. package/dist/components/ui/overlay/types.esm.js +132 -131
  121. package/dist/components/ui/overlay/types.js +132 -131
  122. package/dist/components/ui/performance-demo.esm.js +135 -88
  123. package/dist/components/ui/performance-demo.js +135 -88
  124. package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
  125. package/dist/components/ui/semantic-input-system-demo.js +117 -80
  126. package/dist/components/ui/theme-customizer.esm.js +84 -52
  127. package/dist/components/ui/theme-customizer.js +84 -52
  128. package/dist/components/ui/theme-preview.esm.js +95 -43
  129. package/dist/components/ui/theme-preview.js +95 -43
  130. package/dist/components/ui/theme-switcher.esm.js +70 -44
  131. package/dist/components/ui/theme-switcher.js +70 -44
  132. package/dist/components/ui/theme-toggle.esm.js +3 -3
  133. package/dist/components/ui/theme-toggle.js +3 -3
  134. package/dist/components/ui/token-demo.esm.js +33 -21
  135. package/dist/components/ui/token-demo.js +33 -21
  136. package/dist/components/ui/touch-demo.esm.js +102 -73
  137. package/dist/components/ui/touch-demo.js +102 -73
  138. package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
  139. package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
  140. package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
  141. package/dist/components/ui/touch-friendly-interface.js +85 -61
  142. package/dist/hooks/use-accessibility-support.esm.js +115 -85
  143. package/dist/hooks/use-accessibility-support.js +115 -85
  144. package/dist/hooks/use-adaptive-layout.esm.js +56 -33
  145. package/dist/hooks/use-adaptive-layout.js +56 -33
  146. package/dist/hooks/use-advanced-patterns.esm.js +57 -42
  147. package/dist/hooks/use-advanced-patterns.js +57 -42
  148. package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
  149. package/dist/hooks/use-advanced-transition-system.js +112 -71
  150. package/dist/hooks/use-animation-profile.esm.js +63 -34
  151. package/dist/hooks/use-animation-profile.js +63 -34
  152. package/dist/hooks/use-battery-animations.esm.js +80 -55
  153. package/dist/hooks/use-battery-animations.js +80 -55
  154. package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
  155. package/dist/hooks/use-battery-conscious-loading.js +166 -123
  156. package/dist/hooks/use-battery-optimization.esm.js +78 -55
  157. package/dist/hooks/use-battery-optimization.js +78 -55
  158. package/dist/hooks/use-battery-status.esm.js +73 -51
  159. package/dist/hooks/use-battery-status.js +73 -51
  160. package/dist/hooks/use-component-performance.esm.js +62 -47
  161. package/dist/hooks/use-component-performance.js +62 -47
  162. package/dist/hooks/use-device-loading-states.esm.js +152 -109
  163. package/dist/hooks/use-device-loading-states.js +152 -109
  164. package/dist/hooks/use-device.esm.js +25 -14
  165. package/dist/hooks/use-device.js +25 -14
  166. package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
  167. package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
  168. package/dist/hooks/use-form-feedback.esm.js +124 -81
  169. package/dist/hooks/use-form-feedback.js +124 -81
  170. package/dist/hooks/use-form-performance.esm.js +127 -92
  171. package/dist/hooks/use-form-performance.js +127 -92
  172. package/dist/hooks/use-frame-rate.esm.js +56 -37
  173. package/dist/hooks/use-frame-rate.js +56 -37
  174. package/dist/hooks/use-gestures.esm.js +96 -72
  175. package/dist/hooks/use-gestures.js +96 -72
  176. package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
  177. package/dist/hooks/use-hardware-acceleration.js +65 -37
  178. package/dist/hooks/use-input-accessibility.esm.js +157 -119
  179. package/dist/hooks/use-input-accessibility.js +157 -119
  180. package/dist/hooks/use-input-performance.esm.js +139 -104
  181. package/dist/hooks/use-input-performance.js +139 -104
  182. package/dist/hooks/use-layout-performance.esm.js +50 -29
  183. package/dist/hooks/use-layout-performance.js +50 -29
  184. package/dist/hooks/use-loading-accessibility.esm.js +209 -169
  185. package/dist/hooks/use-loading-accessibility.js +209 -169
  186. package/dist/hooks/use-loading-performance.esm.js +117 -93
  187. package/dist/hooks/use-loading-performance.js +117 -93
  188. package/dist/hooks/use-memory-usage.esm.js +57 -38
  189. package/dist/hooks/use-memory-usage.js +57 -38
  190. package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
  191. package/dist/hooks/use-mobile-form-layout.js +111 -74
  192. package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
  193. package/dist/hooks/use-mobile-form-validation.js +211 -144
  194. package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
  195. package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
  196. package/dist/hooks/use-mobile-layout.esm.js +73 -51
  197. package/dist/hooks/use-mobile-layout.js +73 -51
  198. package/dist/hooks/use-mobile-optimization.esm.js +72 -44
  199. package/dist/hooks/use-mobile-optimization.js +72 -44
  200. package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
  201. package/dist/hooks/use-mobile-skeleton.js +97 -64
  202. package/dist/hooks/use-mobile-touch.esm.js +128 -93
  203. package/dist/hooks/use-mobile-touch.js +128 -93
  204. package/dist/hooks/use-performance-throttling.esm.js +72 -48
  205. package/dist/hooks/use-performance-throttling.js +72 -48
  206. package/dist/hooks/use-performance.esm.js +90 -52
  207. package/dist/hooks/use-performance.js +90 -52
  208. package/dist/hooks/use-reusable-architecture.esm.js +94 -65
  209. package/dist/hooks/use-reusable-architecture.js +94 -65
  210. package/dist/hooks/use-semantic-input-types.esm.js +166 -124
  211. package/dist/hooks/use-semantic-input-types.js +166 -124
  212. package/dist/hooks/use-semantic-input.esm.js +178 -126
  213. package/dist/hooks/use-semantic-input.js +178 -126
  214. package/dist/hooks/use-tablet-layout.esm.js +67 -38
  215. package/dist/hooks/use-tablet-layout.js +67 -38
  216. package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
  217. package/dist/hooks/use-touch-friendly-input.js +193 -149
  218. package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
  219. package/dist/hooks/use-touch-friendly-interface.js +99 -67
  220. package/dist/hooks/use-touch-optimization.esm.js +99 -72
  221. package/dist/hooks/use-touch-optimization.js +99 -72
  222. package/dist/index.esm.js +157 -281
  223. package/dist/index.js +157 -281
  224. package/dist/lib/utils.esm.js +1 -1
  225. package/dist/lib/utils.js +1 -1
  226. package/dist/plugins/theme-css-generator.esm.js +104 -55
  227. package/dist/plugins/theme-css-generator.js +104 -55
  228. package/dist/provider.esm.js +4 -4
  229. package/dist/provider.js +4 -4
  230. package/dist/styles.css +1 -1
  231. package/dist/theme.esm.js +633 -468
  232. package/dist/theme.js +633 -468
  233. package/dist/themes/ThemeContext.esm.js +15 -15
  234. package/dist/themes/ThemeContext.js +15 -15
  235. package/dist/themes/ThemeProvider.esm.js +25 -22
  236. package/dist/themes/ThemeProvider.js +25 -22
  237. package/dist/themes/accessibility.esm.js +147 -108
  238. package/dist/themes/accessibility.js +147 -108
  239. package/dist/themes/aria-patterns.esm.js +198 -162
  240. package/dist/themes/aria-patterns.js +198 -162
  241. package/dist/themes/base-themes.esm.js +14 -11
  242. package/dist/themes/base-themes.js +14 -11
  243. package/dist/themes/colorManager.esm.js +101 -83
  244. package/dist/themes/colorManager.js +101 -83
  245. package/dist/themes/examples/dark-theme.esm.js +133 -103
  246. package/dist/themes/examples/dark-theme.js +133 -103
  247. package/dist/themes/examples/minimal-theme.esm.js +83 -61
  248. package/dist/themes/examples/minimal-theme.js +83 -61
  249. package/dist/themes/focus-management.esm.js +202 -143
  250. package/dist/themes/focus-management.js +202 -143
  251. package/dist/themes/fontLoader.esm.js +28 -19
  252. package/dist/themes/fontLoader.js +28 -19
  253. package/dist/themes/high-contrast.esm.js +152 -104
  254. package/dist/themes/high-contrast.js +152 -104
  255. package/dist/themes/index.esm.js +1 -1
  256. package/dist/themes/index.js +1 -1
  257. package/dist/themes/inheritance.esm.js +35 -27
  258. package/dist/themes/inheritance.js +35 -27
  259. package/dist/themes/keyboard-navigation.esm.js +152 -123
  260. package/dist/themes/keyboard-navigation.js +152 -123
  261. package/dist/themes/motion-reduction.esm.js +193 -133
  262. package/dist/themes/motion-reduction.js +193 -133
  263. package/dist/themes/navigation.esm.js +146 -146
  264. package/dist/themes/navigation.js +146 -146
  265. package/dist/themes/screen-reader.esm.js +159 -94
  266. package/dist/themes/screen-reader.js +159 -94
  267. package/dist/themes/systemThemeDetector.esm.js +42 -34
  268. package/dist/themes/systemThemeDetector.js +42 -34
  269. package/dist/themes/themeCSSUpdater.esm.js +21 -9
  270. package/dist/themes/themeCSSUpdater.js +21 -9
  271. package/dist/themes/themePersistence.esm.js +68 -47
  272. package/dist/themes/themePersistence.js +68 -47
  273. package/dist/themes/themes/stan-design.esm.js +633 -468
  274. package/dist/themes/themes/stan-design.js +633 -468
  275. package/dist/themes/types.esm.js +301 -287
  276. package/dist/themes/types.js +301 -287
  277. package/dist/themes/useSystemTheme.esm.js +4 -4
  278. package/dist/themes/useSystemTheme.js +4 -4
  279. package/dist/themes/useTheme.esm.js +4 -4
  280. package/dist/themes/useTheme.js +4 -4
  281. package/dist/themes/validation.esm.js +128 -77
  282. package/dist/themes/validation.js +128 -77
  283. package/dist/tokens/index.esm.js +1 -2
  284. package/dist/tokens/index.js +1 -2
  285. package/dist/tokens/tokenExporter.esm.js +87 -61
  286. package/dist/tokens/tokenExporter.js +87 -61
  287. package/dist/tokens/tokenGenerator.esm.js +86 -77
  288. package/dist/tokens/tokenGenerator.js +86 -77
  289. package/dist/tokens/tokenManager.esm.js +64 -51
  290. package/dist/tokens/tokenManager.js +64 -51
  291. package/dist/tokens/tokenValidator.esm.js +193 -147
  292. package/dist/tokens/tokenValidator.js +193 -147
  293. package/dist/tokens/types.esm.js +49 -35
  294. package/dist/tokens/types.js +49 -35
  295. package/dist/utils/bundle-analyzer.esm.js +83 -65
  296. package/dist/utils/bundle-analyzer.js +83 -65
  297. package/dist/utils/bundle-splitting.esm.js +142 -117
  298. package/dist/utils/bundle-splitting.js +142 -117
  299. package/dist/utils/lazy-loading.esm.js +132 -106
  300. package/dist/utils/lazy-loading.js +132 -106
  301. package/dist/utils/performance-monitor.esm.js +170 -129
  302. package/dist/utils/performance-monitor.js +170 -129
  303. package/dist/utils/tree-shaking.esm.js +69 -61
  304. package/dist/utils/tree-shaking.js +69 -61
  305. package/package.json +1 -1
  306. package/src/index.ts +146 -146
@@ -6,7 +6,7 @@ import {
6
6
  } from './types';
7
7
 
8
8
  // Simple icon components (inline SVG)
9
- const BarChartIcon}> = ({ className = 'w-4 h-4' }) => (
9
+ const BarChartIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (
10
10
  <svg
11
11
  className={className}
12
12
  fill="none"
@@ -17,7 +17,7 @@ const BarChartIcon}> = ({ className = 'w-4 h-4' }) => (
17
17
  </svg>
18
18
  );
19
19
 
20
- const LineChartIcon}> = ({ className = 'w-4 h-4' }) => (
20
+ const LineChartIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (
21
21
  <svg
22
22
  className={className}
23
23
  fill="none"
@@ -29,7 +29,7 @@ const LineChartIcon}> = ({ className = 'w-4 h-4' }) => (
29
29
  </svg>
30
30
  );
31
31
 
32
- const PieChartIcon}> = ({ className = 'w-4 h-4' }) => (
32
+ const PieChartIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (
33
33
  <svg
34
34
  className={className}
35
35
  fill="none"
@@ -43,30 +43,38 @@ const PieChartIcon}> = ({ className = 'w-4 h-4' }) => (
43
43
 
44
44
  // Default color fallbacks for when theme is not available
45
45
  const getDefaultColors = () => ({
46
- surface,
47
- surface,
48
- border,
49
- divider},
50
- text,
51
- secondary,
52
- muted,
53
- inverse,
54
- onPrimary,
55
- onSecondary,
56
- onSurface},
57
- interactive,
58
- active,
59
- focus,
60
- disabled},
61
- primary},
62
- semantic,
63
- warning,
64
- error,
65
- info}
46
+ surface: {
47
+ background: '#ffffff',
48
+ surface: '#f3f4f6',
49
+ border: '#d1d5db',
50
+ divider: '#e5e7eb'
51
+ },
52
+ text: {
53
+ primary: '#111827',
54
+ secondary: '#6b7280',
55
+ muted: '#9ca3af',
56
+ inverse: '#ffffff',
57
+ onPrimary: '#ffffff',
58
+ onSecondary: '#ffffff',
59
+ onSurface: '#111827'
60
+ },
61
+ interactive: {
62
+ hover: '#f3f4f6',
63
+ active: '#e5e7eb',
64
+ focus: '#3b82f6',
65
+ disabled: '#d1d5db'
66
+ },
67
+ primary: { 500: '#3b82f6' },
68
+ semantic: {
69
+ success: '#10b981',
70
+ warning: '#f59e0b',
71
+ error: '#ef4444',
72
+ info: '#3b82f6'
73
+ }
66
74
  });
67
75
 
68
76
  // Chart color palette
69
- const getChartColors = (colors) => [
77
+ const getChartColors = (colors: any) => [
70
78
  colors.primary[500],
71
79
  colors.semantic.success,
72
80
  colors.semantic.warning,
@@ -80,21 +88,24 @@ const getChartColors = (colors) => [
80
88
  ];
81
89
 
82
90
  // Chart Legend Component
83
- const ChartLegend];
84
- colors;
85
- size;
91
+ const ChartLegend: React.FC<{
92
+ datasets: ChartData['datasets'];
93
+ colors: any;
94
+ size: 'sm' | 'md' | 'lg';
86
95
  }> = ({ datasets, colors, size }) => {
87
96
  const chartColors = getChartColors(colors);
88
97
 
89
98
  const sizeClasses = {
90
- sm,
91
- md,
92
- lg};
99
+ sm: 'chart__legend--sm',
100
+ md: 'chart__legend--md',
101
+ lg: 'chart__legend--lg'
102
+ };
93
103
 
94
104
  const dotSizes = {
95
- sm,
96
- md,
97
- lg};
105
+ sm: 'chart__legend-color--sm',
106
+ md: 'chart__legend-color--md',
107
+ lg: 'chart__legend-color--lg'
108
+ };
98
109
 
99
110
  return (
100
111
  <div className={`chart__legend ${sizeClasses[size]}`}>
@@ -103,7 +114,7 @@ const ChartLegend];
103
114
  <div
104
115
  className={`chart__legend-color ${dotSizes[size]}`}
105
116
  style={{
106
- backgroundColor]
117
+ backgroundColor: dataset.color || chartColors[index % chartColors.length]
107
118
  }}
108
119
  />
109
120
  <span className="chart__legend-label">
@@ -116,12 +127,13 @@ const ChartLegend];
116
127
  };
117
128
 
118
129
  // Simple Bar Chart Component
119
- const BarChart;
120
- width;
121
- height;
122
- colors;
123
- showValues?;
124
- animate?;
130
+ const BarChart: React.FC<{
131
+ data: ChartData;
132
+ width: number;
133
+ height: number;
134
+ colors: any;
135
+ showValues?: boolean;
136
+ animate?: boolean;
125
137
  }> = ({ data, width, height, colors, showValues = false, animate = false }) => {
126
138
  const chartColors = getChartColors(colors);
127
139
  const padding = 60;
@@ -131,7 +143,7 @@ const BarChart;
131
143
  // Calculate max value for scaling
132
144
  const maxValue = useMemo(() => {
133
145
  const allValues = data.datasets.flatMap(dataset =>
134
- dataset.data.map(point => typeof point === 'number' ? point )
146
+ dataset.data.map(point => typeof point === 'number' ? point : point.y)
135
147
  );
136
148
  return Math.max(...allValues, 0);
137
149
  }, [data]);
@@ -140,7 +152,7 @@ const BarChart;
140
152
  const groupWidth = chartWidth / data.labels.length;
141
153
 
142
154
  return (
143
- <svg width={width} height={height} style={{ background}}>
155
+ <svg width={width} height={height} style={{ background: colors.surface.background }}>
144
156
  {/* Grid lines */}
145
157
  {[0, 0.25, 0.5, 0.75, 1].map((percent, index) => {
146
158
  const y = padding + chartHeight * (1 - percent);
@@ -153,7 +165,7 @@ const BarChart;
153
165
  y2={y}
154
166
  stroke={colors.surface.border}
155
167
  strokeWidth={1}
156
- strokeDasharray={percent === 0 ? '0' ,2'}
168
+ strokeDasharray={percent === 0 ? '0' : '2,2'}
157
169
  />
158
170
  <text
159
171
  x={padding - 10}
@@ -172,7 +184,7 @@ const BarChart;
172
184
  {data.datasets.map((dataset, datasetIndex) => (
173
185
  <g key={datasetIndex}>
174
186
  {dataset.data.map((value, pointIndex) => {
175
- const numericValue = typeof value === 'number' ? value ;
187
+ const numericValue = typeof value === 'number' ? value : value.y;
176
188
  const barHeight = (numericValue / maxValue) * chartHeight;
177
189
  const x = padding + pointIndex * groupWidth + datasetIndex * barWidth;
178
190
  const y = padding + chartHeight - barHeight;
@@ -182,9 +194,9 @@ const BarChart;
182
194
  <g key={pointIndex}>
183
195
  <rect
184
196
  x={x}
185
- y={animate ? padding + chartHeight }
197
+ y={animate ? padding + chartHeight : y}
186
198
  width={barWidth * 0.8}
187
- height={animate ? 0 }
199
+ height={animate ? 0 : barHeight}
188
200
  fill={color}
189
201
  rx={2}
190
202
  >
@@ -246,12 +258,13 @@ const BarChart;
246
258
  };
247
259
 
248
260
  // Simple Line Chart Component
249
- const LineChart;
250
- width;
251
- height;
252
- colors;
253
- showPoints?;
254
- animate?;
261
+ const LineChart: React.FC<{
262
+ data: ChartData;
263
+ width: number;
264
+ height: number;
265
+ colors: any;
266
+ showPoints?: boolean;
267
+ animate?: boolean;
255
268
  }> = ({ data, width, height, colors, showPoints = true, animate = false }) => {
256
269
  const chartColors = getChartColors(colors);
257
270
  const padding = 60;
@@ -261,13 +274,13 @@ const LineChart;
261
274
  // Calculate max value for scaling
262
275
  const maxValue = useMemo(() => {
263
276
  const allValues = data.datasets.flatMap(dataset =>
264
- dataset.data.map(point => typeof point === 'number' ? point )
277
+ dataset.data.map(point => typeof point === 'number' ? point : point.y)
265
278
  );
266
279
  return Math.max(...allValues, 0);
267
280
  }, [data]);
268
281
 
269
282
  return (
270
- <svg width={width} height={height} style={{ background}}>
283
+ <svg width={width} height={height} style={{ background: colors.surface.background }}>
271
284
  {/* Grid lines */}
272
285
  {[0, 0.25, 0.5, 0.75, 1].map((percent, index) => {
273
286
  const y = padding + chartHeight * (1 - percent);
@@ -280,7 +293,7 @@ const LineChart;
280
293
  y2={y}
281
294
  stroke={colors.surface.border}
282
295
  strokeWidth={1}
283
- strokeDasharray={percent === 0 ? '0' ,2'}
296
+ strokeDasharray={percent === 0 ? '0' : '2,2'}
284
297
  />
285
298
  <text
286
299
  x={padding - 10}
@@ -299,15 +312,15 @@ const LineChart;
299
312
  {data.datasets.map((dataset, datasetIndex) => {
300
313
  const color = dataset.color || chartColors[datasetIndex % chartColors.length];
301
314
  const points = dataset.data.map((value, index) => {
302
- const numericValue = typeof value === 'number' ? value ;
315
+ const numericValue = typeof value === 'number' ? value : value.y;
303
316
  const x = padding + (index / (data.labels.length - 1)) * chartWidth;
304
317
  const y = padding + chartHeight - (numericValue / maxValue) * chartHeight;
305
- return { x, y, value};
318
+ return { x, y, value: numericValue };
306
319
  });
307
320
 
308
321
  // Create path for line
309
322
  const pathData = points.reduce((path, point, index) => {
310
- const command = index === 0 ? 'M' ;
323
+ const command = index === 0 ? 'M' : 'L';
311
324
  return `${path} ${command} ${point.x} ${point.y}`;
312
325
  }, '');
313
326
 
@@ -378,12 +391,13 @@ const LineChart;
378
391
  };
379
392
 
380
393
  // Simple Pie Chart Component
381
- const PieChart;
382
- width;
383
- height;
384
- colors;
385
- showLabels?;
386
- animate?;
394
+ const PieChart: React.FC<{
395
+ data: ChartData;
396
+ width: number;
397
+ height: number;
398
+ colors: any;
399
+ showLabels?: boolean;
400
+ animate?: boolean;
387
401
  }> = ({ data, width, height, colors, showLabels = true, animate = false }) => {
388
402
  const chartColors = getChartColors(colors);
389
403
  const centerX = width / 2;
@@ -392,7 +406,7 @@ const PieChart;
392
406
 
393
407
  // Calculate total value and angles
394
408
  const dataset = data.datasets[0];
395
- const values = dataset?.data.map(point => typeof point === 'number' ? point ) || [];
409
+ const values = dataset?.data.map(point => typeof point === 'number' ? point : point.y) || [];
396
410
  const total = values.reduce((sum, value) => sum + value, 0);
397
411
 
398
412
  let currentAngle = -Math.PI / 2; // Start at top
@@ -409,7 +423,7 @@ const PieChart;
409
423
  const x2 = centerX + radius * Math.cos(endAngle);
410
424
  const y2 = centerY + radius * Math.sin(endAngle);
411
425
 
412
- const largeArc = angle > Math.PI ? 1 ;
426
+ const largeArc = angle > Math.PI ? 1 : 0;
413
427
  const pathData = `M ${centerX} ${centerY} L ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2} Z`;
414
428
 
415
429
  // Label position
@@ -419,17 +433,17 @@ const PieChart;
419
433
 
420
434
  return {
421
435
  pathData,
422
- color],
423
- label],
436
+ color: chartColors[index % chartColors.length],
437
+ label: data.labels[index],
424
438
  value,
425
- percentage),
439
+ percentage: Math.round(percentage * 100),
426
440
  labelX,
427
441
  labelY
428
442
  };
429
443
  });
430
444
 
431
445
  return (
432
- <svg width={width} height={height} style={{ background}}>
446
+ <svg width={width} height={height} style={{ background: colors.surface.background }}>
433
447
  {segments.map((segment, index) => (
434
448
  <g key={index}>
435
449
  {/* Pie segment */}
@@ -481,7 +495,7 @@ const PieChart;
481
495
  };
482
496
 
483
497
  // Main Chart Component
484
- export const Chart= ({
498
+ export const Chart: React.FC<ChartProps> = ({
485
499
  type = 'bar',
486
500
  data,
487
501
  options = {},
@@ -508,21 +522,28 @@ export const Chart= ({
508
522
  // Calculate responsive dimensions
509
523
  const dimensions = useMemo(() => {
510
524
  if (typeof width === 'number') {
511
- return { width, height=== 'number' ? height };
525
+ return { width, height: typeof height === 'number' ? height : 400 };
512
526
  }
513
527
 
514
528
  // For responsive width, we'll use a default and let CSS handle it
515
529
  return {
516
- width,
517
- height=== 'number' ? height };
530
+ width: 600,
531
+ height: typeof height === 'number' ? height : 400
532
+ };
518
533
  }, [width, height]);
519
534
 
520
535
  // Chart type icon
521
536
  const getChartIcon = () => {
522
537
  switch (type) {
523
- case 'line'="chart__icon" />;
524
- case 'pie'="chart__icon" />;
525
- case 'bar'="chart__icon" />;
538
+ case 'line':
539
+ case 'area':
540
+ return <LineChartIcon className="chart__icon" />;
541
+ case 'pie':
542
+ case 'doughnut':
543
+ return <PieChartIcon className="chart__icon" />;
544
+ case 'bar':
545
+ default:
546
+ return <BarChartIcon className="chart__icon" />;
526
547
  }
527
548
  };
528
549
 
@@ -530,17 +551,23 @@ export const Chart= ({
530
551
  const renderChart = () => {
531
552
  const chartProps = {
532
553
  data,
533
- width,
534
- height,
554
+ width: dimensions.width,
555
+ height: dimensions.height,
535
556
  colors,
536
557
  animate,
537
558
  ...options
538
559
  };
539
560
 
540
561
  switch (type) {
541
- case 'line'} showPoints={options.showPoints} />;
542
- case 'pie'} showLabels={options.showLabels} />;
543
- case 'bar'} showValues={showValues} />;
562
+ case 'line':
563
+ case 'area':
564
+ return <LineChart {...chartProps} showPoints={options.showPoints} />;
565
+ case 'pie':
566
+ case 'doughnut':
567
+ return <PieChart {...chartProps} showLabels={options.showLabels} />;
568
+ case 'bar':
569
+ default:
570
+ return <BarChart {...chartProps} showValues={showValues} />;
544
571
  }
545
572
  };
546
573
 
@@ -604,8 +631,9 @@ export const Chart= ({
604
631
  <div
605
632
  className="chart__canvas"
606
633
  style={{
607
- width=== 'string' ? width }px`,
608
- maxWidth}}
634
+ width: typeof width === 'string' ? width : `${width}px`,
635
+ maxWidth: '100%'
636
+ }}
609
637
  >
610
638
  {renderChart()}
611
639
  </div>