@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.1.4 → 0.1.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 (164) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/index.d.ts +131 -131
  3. package/dist/index.esm.js +148 -148
  4. package/dist/index.js +148 -148
  5. package/dist/styles.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/ui/accessibility-demo.tsx +271 -0
  8. package/src/components/ui/advanced-component-architecture-demo.tsx +916 -0
  9. package/src/components/ui/advanced-transition-system-demo.tsx +670 -0
  10. package/src/components/ui/advanced-transition-system.tsx +395 -0
  11. package/src/components/ui/animation/animated-container.tsx +166 -0
  12. package/src/components/ui/animation/index.ts +19 -0
  13. package/src/components/ui/animation/staggered-container.tsx +68 -0
  14. package/src/components/ui/animation-demo.tsx +250 -0
  15. package/src/components/ui/badge.tsx +33 -0
  16. package/src/components/ui/battery-conscious-animation-demo.tsx +568 -0
  17. package/src/components/ui/border-radius-shadow-demo.tsx +187 -0
  18. package/src/components/ui/button.tsx +36 -0
  19. package/src/components/ui/card.tsx +207 -0
  20. package/src/components/ui/checkbox.tsx +30 -0
  21. package/src/components/ui/color-preview.tsx +411 -0
  22. package/src/components/ui/data-display/chart.tsx +653 -0
  23. package/src/components/ui/data-display/data-grid-simple.tsx +76 -0
  24. package/src/components/ui/data-display/data-grid.tsx +680 -0
  25. package/src/components/ui/data-display/list.tsx +456 -0
  26. package/src/components/ui/data-display/table.tsx +482 -0
  27. package/src/components/ui/data-display/timeline.tsx +441 -0
  28. package/src/components/ui/data-display/tree.tsx +602 -0
  29. package/src/components/ui/data-display/types.ts +536 -0
  30. package/src/components/ui/enterprise-mobile-experience-demo.tsx +749 -0
  31. package/src/components/ui/enterprise-mobile-experience.tsx +464 -0
  32. package/src/components/ui/feedback/alert.tsx +157 -0
  33. package/src/components/ui/feedback/progress.tsx +292 -0
  34. package/src/components/ui/feedback/skeleton.tsx +185 -0
  35. package/src/components/ui/feedback/toast.tsx +280 -0
  36. package/src/components/ui/feedback/types.ts +125 -0
  37. package/src/components/ui/font-preview.tsx +288 -0
  38. package/src/components/ui/form-demo.tsx +553 -0
  39. package/src/components/ui/hardware-acceleration-demo.tsx +547 -0
  40. package/src/components/ui/input.tsx +35 -0
  41. package/src/components/ui/label.tsx +16 -0
  42. package/src/components/ui/layout-demo.tsx +367 -0
  43. package/src/components/ui/layouts/adaptive-layout.tsx +139 -0
  44. package/src/components/ui/layouts/desktop-layout.tsx +224 -0
  45. package/src/components/ui/layouts/index.ts +10 -0
  46. package/src/components/ui/layouts/mobile-layout.tsx +162 -0
  47. package/src/components/ui/layouts/tablet-layout.tsx +197 -0
  48. package/src/components/ui/mobile-form-validation.tsx +451 -0
  49. package/src/components/ui/mobile-input-demo.tsx +201 -0
  50. package/src/components/ui/mobile-input.tsx +281 -0
  51. package/src/components/ui/mobile-skeleton-loading-demo.tsx +638 -0
  52. package/src/components/ui/navigation/breadcrumb.tsx +158 -0
  53. package/src/components/ui/navigation/index.ts +36 -0
  54. package/src/components/ui/navigation/menu.tsx +374 -0
  55. package/src/components/ui/navigation/navigation-demo.tsx +324 -0
  56. package/src/components/ui/navigation/pagination.tsx +272 -0
  57. package/src/components/ui/navigation/sidebar.tsx +383 -0
  58. package/src/components/ui/navigation/stepper.tsx +303 -0
  59. package/src/components/ui/navigation/tabs.tsx +205 -0
  60. package/src/components/ui/navigation/types.ts +299 -0
  61. package/src/components/ui/overlay/backdrop.tsx +81 -0
  62. package/src/components/ui/overlay/focus-manager.tsx +143 -0
  63. package/src/components/ui/overlay/index.ts +36 -0
  64. package/src/components/ui/overlay/modal.tsx +270 -0
  65. package/src/components/ui/overlay/overlay-manager.tsx +110 -0
  66. package/src/components/ui/overlay/popover.tsx +462 -0
  67. package/src/components/ui/overlay/portal.tsx +79 -0
  68. package/src/components/ui/overlay/tooltip.tsx +303 -0
  69. package/src/components/ui/overlay/types.ts +196 -0
  70. package/src/components/ui/performance-demo.tsx +596 -0
  71. package/src/components/ui/semantic-input-system-demo.tsx +502 -0
  72. package/src/components/ui/semantic-input-system-demo.tsx.disabled +873 -0
  73. package/src/components/ui/tablet-layout.tsx +192 -0
  74. package/src/components/ui/theme-customizer.tsx +386 -0
  75. package/src/components/ui/theme-preview.tsx +310 -0
  76. package/src/components/ui/theme-switcher.tsx +264 -0
  77. package/src/components/ui/theme-toggle.tsx +38 -0
  78. package/src/components/ui/token-demo.tsx +195 -0
  79. package/src/components/ui/touch-demo.tsx +462 -0
  80. package/src/components/ui/touch-friendly-interface-demo.tsx +519 -0
  81. package/src/components/ui/touch-friendly-interface.tsx +296 -0
  82. package/src/hooks/index.ts +190 -0
  83. package/src/hooks/use-accessibility-support.ts +518 -0
  84. package/src/hooks/use-adaptive-layout.ts +289 -0
  85. package/src/hooks/use-advanced-patterns.ts +294 -0
  86. package/src/hooks/use-advanced-transition-system.ts +393 -0
  87. package/src/hooks/use-animation-profile.ts +288 -0
  88. package/src/hooks/use-battery-animations.ts +384 -0
  89. package/src/hooks/use-battery-conscious-loading.ts +475 -0
  90. package/src/hooks/use-battery-optimization.ts +330 -0
  91. package/src/hooks/use-battery-status.ts +299 -0
  92. package/src/hooks/use-component-performance.ts +344 -0
  93. package/src/hooks/use-device-loading-states.ts +459 -0
  94. package/src/hooks/use-device.tsx +110 -0
  95. package/src/hooks/use-enterprise-mobile-experience.ts +488 -0
  96. package/src/hooks/use-form-feedback.ts +403 -0
  97. package/src/hooks/use-form-performance.ts +513 -0
  98. package/src/hooks/use-frame-rate.ts +251 -0
  99. package/src/hooks/use-gestures.ts +338 -0
  100. package/src/hooks/use-hardware-acceleration.ts +341 -0
  101. package/src/hooks/use-input-accessibility.ts +455 -0
  102. package/src/hooks/use-input-performance.ts +506 -0
  103. package/src/hooks/use-layout-performance.ts +319 -0
  104. package/src/hooks/use-loading-accessibility.ts +535 -0
  105. package/src/hooks/use-loading-performance.ts +473 -0
  106. package/src/hooks/use-memory-usage.ts +287 -0
  107. package/src/hooks/use-mobile-form-layout.ts +464 -0
  108. package/src/hooks/use-mobile-form-validation.ts +518 -0
  109. package/src/hooks/use-mobile-keyboard-optimization.ts +472 -0
  110. package/src/hooks/use-mobile-layout.ts +302 -0
  111. package/src/hooks/use-mobile-optimization.ts +406 -0
  112. package/src/hooks/use-mobile-skeleton.ts +402 -0
  113. package/src/hooks/use-mobile-touch.ts +414 -0
  114. package/src/hooks/use-performance-throttling.ts +348 -0
  115. package/src/hooks/use-performance.ts +316 -0
  116. package/src/hooks/use-reusable-architecture.ts +414 -0
  117. package/src/hooks/use-semantic-input-types.ts +357 -0
  118. package/src/hooks/use-semantic-input.ts +565 -0
  119. package/src/hooks/use-tablet-layout.ts +384 -0
  120. package/src/hooks/use-touch-friendly-input.ts +524 -0
  121. package/src/hooks/use-touch-friendly-interface.ts +331 -0
  122. package/src/hooks/use-touch-optimization.ts +375 -0
  123. package/src/index.ts +279 -279
  124. package/src/lib/utils.ts +6 -0
  125. package/src/themes/README.md +272 -0
  126. package/src/themes/ThemeContext.tsx +31 -0
  127. package/src/themes/ThemeProvider.tsx +232 -0
  128. package/src/themes/accessibility/index.ts +27 -0
  129. package/src/themes/accessibility.ts +259 -0
  130. package/src/themes/aria-patterns.ts +420 -0
  131. package/src/themes/base-themes.ts +55 -0
  132. package/src/themes/colorManager.ts +380 -0
  133. package/src/themes/examples/dark-theme.ts +154 -0
  134. package/src/themes/examples/minimal-theme.ts +108 -0
  135. package/src/themes/focus-management.ts +701 -0
  136. package/src/themes/fontLoader.ts +201 -0
  137. package/src/themes/high-contrast.ts +621 -0
  138. package/src/themes/index.ts +19 -0
  139. package/src/themes/inheritance.ts +227 -0
  140. package/src/themes/keyboard-navigation.ts +550 -0
  141. package/src/themes/motion-reduction.ts +662 -0
  142. package/src/themes/navigation.ts +238 -0
  143. package/src/themes/screen-reader.ts +645 -0
  144. package/src/themes/systemThemeDetector.ts +182 -0
  145. package/src/themes/themeCSSUpdater.ts +262 -0
  146. package/src/themes/themePersistence.ts +238 -0
  147. package/src/themes/themes/default.ts +586 -0
  148. package/src/themes/themes/harvey.ts +554 -0
  149. package/src/themes/themes/stan-design.ts +683 -0
  150. package/src/themes/types.ts +460 -0
  151. package/src/themes/useSystemTheme.ts +48 -0
  152. package/src/themes/useTheme.ts +87 -0
  153. package/src/themes/validation.ts +462 -0
  154. package/src/tokens/index.ts +34 -0
  155. package/src/tokens/tokenExporter.ts +397 -0
  156. package/src/tokens/tokenGenerator.ts +276 -0
  157. package/src/tokens/tokenManager.ts +248 -0
  158. package/src/tokens/tokenValidator.ts +543 -0
  159. package/src/tokens/types.ts +78 -0
  160. package/src/utils/bundle-analyzer.ts +260 -0
  161. package/src/utils/bundle-splitting.ts +483 -0
  162. package/src/utils/lazy-loading.ts +441 -0
  163. package/src/utils/performance-monitor.ts +513 -0
  164. package/src/utils/tree-shaking.ts +274 -0
@@ -0,0 +1,248 @@
1
+ import type { CompleteThemeConfig } from '../themes/types';
2
+ import type { ThemeTokens, TokenExportOptions } from './types';
3
+ import { TokenGenerator } from './tokenGenerator';
4
+ import { TokenExporter } from './tokenExporter';
5
+ import { TokenValidator, ValidationResult } from './tokenValidator';
6
+
7
+ export interface TokenManagerOptions {
8
+ autoValidate?: boolean;
9
+ autoGenerate?: boolean;
10
+ defaultExportFormat?: TokenExportOptions['format'];
11
+ includeMetadata?: boolean;
12
+ includeComments?: boolean;
13
+ }
14
+
15
+ export class TokenManager {
16
+ private options: TokenManagerOptions;
17
+ private generatedTokens: Map<string, ThemeTokens> = new Map();
18
+
19
+ constructor(options: TokenManagerOptions = {}) {
20
+ this.options = {
21
+ autoValidate: true,
22
+ autoGenerate: true,
23
+ defaultExportFormat: 'json',
24
+ includeMetadata: true,
25
+ includeComments: true,
26
+ ...options
27
+ };
28
+ }
29
+
30
+ /**
31
+ * Generates tokens for a theme configuration
32
+ */
33
+ generateTokens(themeConfig: CompleteThemeConfig): ThemeTokens {
34
+ const tokens = TokenGenerator.generateTokens(themeConfig);
35
+
36
+ if (this.options.autoValidate) {
37
+ const validation = this.validateTokens(tokens);
38
+ if (!validation.isValid) {
39
+ console.warn('Token validation failed:', validation.errors);
40
+ }
41
+ }
42
+
43
+ this.generatedTokens.set(themeConfig.meta.name, tokens);
44
+ return tokens;
45
+ }
46
+
47
+ /**
48
+ * Generates tokens for multiple themes
49
+ */
50
+ generateTokensForThemes(themes: CompleteThemeConfig[]): Map<string, ThemeTokens> {
51
+ themes.forEach(theme => {
52
+ this.generateTokens(theme);
53
+ });
54
+
55
+ return this.generatedTokens;
56
+ }
57
+
58
+ /**
59
+ * Validates tokens
60
+ */
61
+ validateTokens(tokens: ThemeTokens): ValidationResult {
62
+ return TokenValidator.validateTokens(tokens);
63
+ }
64
+
65
+ /**
66
+ * Exports tokens in the specified format
67
+ */
68
+ exportTokens(
69
+ tokens: ThemeTokens,
70
+ format?: TokenExportOptions['format'],
71
+ platform?: TokenExportOptions['platform']
72
+ ): string {
73
+ const options: TokenExportOptions = {
74
+ format: format || this.options.defaultExportFormat!,
75
+ platform,
76
+ includeMetadata: this.options.includeMetadata,
77
+ includeComments: this.options.includeComments
78
+ };
79
+
80
+ return TokenExporter.exportTokens(tokens, options);
81
+ }
82
+
83
+ /**
84
+ * Exports all generated tokens
85
+ */
86
+ exportAllTokens(format?: TokenExportOptions['format']): Map<string, string> {
87
+ const exports = new Map<string, string>();
88
+
89
+ this.generatedTokens.forEach((tokens, themeName) => {
90
+ const exported = this.exportTokens(tokens, format);
91
+ exports.set(themeName, exported);
92
+ });
93
+
94
+ return exports;
95
+ }
96
+
97
+ /**
98
+ * Exports tokens for a specific theme
99
+ */
100
+ exportThemeTokens(themeName: string, format?: TokenExportOptions['format']): string | null {
101
+ const tokens = this.generatedTokens.get(themeName);
102
+ if (!tokens) {
103
+ console.warn(`No tokens found for theme: ${themeName}`);
104
+ return null;
105
+ }
106
+
107
+ return this.exportTokens(tokens, format);
108
+ }
109
+
110
+ /**
111
+ * Gets generated tokens for a theme
112
+ */
113
+ getTokens(themeName: string): ThemeTokens | undefined {
114
+ return this.generatedTokens.get(themeName);
115
+ }
116
+
117
+ /**
118
+ * Gets all generated tokens
119
+ */
120
+ getAllTokens(): Map<string, ThemeTokens> {
121
+ return new Map(this.generatedTokens);
122
+ }
123
+
124
+ /**
125
+ * Clears all generated tokens
126
+ */
127
+ clearTokens(): void {
128
+ this.generatedTokens.clear();
129
+ }
130
+
131
+ /**
132
+ * Removes tokens for a specific theme
133
+ */
134
+ removeTokens(themeName: string): boolean {
135
+ return this.generatedTokens.delete(themeName);
136
+ }
137
+
138
+ /**
139
+ * Gets token statistics
140
+ */
141
+ getTokenStats(): {
142
+ totalThemes: number;
143
+ totalTokens: number;
144
+ tokenBreakdown: Record<string, number>;
145
+ } {
146
+ const totalThemes = this.generatedTokens.size;
147
+ let totalTokens = 0;
148
+ const tokenBreakdown: Record<string, number> = {};
149
+
150
+ this.generatedTokens.forEach(tokens => {
151
+ Object.entries(tokens.tokens).forEach(([category, categoryTokens]) => {
152
+ if (categoryTokens) {
153
+ const count = this.countTokensInGroup(categoryTokens);
154
+ tokenBreakdown[category] = (tokenBreakdown[category] || 0) + count;
155
+ totalTokens += count;
156
+ }
157
+ });
158
+ });
159
+
160
+ return {
161
+ totalThemes,
162
+ totalTokens,
163
+ tokenBreakdown
164
+ };
165
+ }
166
+
167
+ /**
168
+ * Counts tokens in a token group recursively
169
+ */
170
+ private countTokensInGroup(group: any): number {
171
+ let count = 0;
172
+
173
+ Object.values(group).forEach(value => {
174
+ if (value && typeof value === 'object') {
175
+ if ('type' in value && 'value' in value) {
176
+ // This is a token
177
+ count++;
178
+ } else {
179
+ // This is a group, recurse
180
+ count += this.countTokensInGroup(value);
181
+ }
182
+ }
183
+ });
184
+
185
+ return count;
186
+ }
187
+
188
+ /**
189
+ * Updates manager options
190
+ */
191
+ updateOptions(newOptions: Partial<TokenManagerOptions>): void {
192
+ this.options = { ...this.options, ...newOptions };
193
+ }
194
+
195
+ /**
196
+ * Gets current manager options
197
+ */
198
+ getOptions(): TokenManagerOptions {
199
+ return { ...this.options };
200
+ }
201
+
202
+ /**
203
+ * Exports tokens to file (simulated - in real implementation would write to filesystem)
204
+ */
205
+ exportToFile(
206
+ themeName: string,
207
+ format: TokenExportOptions['format'] = 'json',
208
+ filename?: string
209
+ ): { success: boolean; filename: string; content: string } {
210
+ const tokens = this.generatedTokens.get(themeName);
211
+ if (!tokens) {
212
+ throw new Error(`No tokens found for theme: ${themeName}`);
213
+ }
214
+
215
+ const content = this.exportTokens(tokens, format);
216
+ const finalFilename = filename || `${themeName}-tokens.${format}`;
217
+
218
+ // In a real implementation, this would write to the filesystem
219
+ // For now, we'll just return the content and filename
220
+ return {
221
+ success: true,
222
+ filename: finalFilename,
223
+ content
224
+ };
225
+ }
226
+
227
+ /**
228
+ * Exports all themes to files
229
+ */
230
+ exportAllToFiles(format?: TokenExportOptions['format']): Map<string, { success: boolean; filename: string; content: string }> {
231
+ const exports = new Map<string, { success: boolean; filename: string; content: string }>();
232
+
233
+ this.generatedTokens.forEach((_tokens, themeName) => {
234
+ try {
235
+ const result = this.exportToFile(themeName, format);
236
+ exports.set(themeName, result);
237
+ } catch (error) {
238
+ exports.set(themeName, {
239
+ success: false,
240
+ filename: `${themeName}-tokens.${format}`,
241
+ content: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`
242
+ });
243
+ }
244
+ });
245
+
246
+ return exports;
247
+ }
248
+ }