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

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 (304) 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 +23 -1
  89. package/dist/components/ui/navigation/index.js +23 -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 +22 -2
  109. package/dist/components/ui/overlay/index.js +22 -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 +289 -280
  223. package/dist/index.js +289 -280
  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/inheritance.esm.js +35 -27
  256. package/dist/themes/inheritance.js +35 -27
  257. package/dist/themes/keyboard-navigation.esm.js +152 -123
  258. package/dist/themes/keyboard-navigation.js +152 -123
  259. package/dist/themes/motion-reduction.esm.js +193 -133
  260. package/dist/themes/motion-reduction.js +193 -133
  261. package/dist/themes/navigation.esm.js +146 -146
  262. package/dist/themes/navigation.js +146 -146
  263. package/dist/themes/screen-reader.esm.js +159 -94
  264. package/dist/themes/screen-reader.js +159 -94
  265. package/dist/themes/systemThemeDetector.esm.js +42 -34
  266. package/dist/themes/systemThemeDetector.js +42 -34
  267. package/dist/themes/themeCSSUpdater.esm.js +21 -9
  268. package/dist/themes/themeCSSUpdater.js +21 -9
  269. package/dist/themes/themePersistence.esm.js +68 -47
  270. package/dist/themes/themePersistence.js +68 -47
  271. package/dist/themes/themes/stan-design.esm.js +633 -468
  272. package/dist/themes/themes/stan-design.js +633 -468
  273. package/dist/themes/types.esm.js +301 -287
  274. package/dist/themes/types.js +301 -287
  275. package/dist/themes/useSystemTheme.esm.js +4 -4
  276. package/dist/themes/useSystemTheme.js +4 -4
  277. package/dist/themes/useTheme.esm.js +4 -4
  278. package/dist/themes/useTheme.js +4 -4
  279. package/dist/themes/validation.esm.js +128 -77
  280. package/dist/themes/validation.js +128 -77
  281. package/dist/tokens/index.esm.js +15 -4
  282. package/dist/tokens/index.js +15 -4
  283. package/dist/tokens/tokenExporter.esm.js +87 -61
  284. package/dist/tokens/tokenExporter.js +87 -61
  285. package/dist/tokens/tokenGenerator.esm.js +86 -77
  286. package/dist/tokens/tokenGenerator.js +86 -77
  287. package/dist/tokens/tokenManager.esm.js +64 -51
  288. package/dist/tokens/tokenManager.js +64 -51
  289. package/dist/tokens/tokenValidator.esm.js +193 -147
  290. package/dist/tokens/tokenValidator.js +193 -147
  291. package/dist/tokens/types.esm.js +49 -35
  292. package/dist/tokens/types.js +49 -35
  293. package/dist/utils/bundle-analyzer.esm.js +83 -65
  294. package/dist/utils/bundle-analyzer.js +83 -65
  295. package/dist/utils/bundle-splitting.esm.js +142 -117
  296. package/dist/utils/bundle-splitting.js +142 -117
  297. package/dist/utils/lazy-loading.esm.js +132 -106
  298. package/dist/utils/lazy-loading.js +132 -106
  299. package/dist/utils/performance-monitor.esm.js +170 -129
  300. package/dist/utils/performance-monitor.js +170 -129
  301. package/dist/utils/tree-shaking.esm.js +69 -61
  302. package/dist/utils/tree-shaking.js +69 -61
  303. package/package.json +1 -1
  304. package/src/index.ts +146 -146
@@ -1,50 +1,54 @@
1
-
1
+ import type { ThemeTokens, DesignToken, TokenType } from './types';
2
2
 
3
3
  export interface ValidationResult {
4
- isValid;
5
- errors];
6
- warnings];
4
+ isValid: boolean;
5
+ errors: ValidationError[];
6
+ warnings: ValidationWarning[];
7
7
  }
8
8
 
9
9
  export interface ValidationError {
10
- path;
11
- message;
12
- severity;
10
+ path: string;
11
+ message: string;
12
+ severity: 'error' | 'critical';
13
13
  }
14
14
 
15
15
  export interface ValidationWarning {
16
- path;
17
- message;
18
- suggestion?;
16
+ path: string;
17
+ message: string;
18
+ suggestion?: string;
19
19
  }
20
20
 
21
21
  export class TokenValidator {
22
22
  /**
23
23
  * Validates a complete theme tokens object
24
24
  */
25
- static validateTokens(tokens)] = [];
26
- const warnings] = [];
25
+ static validateTokens(tokens: ThemeTokens): ValidationResult {
26
+ const errors: ValidationError[] = [];
27
+ const warnings: ValidationWarning[] = [];
27
28
 
28
29
  // Validate basic structure
29
30
  if (!tokens.theme) {
30
31
  errors.push({
31
- path,
32
- message,
33
- severity});
32
+ path: 'theme',
33
+ message: 'Theme name is required',
34
+ severity: 'critical'
35
+ });
34
36
  }
35
37
 
36
38
  if (!tokens.version) {
37
39
  errors.push({
38
- path,
39
- message,
40
- severity});
40
+ path: 'version',
41
+ message: 'Theme version is required',
42
+ severity: 'critical'
43
+ });
41
44
  }
42
45
 
43
46
  if (!tokens.tokens) {
44
47
  errors.push({
45
- path,
46
- message,
47
- severity});
48
+ path: 'tokens',
49
+ message: 'Tokens object is required',
50
+ severity: 'critical'
51
+ });
48
52
  }
49
53
 
50
54
  // Validate token categories
@@ -58,7 +62,7 @@ export class TokenValidator {
58
62
  }
59
63
 
60
64
  return {
61
- isValid=== 0,
65
+ isValid: errors.length === 0,
62
66
  errors,
63
67
  warnings
64
68
  };
@@ -68,18 +72,19 @@ export class TokenValidator {
68
72
  * Validates a specific token category
69
73
  */
70
74
  private static validateTokenCategory(
71
- category,
72
- categoryName,
73
- errors],
74
- warnings]
75
+ category: any,
76
+ categoryName: string,
77
+ errors: ValidationError[],
78
+ warnings: ValidationWarning[]
75
79
  ) {
76
80
  if (!category) return;
77
81
 
78
82
  if (typeof category !== 'object') {
79
83
  errors.push({
80
- path}`,
81
- message} category must be an object`,
82
- severity});
84
+ path: `tokens.${categoryName}`,
85
+ message: `${categoryName} category must be an object`,
86
+ severity: 'error'
87
+ });
83
88
  return;
84
89
  }
85
90
 
@@ -90,10 +95,10 @@ export class TokenValidator {
90
95
  * Validates a token group recursively
91
96
  */
92
97
  private static validateTokenGroup(
93
- group,
94
- path,
95
- errors],
96
- warnings]
98
+ group: any,
99
+ path: string,
100
+ errors: ValidationError[],
101
+ warnings: ValidationWarning[]
97
102
  ) {
98
103
  Object.entries(group).forEach(([key, value]) => {
99
104
  const currentPath = `${path}.${key}`;
@@ -105,9 +110,10 @@ export class TokenValidator {
105
110
  this.validateTokenGroup(value, currentPath, errors, warnings);
106
111
  } else {
107
112
  errors.push({
108
- path,
109
- message}`,
110
- severity});
113
+ path: currentPath,
114
+ message: `Invalid token structure at ${currentPath}`,
115
+ severity: 'error'
116
+ });
111
117
  }
112
118
  });
113
119
  }
@@ -116,29 +122,32 @@ export class TokenValidator {
116
122
  * Validates an individual token
117
123
  */
118
124
  private static validateToken(
119
- token,
120
- path,
121
- errors],
122
- warnings]
125
+ token: DesignToken,
126
+ path: string,
127
+ errors: ValidationError[],
128
+ warnings: ValidationWarning[]
123
129
  ) {
124
130
  // Check required properties
125
131
  if (token.value === undefined || token.value === null) {
126
132
  errors.push({
127
133
  path,
128
- message,
129
- severity});
134
+ message: 'Token value is required',
135
+ severity: 'error'
136
+ });
130
137
  }
131
138
 
132
139
  if (!token.type) {
133
140
  errors.push({
134
141
  path,
135
- message,
136
- severity});
142
+ message: 'Token type is required',
143
+ severity: 'error'
144
+ });
137
145
  } else if (!this.isValidTokenType(token.type)) {
138
146
  errors.push({
139
147
  path,
140
- message}`,
141
- severity});
148
+ message: `Invalid token type: ${token.type}`,
149
+ severity: 'error'
150
+ });
142
151
  }
143
152
 
144
153
  // Validate token type-specific values
@@ -148,16 +157,18 @@ export class TokenValidator {
148
157
  if (!token.description) {
149
158
  warnings.push({
150
159
  path,
151
- message,
152
- suggestion});
160
+ message: 'Token description is missing',
161
+ suggestion: 'Add a description to improve token documentation'
162
+ });
153
163
  }
154
164
 
155
165
  // Check for missing tags (warning)
156
166
  if (!token.tags || token.tags.length === 0) {
157
167
  warnings.push({
158
168
  path,
159
- message,
160
- suggestion});
169
+ message: 'Token tags are missing',
170
+ suggestion: 'Add tags to improve token categorization and searchability'
171
+ });
161
172
  }
162
173
  }
163
174
 
@@ -165,29 +176,38 @@ export class TokenValidator {
165
176
  * Validates token value based on type
166
177
  */
167
178
  private static validateTokenValue(
168
- token,
169
- path,
170
- errors],
171
- warnings]
179
+ token: DesignToken,
180
+ path: string,
181
+ errors: ValidationError[],
182
+ warnings: ValidationWarning[]
172
183
  ) {
173
184
  switch (token.type) {
174
- case 'color', path, errors, warnings);
185
+ case 'color':
186
+ this.validateColorToken(token, path, errors, warnings);
175
187
  break;
176
- case 'fontFamily', path, errors, warnings);
188
+ case 'fontFamily':
189
+ this.validateFontFamilyToken(token, path, errors, warnings);
177
190
  break;
178
- case 'fontSize', path, errors, warnings);
191
+ case 'fontSize':
192
+ this.validateFontSizeToken(token, path, errors, warnings);
179
193
  break;
180
- case 'fontWeight', path, errors, warnings);
194
+ case 'fontWeight':
195
+ this.validateFontWeightToken(token, path, errors, warnings);
181
196
  break;
182
- case 'lineHeight', path, errors, warnings);
197
+ case 'lineHeight':
198
+ this.validateLineHeightToken(token, path, errors, warnings);
183
199
  break;
184
- case 'spacing', path, errors, warnings);
200
+ case 'spacing':
201
+ this.validateSpacingToken(token, path, errors, warnings);
185
202
  break;
186
- case 'shadow', path, errors, warnings);
203
+ case 'shadow':
204
+ this.validateShadowToken(token, path, errors, warnings);
187
205
  break;
188
- case 'transition', path, errors, warnings);
206
+ case 'transition':
207
+ this.validateTransitionToken(token, path, errors, warnings);
189
208
  break;
190
- case 'breakpoint', path, errors, warnings);
209
+ case 'breakpoint':
210
+ this.validateBreakpointToken(token, path, errors, warnings);
191
211
  break;
192
212
  }
193
213
  }
@@ -196,18 +216,19 @@ export class TokenValidator {
196
216
  * Validates color tokens
197
217
  */
198
218
  private static validateColorToken(
199
- token,
200
- path,
201
- errors],
202
- warnings]
219
+ token: DesignToken,
220
+ path: string,
221
+ errors: ValidationError[],
222
+ warnings: ValidationWarning[]
203
223
  ) {
204
224
  const value = token.value as string;
205
225
 
206
226
  if (typeof value !== 'string') {
207
227
  errors.push({
208
228
  path,
209
- message,
210
- severity});
229
+ message: 'Color token value must be a string',
230
+ severity: 'error'
231
+ });
211
232
  return;
212
233
  }
213
234
 
@@ -215,16 +236,17 @@ export class TokenValidator {
215
236
  if (!this.isValidColor(value)) {
216
237
  errors.push({
217
238
  path,
218
- message}`,
219
- severity});
239
+ message: `Invalid color format: ${value}`,
240
+ severity: 'error'
241
+ });
220
242
  }
221
243
 
222
244
  // Check for semantic color consistency
223
245
  if (token.category === 'color' && !(token as any).semantic) {
224
246
  warnings.push({
225
247
  path,
226
- message,
227
- suggestion, secondary, accent, success, warning, error, neutral)'
248
+ message: 'Semantic color missing semantic property',
249
+ suggestion: 'Add semantic property (primary, secondary, accent, success, warning, error, neutral)'
228
250
  });
229
251
  }
230
252
  }
@@ -233,25 +255,27 @@ export class TokenValidator {
233
255
  * Validates font family tokens
234
256
  */
235
257
  private static validateFontFamilyToken(
236
- token,
237
- path,
238
- errors],
239
- _warnings]
258
+ token: DesignToken,
259
+ path: string,
260
+ errors: ValidationError[],
261
+ _warnings: ValidationWarning[]
240
262
  ) {
241
263
  const value = token.value as string;
242
264
 
243
265
  if (typeof value !== 'string') {
244
266
  errors.push({
245
267
  path,
246
- message,
247
- severity});
268
+ message: 'Font family token value must be a string',
269
+ severity: 'error'
270
+ });
248
271
  }
249
272
 
250
273
  if (value.trim().length === 0) {
251
274
  errors.push({
252
275
  path,
253
- message,
254
- severity});
276
+ message: 'Font family token value cannot be empty',
277
+ severity: 'error'
278
+ });
255
279
  }
256
280
  }
257
281
 
@@ -259,10 +283,10 @@ export class TokenValidator {
259
283
  * Validates font size tokens
260
284
  */
261
285
  private static validateFontSizeToken(
262
- token,
263
- path,
264
- errors],
265
- _warnings]
286
+ token: DesignToken,
287
+ path: string,
288
+ errors: ValidationError[],
289
+ _warnings: ValidationWarning[]
266
290
  ) {
267
291
  const value = token.value as string | number;
268
292
 
@@ -270,21 +294,24 @@ export class TokenValidator {
270
294
  if (value <= 0) {
271
295
  errors.push({
272
296
  path,
273
- message,
274
- severity});
297
+ message: 'Font size token value must be positive',
298
+ severity: 'error'
299
+ });
275
300
  }
276
301
  } else if (typeof value === 'string') {
277
302
  if (!this.isValidCSSUnit(value)) {
278
303
  errors.push({
279
304
  path,
280
- message}`,
281
- severity});
305
+ message: `Invalid font size unit: ${value}`,
306
+ severity: 'error'
307
+ });
282
308
  }
283
309
  } else {
284
310
  errors.push({
285
311
  path,
286
- message,
287
- severity});
312
+ message: 'Font size token value must be a number or valid CSS unit string',
313
+ severity: 'error'
314
+ });
288
315
  }
289
316
  }
290
317
 
@@ -292,10 +319,10 @@ export class TokenValidator {
292
319
  * Validates font weight tokens
293
320
  */
294
321
  private static validateFontWeightToken(
295
- token,
296
- path,
297
- errors],
298
- _warnings]
322
+ token: DesignToken,
323
+ path: string,
324
+ errors: ValidationError[],
325
+ _warnings: ValidationWarning[]
299
326
  ) {
300
327
  const value = token.value as string | number;
301
328
 
@@ -303,22 +330,25 @@ export class TokenValidator {
303
330
  if (value < 100 || value > 900 || value % 100 !== 0) {
304
331
  errors.push({
305
332
  path,
306
- message,
307
- severity});
333
+ message: 'Font weight token value must be a multiple of 100 between 100 and 900',
334
+ severity: 'error'
335
+ });
308
336
  }
309
337
  } else if (typeof value === 'string') {
310
338
  const validWeights = ['normal', 'bold', 'lighter', 'bolder'];
311
339
  if (!validWeights.includes(value)) {
312
340
  errors.push({
313
341
  path,
314
- message}`,
315
- severity});
342
+ message: `Invalid font weight value: ${value}`,
343
+ severity: 'error'
344
+ });
316
345
  }
317
346
  } else {
318
347
  errors.push({
319
348
  path,
320
- message,
321
- severity});
349
+ message: 'Font weight token value must be a number or valid string',
350
+ severity: 'error'
351
+ });
322
352
  }
323
353
  }
324
354
 
@@ -326,10 +356,10 @@ export class TokenValidator {
326
356
  * Validates line height tokens
327
357
  */
328
358
  private static validateLineHeightToken(
329
- token,
330
- path,
331
- errors],
332
- _warnings]
359
+ token: DesignToken,
360
+ path: string,
361
+ errors: ValidationError[],
362
+ _warnings: ValidationWarning[]
333
363
  ) {
334
364
  const value = token.value as string | number;
335
365
 
@@ -337,21 +367,24 @@ export class TokenValidator {
337
367
  if (value <= 0) {
338
368
  errors.push({
339
369
  path,
340
- message,
341
- severity});
370
+ message: 'Line height token value must be positive',
371
+ severity: 'error'
372
+ });
342
373
  }
343
374
  } else if (typeof value === 'string') {
344
375
  if (!this.isValidCSSUnit(value) && value !== 'normal') {
345
376
  errors.push({
346
377
  path,
347
- message}`,
348
- severity});
378
+ message: `Invalid line height value: ${value}`,
379
+ severity: 'error'
380
+ });
349
381
  }
350
382
  } else {
351
383
  errors.push({
352
384
  path,
353
- message,
354
- severity});
385
+ message: 'Line height token value must be a number or valid CSS unit string',
386
+ severity: 'error'
387
+ });
355
388
  }
356
389
  }
357
390
 
@@ -359,26 +392,28 @@ export class TokenValidator {
359
392
  * Validates spacing tokens
360
393
  */
361
394
  private static validateSpacingToken(
362
- token,
363
- path,
364
- errors],
365
- _warnings]
395
+ token: DesignToken,
396
+ path: string,
397
+ errors: ValidationError[],
398
+ _warnings: ValidationWarning[]
366
399
  ) {
367
400
  const value = token.value as number;
368
401
 
369
402
  if (typeof value !== 'number') {
370
403
  errors.push({
371
404
  path,
372
- message,
373
- severity});
405
+ message: 'Spacing token value must be a number',
406
+ severity: 'error'
407
+ });
374
408
  return;
375
409
  }
376
410
 
377
411
  if (value < 0) {
378
412
  errors.push({
379
413
  path,
380
- message,
381
- severity});
414
+ message: 'Spacing token value cannot be negative',
415
+ severity: 'error'
416
+ });
382
417
  }
383
418
  }
384
419
 
@@ -386,25 +421,27 @@ export class TokenValidator {
386
421
  * Validates shadow tokens
387
422
  */
388
423
  private static validateShadowToken(
389
- token,
390
- path,
391
- errors],
392
- _warnings]
424
+ token: DesignToken,
425
+ path: string,
426
+ errors: ValidationError[],
427
+ _warnings: ValidationWarning[]
393
428
  ) {
394
429
  const value = token.value as string;
395
430
 
396
431
  if (typeof value !== 'string') {
397
432
  errors.push({
398
433
  path,
399
- message,
400
- severity});
434
+ message: 'Shadow token value must be a string',
435
+ severity: 'error'
436
+ });
401
437
  }
402
438
 
403
439
  if (value.trim().length === 0) {
404
440
  errors.push({
405
441
  path,
406
- message,
407
- severity});
442
+ message: 'Shadow token value cannot be empty',
443
+ severity: 'error'
444
+ });
408
445
  }
409
446
  }
410
447
 
@@ -412,25 +449,27 @@ export class TokenValidator {
412
449
  * Validates transition tokens
413
450
  */
414
451
  private static validateTransitionToken(
415
- token,
416
- path,
417
- errors],
418
- _warnings]
452
+ token: DesignToken,
453
+ path: string,
454
+ errors: ValidationError[],
455
+ _warnings: ValidationWarning[]
419
456
  ) {
420
457
  const value = token.value as string;
421
458
 
422
459
  if (typeof value !== 'string') {
423
460
  errors.push({
424
461
  path,
425
- message,
426
- severity});
462
+ message: 'Transition token value must be a string',
463
+ severity: 'error'
464
+ });
427
465
  }
428
466
 
429
467
  if (value.trim().length === 0) {
430
468
  errors.push({
431
469
  path,
432
- message,
433
- severity});
470
+ message: 'Transition token value cannot be empty',
471
+ severity: 'error'
472
+ });
434
473
  }
435
474
  }
436
475
 
@@ -438,33 +477,37 @@ export class TokenValidator {
438
477
  * Validates breakpoint tokens
439
478
  */
440
479
  private static validateBreakpointToken(
441
- token,
442
- path,
443
- errors],
444
- _warnings]
480
+ token: DesignToken,
481
+ path: string,
482
+ errors: ValidationError[],
483
+ _warnings: ValidationWarning[]
445
484
  ) {
446
485
  const value = token.value as number;
447
486
 
448
487
  if (typeof value !== 'number') {
449
488
  errors.push({
450
489
  path,
451
- message,
452
- severity});
490
+ message: 'Breakpoint token value must be a number',
491
+ severity: 'error'
492
+ });
453
493
  return;
454
494
  }
455
495
 
456
496
  if (value < 0) {
457
497
  errors.push({
458
498
  path,
459
- message,
460
- severity});
499
+ message: 'Breakpoint token value cannot be negative',
500
+ severity: 'error'
501
+ });
461
502
  }
462
503
  }
463
504
 
464
505
  /**
465
506
  * Checks if a value is a valid token
466
507
  */
467
- private static isToken(value)=== 'object' &&
508
+ private static isToken(value: any): value is DesignToken {
509
+ return value &&
510
+ typeof value === 'object' &&
468
511
  'value' in value &&
469
512
  'type' in value;
470
513
  }
@@ -472,7 +515,8 @@ export class TokenValidator {
472
515
  /**
473
516
  * Checks if a token type is valid
474
517
  */
475
- private static isValidTokenType(type)] = [
518
+ private static isValidTokenType(type: any): type is TokenType {
519
+ const validTypes: TokenType[] = [
476
520
  'color', 'fontFamily', 'fontSize', 'fontWeight', 'lineHeight',
477
521
  'letterSpacing', 'spacing', 'borderRadius', 'shadow', 'transition',
478
522
  'zIndex', 'breakpoint'
@@ -483,7 +527,8 @@ export class TokenValidator {
483
527
  /**
484
528
  * Checks if a color value is valid
485
529
  */
486
- private static isValidColor(color), rgb, rgba, named colors
530
+ private static isValidColor(color: string): boolean {
531
+ // Basic color validation - hex, rgb, rgba, named colors
487
532
  const colorRegex = /^(#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)|transparent|currentColor)$/;
488
533
  return colorRegex.test(color);
489
534
  }
@@ -491,7 +536,8 @@ export class TokenValidator {
491
536
  /**
492
537
  * Checks if a CSS unit is valid
493
538
  */
494
- private static isValidCSSUnit(value)= /^[\d.]+(px|em|rem|vh|vw|%|ch|ex|in|cm|mm|pt|pc)$/;
539
+ private static isValidCSSUnit(value: string): boolean {
540
+ const unitRegex = /^[\d.]+(px|em|rem|vh|vw|%|ch|ex|in|cm|mm|pt|pc)$/;
495
541
  return unitRegex.test(value);
496
542
  }
497
543
  }