@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.11 → 0.2.17
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.
- package/CHANGELOG.md +1 -1
- package/dist/components/ui/accessibility-demo.d.ts +5 -257
- package/dist/components/ui/accessibility-demo.d.ts.map +1 -0
- package/dist/components/ui/accessibility-demo.esm.js +80 -258
- package/dist/components/ui/accessibility-demo.js +80 -258
- package/dist/components/ui/advanced-component-architecture-demo.d.ts +4 -718
- package/dist/components/ui/advanced-component-architecture-demo.d.ts.map +1 -0
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +256 -916
- package/dist/components/ui/advanced-component-architecture-demo.js +256 -916
- package/dist/components/ui/advanced-transition-system-demo.d.ts +3 -660
- package/dist/components/ui/advanced-transition-system-demo.d.ts.map +1 -0
- package/dist/components/ui/advanced-transition-system-demo.esm.js +59 -670
- package/dist/components/ui/advanced-transition-system-demo.js +59 -670
- package/dist/components/ui/advanced-transition-system.d.ts +35 -381
- package/dist/components/ui/advanced-transition-system.d.ts.map +1 -0
- package/dist/components/ui/advanced-transition-system.esm.js +194 -378
- package/dist/components/ui/advanced-transition-system.js +194 -378
- package/dist/components/ui/animation/animated-container.d.ts +11 -160
- package/dist/components/ui/animation/animated-container.d.ts.map +1 -0
- package/dist/components/ui/animation/animated-container.esm.js +98 -159
- package/dist/components/ui/animation/animated-container.js +98 -159
- package/dist/components/ui/animation/index.d.ts +7 -9
- package/dist/components/ui/animation/index.d.ts.map +1 -0
- package/dist/components/ui/animation/index.esm.js +3 -18
- package/dist/components/ui/animation/index.js +3 -18
- package/dist/components/ui/animation/staggered-container.d.ts +8 -62
- package/dist/components/ui/animation/staggered-container.d.ts.map +1 -0
- package/dist/components/ui/animation/staggered-container.esm.js +37 -68
- package/dist/components/ui/animation/staggered-container.js +37 -68
- package/dist/components/ui/animation-demo.d.ts +3 -238
- package/dist/components/ui/animation-demo.d.ts.map +1 -0
- package/dist/components/ui/animation-demo.esm.js +30 -250
- package/dist/components/ui/animation-demo.js +30 -250
- package/dist/components/ui/badge.d.ts +9 -27
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.esm.js +15 -28
- package/dist/components/ui/badge.js +15 -28
- package/dist/components/ui/battery-conscious-animation-demo.d.ts +4 -561
- package/dist/components/ui/battery-conscious-animation-demo.d.ts.map +1 -0
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +136 -565
- package/dist/components/ui/battery-conscious-animation-demo.js +136 -565
- package/dist/components/ui/border-radius-shadow-demo.d.ts +3 -183
- package/dist/components/ui/border-radius-shadow-demo.d.ts.map +1 -0
- package/dist/components/ui/border-radius-shadow-demo.esm.js +3 -184
- package/dist/components/ui/border-radius-shadow-demo.js +3 -184
- package/dist/components/ui/button.d.ts +8 -32
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.esm.js +14 -33
- package/dist/components/ui/button.js +14 -33
- package/dist/components/ui/card.d.ts +25 -193
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.esm.js +74 -188
- package/dist/components/ui/card.js +74 -188
- package/dist/components/ui/checkbox.d.ts +6 -24
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.esm.js +11 -30
- package/dist/components/ui/checkbox.js +11 -30
- package/dist/components/ui/color-preview.d.ts +12 -398
- package/dist/components/ui/color-preview.d.ts.map +1 -0
- package/dist/components/ui/color-preview.esm.js +50 -405
- package/dist/components/ui/color-preview.js +50 -405
- package/dist/components/ui/data-display/chart.d.ts +4 -645
- package/dist/components/ui/data-display/chart.d.ts.map +1 -0
- package/dist/components/ui/data-display/chart.esm.js +210 -632
- package/dist/components/ui/data-display/chart.js +210 -632
- package/dist/components/ui/data-display/data-grid-simple.d.ts +5 -73
- package/dist/components/ui/data-display/data-grid-simple.d.ts.map +1 -0
- package/dist/components/ui/data-display/data-grid-simple.esm.js +16 -74
- package/dist/components/ui/data-display/data-grid-simple.js +16 -74
- package/dist/components/ui/data-display/data-grid.d.ts +4 -669
- package/dist/components/ui/data-display/data-grid.d.ts.map +1 -0
- package/dist/components/ui/data-display/data-grid.esm.js +173 -661
- package/dist/components/ui/data-display/data-grid.js +173 -661
- package/dist/components/ui/data-display/list.d.ts +4 -447
- package/dist/components/ui/data-display/list.d.ts.map +1 -0
- package/dist/components/ui/data-display/list.esm.js +88 -446
- package/dist/components/ui/data-display/list.js +88 -446
- package/dist/components/ui/data-display/table.d.ts +4 -471
- package/dist/components/ui/data-display/table.d.ts.map +1 -0
- package/dist/components/ui/data-display/table.esm.js +109 -468
- package/dist/components/ui/data-display/table.js +109 -468
- package/dist/components/ui/data-display/timeline.d.ts +4 -432
- package/dist/components/ui/data-display/timeline.d.ts.map +1 -0
- package/dist/components/ui/data-display/timeline.esm.js +92 -431
- package/dist/components/ui/data-display/timeline.js +92 -431
- package/dist/components/ui/data-display/tree.d.ts +4 -593
- package/dist/components/ui/data-display/tree.d.ts.map +1 -0
- package/dist/components/ui/data-display/tree.esm.js +211 -585
- package/dist/components/ui/data-display/tree.js +211 -585
- package/dist/components/ui/data-display/types.d.ts +418 -471
- package/dist/components/ui/data-display/types.d.ts.map +1 -0
- package/dist/components/ui/data-display/types.esm.js +1 -530
- package/dist/components/ui/data-display/types.js +1 -530
- package/dist/components/ui/enterprise-mobile-experience-demo.d.ts +3 -735
- package/dist/components/ui/enterprise-mobile-experience-demo.d.ts.map +1 -0
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +76 -749
- package/dist/components/ui/enterprise-mobile-experience-demo.js +76 -749
- package/dist/components/ui/enterprise-mobile-experience.d.ts +52 -441
- package/dist/components/ui/enterprise-mobile-experience.d.ts.map +1 -0
- package/dist/components/ui/enterprise-mobile-experience.esm.js +152 -460
- package/dist/components/ui/enterprise-mobile-experience.js +152 -460
- package/dist/components/ui/feedback/alert.d.ts +4 -153
- package/dist/components/ui/feedback/alert.d.ts.map +1 -0
- package/dist/components/ui/feedback/alert.esm.js +40 -148
- package/dist/components/ui/feedback/alert.js +40 -148
- package/dist/components/ui/feedback/progress.d.ts +4 -287
- package/dist/components/ui/feedback/progress.d.ts.map +1 -0
- package/dist/components/ui/feedback/progress.esm.js +74 -278
- package/dist/components/ui/feedback/progress.js +74 -278
- package/dist/components/ui/feedback/skeleton.d.ts +7 -181
- package/dist/components/ui/feedback/skeleton.d.ts.map +1 -0
- package/dist/components/ui/feedback/skeleton.esm.js +64 -173
- package/dist/components/ui/feedback/skeleton.js +64 -173
- package/dist/components/ui/feedback/toast.d.ts +7 -276
- package/dist/components/ui/feedback/toast.d.ts.map +1 -0
- package/dist/components/ui/feedback/toast.esm.js +86 -225
- package/dist/components/ui/feedback/toast.js +86 -225
- package/dist/components/ui/feedback/types.d.ts +85 -99
- package/dist/components/ui/feedback/types.d.ts.map +1 -0
- package/dist/components/ui/feedback/types.esm.js +1 -125
- package/dist/components/ui/feedback/types.js +1 -125
- package/dist/components/ui/font-preview.d.ts +11 -278
- package/dist/components/ui/font-preview.d.ts.map +1 -0
- package/dist/components/ui/font-preview.esm.js +56 -283
- package/dist/components/ui/font-preview.js +56 -283
- package/dist/components/ui/form-demo.d.ts +4 -544
- package/dist/components/ui/form-demo.d.ts.map +1 -0
- package/dist/components/ui/form-demo.esm.js +191 -553
- package/dist/components/ui/form-demo.js +191 -553
- package/dist/components/ui/hardware-acceleration-demo.d.ts +4 -540
- package/dist/components/ui/hardware-acceleration-demo.d.ts.map +1 -0
- package/dist/components/ui/hardware-acceleration-demo.esm.js +103 -544
- package/dist/components/ui/hardware-acceleration-demo.js +103 -544
- package/dist/components/ui/input.d.ts +8 -32
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.esm.js +13 -32
- package/dist/components/ui/input.js +13 -32
- package/dist/components/ui/label.d.ts +5 -13
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.esm.js +6 -16
- package/dist/components/ui/label.js +6 -16
- package/dist/components/ui/layout-demo.d.ts +4 -352
- package/dist/components/ui/layout-demo.d.ts.map +1 -0
- package/dist/components/ui/layout-demo.esm.js +76 -367
- package/dist/components/ui/layout-demo.js +76 -367
- package/dist/components/ui/layouts/adaptive-layout.d.ts +14 -130
- package/dist/components/ui/layouts/adaptive-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/adaptive-layout.esm.js +60 -139
- package/dist/components/ui/layouts/adaptive-layout.js +60 -139
- package/dist/components/ui/layouts/desktop-layout.d.ts +13 -217
- package/dist/components/ui/layouts/desktop-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -224
- package/dist/components/ui/layouts/desktop-layout.js +39 -224
- package/dist/components/ui/layouts/index.d.ts +9 -5
- package/dist/components/ui/layouts/index.d.ts.map +1 -0
- package/dist/components/ui/layouts/index.esm.js +4 -10
- package/dist/components/ui/layouts/index.js +4 -10
- package/dist/components/ui/layouts/mobile-layout.d.ts +12 -156
- package/dist/components/ui/layouts/mobile-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/mobile-layout.esm.js +49 -162
- package/dist/components/ui/layouts/mobile-layout.js +49 -162
- package/dist/components/ui/layouts/tablet-layout.d.ts +12 -190
- package/dist/components/ui/layouts/tablet-layout.d.ts.map +1 -0
- package/dist/components/ui/layouts/tablet-layout.esm.js +53 -197
- package/dist/components/ui/layouts/tablet-layout.js +53 -197
- package/dist/components/ui/mobile-form-validation.d.ts +28 -435
- package/dist/components/ui/mobile-form-validation.d.ts.map +1 -0
- package/dist/components/ui/mobile-form-validation.esm.js +185 -420
- package/dist/components/ui/mobile-form-validation.js +185 -420
- package/dist/components/ui/mobile-input-demo.d.ts +3 -197
- package/dist/components/ui/mobile-input-demo.d.ts.map +1 -0
- package/dist/components/ui/mobile-input-demo.esm.js +11 -198
- package/dist/components/ui/mobile-input-demo.js +11 -198
- package/dist/components/ui/mobile-input.d.ts +61 -268
- package/dist/components/ui/mobile-input.d.ts.map +1 -0
- package/dist/components/ui/mobile-input.esm.js +187 -270
- package/dist/components/ui/mobile-input.js +187 -270
- package/dist/components/ui/mobile-skeleton-loading-demo.d.ts +4 -628
- package/dist/components/ui/mobile-skeleton-loading-demo.d.ts.map +1 -0
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +144 -638
- package/dist/components/ui/mobile-skeleton-loading-demo.js +144 -638
- package/dist/components/ui/navigation/breadcrumb.d.ts +8 -148
- package/dist/components/ui/navigation/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/navigation/breadcrumb.esm.js +51 -154
- package/dist/components/ui/navigation/breadcrumb.js +51 -154
- package/dist/components/ui/navigation/index.d.ts +12 -25
- package/dist/components/ui/navigation/index.d.ts.map +1 -0
- package/dist/components/ui/navigation/index.esm.js +0 -3
- package/dist/components/ui/navigation/index.js +0 -3
- package/dist/components/ui/navigation/menu.d.ts +8 -365
- package/dist/components/ui/navigation/menu.d.ts.map +1 -0
- package/dist/components/ui/navigation/menu.esm.js +178 -365
- package/dist/components/ui/navigation/menu.js +178 -365
- package/dist/components/ui/navigation/navigation-demo.d.ts +7 -168
- package/dist/components/ui/navigation/navigation-demo.d.ts.map +1 -0
- package/dist/components/ui/navigation/navigation-demo.esm.js +130 -315
- package/dist/components/ui/navigation/navigation-demo.js +130 -315
- package/dist/components/ui/navigation/pagination.d.ts +8 -260
- package/dist/components/ui/navigation/pagination.d.ts.map +1 -0
- package/dist/components/ui/navigation/pagination.esm.js +142 -264
- package/dist/components/ui/navigation/pagination.js +142 -264
- package/dist/components/ui/navigation/sidebar.d.ts +8 -374
- package/dist/components/ui/navigation/sidebar.d.ts.map +1 -0
- package/dist/components/ui/navigation/sidebar.esm.js +156 -368
- package/dist/components/ui/navigation/sidebar.js +156 -368
- package/dist/components/ui/navigation/stepper.d.ts +8 -293
- package/dist/components/ui/navigation/stepper.d.ts.map +1 -0
- package/dist/components/ui/navigation/stepper.esm.js +131 -295
- package/dist/components/ui/navigation/stepper.js +131 -295
- package/dist/components/ui/navigation/tabs.d.ts +8 -195
- package/dist/components/ui/navigation/tabs.d.ts.map +1 -0
- package/dist/components/ui/navigation/tabs.esm.js +89 -198
- package/dist/components/ui/navigation/tabs.js +89 -198
- package/dist/components/ui/navigation/types.d.ts +216 -254
- package/dist/components/ui/navigation/types.d.ts.map +1 -0
- package/dist/components/ui/navigation/types.esm.js +1 -295
- package/dist/components/ui/navigation/types.js +1 -295
- package/dist/components/ui/overlay/backdrop.d.ts +12 -76
- package/dist/components/ui/overlay/backdrop.d.ts.map +1 -0
- package/dist/components/ui/overlay/backdrop.esm.js +39 -78
- package/dist/components/ui/overlay/backdrop.js +39 -78
- package/dist/components/ui/overlay/focus-manager.d.ts +10 -138
- package/dist/components/ui/overlay/focus-manager.d.ts.map +1 -0
- package/dist/components/ui/overlay/focus-manager.esm.js +96 -140
- package/dist/components/ui/overlay/focus-manager.js +96 -140
- package/dist/components/ui/overlay/index.d.ts +10 -27
- package/dist/components/ui/overlay/index.d.ts.map +1 -0
- package/dist/components/ui/overlay/index.esm.js +0 -5
- package/dist/components/ui/overlay/index.js +0 -5
- package/dist/components/ui/overlay/modal.d.ts +7 -261
- package/dist/components/ui/overlay/modal.d.ts.map +1 -0
- package/dist/components/ui/overlay/modal.esm.js +94 -249
- package/dist/components/ui/overlay/modal.js +94 -249
- package/dist/components/ui/overlay/overlay-manager.d.ts +13 -104
- package/dist/components/ui/overlay/overlay-manager.d.ts.map +1 -0
- package/dist/components/ui/overlay/overlay-manager.esm.js +60 -100
- package/dist/components/ui/overlay/overlay-manager.js +60 -100
- package/dist/components/ui/overlay/popover.d.ts +8 -449
- package/dist/components/ui/overlay/popover.d.ts.map +1 -0
- package/dist/components/ui/overlay/popover.esm.js +258 -438
- package/dist/components/ui/overlay/popover.js +258 -438
- package/dist/components/ui/overlay/portal.d.ts +4 -74
- package/dist/components/ui/overlay/portal.d.ts.map +1 -0
- package/dist/components/ui/overlay/portal.esm.js +45 -74
- package/dist/components/ui/overlay/portal.js +45 -74
- package/dist/components/ui/overlay/tooltip.d.ts +5 -297
- package/dist/components/ui/overlay/tooltip.d.ts.map +1 -0
- package/dist/components/ui/overlay/tooltip.esm.js +202 -288
- package/dist/components/ui/overlay/tooltip.js +202 -288
- package/dist/components/ui/overlay/types.d.ts +144 -167
- package/dist/components/ui/overlay/types.d.ts.map +1 -0
- package/dist/components/ui/overlay/types.esm.js +1 -196
- package/dist/components/ui/overlay/types.js +1 -196
- package/dist/components/ui/performance-demo.d.ts +3 -583
- package/dist/components/ui/performance-demo.d.ts.map +1 -0
- package/dist/components/ui/performance-demo.esm.js +110 -596
- package/dist/components/ui/performance-demo.js +110 -596
- package/dist/components/ui/semantic-input-system-demo.d.ts +3 -490
- package/dist/components/ui/semantic-input-system-demo.d.ts.map +1 -0
- package/dist/components/ui/semantic-input-system-demo.esm.js +87 -501
- package/dist/components/ui/semantic-input-system-demo.js +87 -501
- package/dist/components/ui/theme-customizer.d.ts +19 -370
- package/dist/components/ui/theme-customizer.d.ts.map +1 -0
- package/dist/components/ui/theme-customizer.esm.js +123 -371
- package/dist/components/ui/theme-customizer.js +123 -371
- package/dist/components/ui/theme-preview.d.ts +9 -303
- package/dist/components/ui/theme-preview.d.ts.map +1 -0
- package/dist/components/ui/theme-preview.esm.js +44 -306
- package/dist/components/ui/theme-preview.js +44 -306
- package/dist/components/ui/theme-switcher.d.ts +9 -257
- package/dist/components/ui/theme-switcher.d.ts.map +1 -0
- package/dist/components/ui/theme-switcher.esm.js +79 -258
- package/dist/components/ui/theme-switcher.js +79 -258
- package/dist/components/ui/theme-toggle.d.ts +3 -34
- package/dist/components/ui/theme-toggle.d.ts.map +1 -0
- package/dist/components/ui/theme-toggle.esm.js +22 -35
- package/dist/components/ui/theme-toggle.js +22 -35
- package/dist/components/ui/token-demo.d.ts +3 -188
- package/dist/components/ui/token-demo.d.ts.map +1 -0
- package/dist/components/ui/token-demo.esm.js +42 -189
- package/dist/components/ui/token-demo.js +42 -189
- package/dist/components/ui/touch-demo.d.ts +3 -455
- package/dist/components/ui/touch-demo.d.ts.map +1 -0
- package/dist/components/ui/touch-demo.esm.js +96 -462
- package/dist/components/ui/touch-demo.js +96 -462
- package/dist/components/ui/touch-friendly-interface-demo.d.ts +3 -512
- package/dist/components/ui/touch-friendly-interface-demo.d.ts.map +1 -0
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +63 -519
- package/dist/components/ui/touch-friendly-interface-demo.js +63 -519
- package/dist/components/ui/touch-friendly-interface.d.ts +21 -282
- package/dist/components/ui/touch-friendly-interface.d.ts.map +1 -0
- package/dist/components/ui/touch-friendly-interface.esm.js +103 -281
- package/dist/components/ui/touch-friendly-interface.js +103 -281
- package/dist/hooks/index.d.ts +47 -161
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.esm.js +23 -181
- package/dist/hooks/index.js +23 -181
- package/dist/hooks/use-accessibility-support.d.ts +66 -508
- package/dist/hooks/use-accessibility-support.d.ts.map +1 -0
- package/dist/hooks/use-accessibility-support.esm.js +377 -518
- package/dist/hooks/use-accessibility-support.js +377 -518
- package/dist/hooks/use-adaptive-layout.d.ts +51 -281
- package/dist/hooks/use-adaptive-layout.d.ts.map +1 -0
- package/dist/hooks/use-adaptive-layout.esm.js +212 -287
- package/dist/hooks/use-adaptive-layout.js +212 -287
- package/dist/hooks/use-advanced-patterns.d.ts +78 -282
- package/dist/hooks/use-advanced-patterns.d.ts.map +1 -0
- package/dist/hooks/use-advanced-patterns.esm.js +185 -293
- package/dist/hooks/use-advanced-patterns.js +185 -293
- package/dist/hooks/use-advanced-transition-system.d.ts +51 -382
- package/dist/hooks/use-advanced-transition-system.d.ts.map +1 -0
- package/dist/hooks/use-advanced-transition-system.esm.js +286 -392
- package/dist/hooks/use-advanced-transition-system.js +286 -392
- package/dist/hooks/use-animation-profile.d.ts +39 -279
- package/dist/hooks/use-animation-profile.d.ts.map +1 -0
- package/dist/hooks/use-animation-profile.esm.js +221 -283
- package/dist/hooks/use-animation-profile.js +221 -283
- package/dist/hooks/use-battery-animations.d.ts +47 -376
- package/dist/hooks/use-battery-animations.d.ts.map +1 -0
- package/dist/hooks/use-battery-animations.esm.js +310 -384
- package/dist/hooks/use-battery-animations.js +310 -384
- package/dist/hooks/use-battery-conscious-loading.d.ts +50 -465
- package/dist/hooks/use-battery-conscious-loading.d.ts.map +1 -0
- package/dist/hooks/use-battery-conscious-loading.esm.js +374 -468
- package/dist/hooks/use-battery-conscious-loading.js +374 -468
- package/dist/hooks/use-battery-optimization.d.ts +39 -322
- package/dist/hooks/use-battery-optimization.d.ts.map +1 -0
- package/dist/hooks/use-battery-optimization.esm.js +267 -329
- package/dist/hooks/use-battery-optimization.js +267 -329
- package/dist/hooks/use-battery-status.d.ts +49 -289
- package/dist/hooks/use-battery-status.d.ts.map +1 -0
- package/dist/hooks/use-battery-status.esm.js +213 -293
- package/dist/hooks/use-battery-status.js +213 -293
- package/dist/hooks/use-component-performance.d.ts +60 -336
- package/dist/hooks/use-component-performance.d.ts.map +1 -0
- package/dist/hooks/use-component-performance.esm.js +235 -341
- package/dist/hooks/use-component-performance.js +235 -341
- package/dist/hooks/use-device-loading-states.d.ts +53 -448
- package/dist/hooks/use-device-loading-states.d.ts.map +1 -0
- package/dist/hooks/use-device-loading-states.esm.js +356 -457
- package/dist/hooks/use-device-loading-states.js +356 -457
- package/dist/hooks/use-device.d.ts +18 -102
- package/dist/hooks/use-device.d.ts.map +1 -0
- package/dist/hooks/use-device.esm.js +77 -102
- package/dist/hooks/use-device.js +77 -102
- package/dist/hooks/use-enterprise-mobile-experience.d.ts +72 -474
- package/dist/hooks/use-enterprise-mobile-experience.d.ts.map +1 -0
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +349 -487
- package/dist/hooks/use-enterprise-mobile-experience.js +349 -487
- package/dist/hooks/use-form-feedback.d.ts +81 -391
- package/dist/hooks/use-form-feedback.d.ts.map +1 -0
- package/dist/hooks/use-form-feedback.esm.js +313 -398
- package/dist/hooks/use-form-feedback.js +313 -398
- package/dist/hooks/use-form-performance.d.ts +78 -501
- package/dist/hooks/use-form-performance.d.ts.map +1 -0
- package/dist/hooks/use-form-performance.esm.js +407 -500
- package/dist/hooks/use-form-performance.js +407 -500
- package/dist/hooks/use-frame-rate.d.ts +39 -241
- package/dist/hooks/use-frame-rate.d.ts.map +1 -0
- package/dist/hooks/use-frame-rate.esm.js +178 -251
- package/dist/hooks/use-frame-rate.js +178 -251
- package/dist/hooks/use-gestures.d.ts +84 -326
- package/dist/hooks/use-gestures.d.ts.map +1 -0
- package/dist/hooks/use-gestures.esm.js +230 -332
- package/dist/hooks/use-gestures.js +230 -332
- package/dist/hooks/use-hardware-acceleration.d.ts +45 -331
- package/dist/hooks/use-hardware-acceleration.d.ts.map +1 -0
- package/dist/hooks/use-hardware-acceleration.esm.js +246 -339
- package/dist/hooks/use-hardware-acceleration.js +246 -339
- package/dist/hooks/use-input-accessibility.d.ts +50 -443
- package/dist/hooks/use-input-accessibility.d.ts.map +1 -0
- package/dist/hooks/use-input-accessibility.esm.js +350 -454
- package/dist/hooks/use-input-accessibility.js +350 -454
- package/dist/hooks/use-input-performance.d.ts +47 -495
- package/dist/hooks/use-input-performance.d.ts.map +1 -0
- package/dist/hooks/use-input-performance.esm.js +419 -502
- package/dist/hooks/use-input-performance.js +419 -502
- package/dist/hooks/use-layout-performance.d.ts +33 -311
- package/dist/hooks/use-layout-performance.d.ts.map +1 -0
- package/dist/hooks/use-layout-performance.esm.js +233 -319
- package/dist/hooks/use-layout-performance.js +233 -319
- package/dist/hooks/use-loading-accessibility.d.ts +54 -524
- package/dist/hooks/use-loading-accessibility.d.ts.map +1 -0
- package/dist/hooks/use-loading-accessibility.esm.js +421 -531
- package/dist/hooks/use-loading-accessibility.js +421 -531
- package/dist/hooks/use-loading-performance.d.ts +43 -463
- package/dist/hooks/use-loading-performance.d.ts.map +1 -0
- package/dist/hooks/use-loading-performance.esm.js +398 -469
- package/dist/hooks/use-loading-performance.js +398 -469
- package/dist/hooks/use-memory-usage.d.ts +43 -277
- package/dist/hooks/use-memory-usage.d.ts.map +1 -0
- package/dist/hooks/use-memory-usage.esm.js +211 -287
- package/dist/hooks/use-memory-usage.js +211 -287
- package/dist/hooks/use-mobile-form-layout.d.ts +116 -451
- package/dist/hooks/use-mobile-form-layout.d.ts.map +1 -0
- package/dist/hooks/use-mobile-form-layout.esm.js +365 -458
- package/dist/hooks/use-mobile-form-layout.js +365 -458
- package/dist/hooks/use-mobile-form-validation.d.ts +87 -503
- package/dist/hooks/use-mobile-form-validation.d.ts.map +1 -0
- package/dist/hooks/use-mobile-form-validation.esm.js +384 -497
- package/dist/hooks/use-mobile-form-validation.js +384 -497
- package/dist/hooks/use-mobile-keyboard-optimization.d.ts +62 -461
- package/dist/hooks/use-mobile-keyboard-optimization.d.ts.map +1 -0
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +354 -468
- package/dist/hooks/use-mobile-keyboard-optimization.js +354 -468
- package/dist/hooks/use-mobile-layout.d.ts +48 -292
- package/dist/hooks/use-mobile-layout.d.ts.map +1 -0
- package/dist/hooks/use-mobile-layout.esm.js +207 -294
- package/dist/hooks/use-mobile-layout.js +207 -294
- package/dist/hooks/use-mobile-optimization.d.ts +49 -398
- package/dist/hooks/use-mobile-optimization.d.ts.map +1 -0
- package/dist/hooks/use-mobile-optimization.esm.js +308 -404
- package/dist/hooks/use-mobile-optimization.js +308 -404
- package/dist/hooks/use-mobile-skeleton.d.ts +51 -391
- package/dist/hooks/use-mobile-skeleton.d.ts.map +1 -0
- package/dist/hooks/use-mobile-skeleton.esm.js +300 -402
- package/dist/hooks/use-mobile-skeleton.js +300 -402
- package/dist/hooks/use-mobile-touch.d.ts +73 -399
- package/dist/hooks/use-mobile-touch.d.ts.map +1 -0
- package/dist/hooks/use-mobile-touch.esm.js +314 -412
- package/dist/hooks/use-mobile-touch.js +314 -412
- package/dist/hooks/use-performance-throttling.d.ts +42 -340
- package/dist/hooks/use-performance-throttling.d.ts.map +1 -0
- package/dist/hooks/use-performance-throttling.esm.js +276 -344
- package/dist/hooks/use-performance-throttling.js +276 -344
- package/dist/hooks/use-performance.d.ts +65 -306
- package/dist/hooks/use-performance.d.ts.map +1 -0
- package/dist/hooks/use-performance.esm.js +216 -313
- package/dist/hooks/use-performance.js +216 -313
- package/dist/hooks/use-reusable-architecture.d.ts +82 -400
- package/dist/hooks/use-reusable-architecture.d.ts.map +1 -0
- package/dist/hooks/use-reusable-architecture.esm.js +255 -408
- package/dist/hooks/use-reusable-architecture.js +255 -408
- package/dist/hooks/use-semantic-input-types.d.ts +51 -348
- package/dist/hooks/use-semantic-input-types.d.ts.map +1 -0
- package/dist/hooks/use-semantic-input-types.esm.js +290 -356
- package/dist/hooks/use-semantic-input-types.js +290 -356
- package/dist/hooks/use-semantic-input.d.ts +62 -552
- package/dist/hooks/use-semantic-input.d.ts.map +1 -0
- package/dist/hooks/use-semantic-input.esm.js +446 -549
- package/dist/hooks/use-semantic-input.js +446 -549
- package/dist/hooks/use-tablet-layout.d.ts +67 -375
- package/dist/hooks/use-tablet-layout.d.ts.map +1 -0
- package/dist/hooks/use-tablet-layout.esm.js +279 -384
- package/dist/hooks/use-tablet-layout.js +279 -384
- package/dist/hooks/use-touch-friendly-input.d.ts +67 -512
- package/dist/hooks/use-touch-friendly-input.d.ts.map +1 -0
- package/dist/hooks/use-touch-friendly-input.esm.js +401 -519
- package/dist/hooks/use-touch-friendly-input.js +401 -519
- package/dist/hooks/use-touch-friendly-interface.d.ts +48 -321
- package/dist/hooks/use-touch-friendly-interface.d.ts.map +1 -0
- package/dist/hooks/use-touch-friendly-interface.esm.js +242 -331
- package/dist/hooks/use-touch-friendly-interface.js +242 -331
- package/dist/hooks/use-touch-optimization.d.ts +56 -363
- package/dist/hooks/use-touch-optimization.d.ts.map +1 -0
- package/dist/hooks/use-touch-optimization.esm.js +288 -370
- package/dist/hooks/use-touch-optimization.js +288 -370
- package/dist/index.d.ts +168 -17
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +150 -161
- package/dist/index.js +150 -161
- package/dist/lib/utils.d.ts +3 -3
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.esm.js +4 -5
- package/dist/lib/utils.js +4 -5
- package/dist/plugins/theme-css-generator.d.ts +3 -345
- package/dist/plugins/theme-css-generator.d.ts.map +1 -0
- package/dist/plugins/theme-css-generator.esm.js +292 -346
- package/dist/plugins/theme-css-generator.js +292 -346
- package/dist/provider.d.ts +6 -14
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.esm.js +3 -19
- package/dist/provider.js +3 -19
- package/dist/styles/layers/validation.d.ts +20 -0
- package/dist/styles/layers/validation.d.ts.map +1 -0
- package/dist/styles/layers/validation.esm.js +275 -0
- package/dist/styles/layers/validation.js +275 -0
- package/dist/styles.css +1 -1
- package/dist/theme.d.ts +7 -678
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.esm.js +654 -658
- package/dist/theme.js +654 -658
- package/dist/themes/ThemeContext.d.ts +18 -22
- package/dist/themes/ThemeContext.d.ts.map +1 -0
- package/dist/themes/ThemeContext.esm.js +1 -27
- package/dist/themes/ThemeContext.js +1 -27
- package/dist/themes/ThemeProvider.d.ts +3 -222
- package/dist/themes/ThemeProvider.d.ts.map +1 -0
- package/dist/themes/ThemeProvider.esm.js +191 -223
- package/dist/themes/ThemeProvider.js +191 -223
- package/dist/themes/accessibility/index.d.ts +18 -6
- package/dist/themes/accessibility/index.d.ts.map +1 -0
- package/dist/themes/accessibility/index.esm.js +0 -4
- package/dist/themes/accessibility/index.js +0 -4
- package/dist/themes/accessibility.d.ts +53 -253
- package/dist/themes/accessibility.d.ts.map +1 -0
- package/dist/themes/accessibility.esm.js +175 -240
- package/dist/themes/accessibility.js +175 -240
- package/dist/themes/aria-patterns.d.ts +145 -410
- package/dist/themes/aria-patterns.d.ts.map +1 -0
- package/dist/themes/aria-patterns.esm.js +345 -401
- package/dist/themes/aria-patterns.js +345 -401
- package/dist/themes/base-themes.d.ts +29 -32
- package/dist/themes/base-themes.d.ts.map +1 -0
- package/dist/themes/base-themes.esm.js +15 -24
- package/dist/themes/base-themes.js +15 -24
- package/dist/themes/colorManager.d.ts +63 -326
- package/dist/themes/colorManager.d.ts.map +1 -0
- package/dist/themes/colorManager.esm.js +293 -357
- package/dist/themes/colorManager.js +293 -357
- package/dist/themes/examples/dark-theme.d.ts +13 -139
- package/dist/themes/examples/dark-theme.d.ts.map +1 -0
- package/dist/themes/examples/dark-theme.esm.js +129 -133
- package/dist/themes/examples/dark-theme.js +129 -133
- package/dist/themes/examples/minimal-theme.d.ts +6 -93
- package/dist/themes/examples/minimal-theme.d.ts.map +1 -0
- package/dist/themes/examples/minimal-theme.esm.js +80 -85
- package/dist/themes/examples/minimal-theme.js +80 -85
- package/dist/themes/focus-management.d.ts +100 -689
- package/dist/themes/focus-management.d.ts.map +1 -0
- package/dist/themes/focus-management.esm.js +541 -677
- package/dist/themes/focus-management.js +541 -677
- package/dist/themes/fontLoader.d.ts +48 -162
- package/dist/themes/fontLoader.d.ts.map +1 -0
- package/dist/themes/fontLoader.esm.js +151 -180
- package/dist/themes/fontLoader.js +151 -180
- package/dist/themes/high-contrast.d.ts +64 -613
- package/dist/themes/high-contrast.d.ts.map +1 -0
- package/dist/themes/high-contrast.esm.js +394 -558
- package/dist/themes/high-contrast.js +394 -558
- package/dist/themes/index.d.ts +3 -6
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.esm.js +1 -9
- package/dist/themes/index.js +1 -9
- package/dist/themes/inheritance.d.ts +86 -156
- package/dist/themes/inheritance.d.ts.map +1 -0
- package/dist/themes/inheritance.esm.js +145 -180
- package/dist/themes/inheritance.js +145 -180
- package/dist/themes/keyboard-navigation.d.ts +205 -542
- package/dist/themes/keyboard-navigation.d.ts.map +1 -0
- package/dist/themes/keyboard-navigation.esm.js +418 -510
- package/dist/themes/keyboard-navigation.js +418 -510
- package/dist/themes/motion-reduction.d.ts +107 -646
- package/dist/themes/motion-reduction.d.ts.map +1 -0
- package/dist/themes/motion-reduction.esm.js +434 -591
- package/dist/themes/motion-reduction.js +434 -591
- package/dist/themes/navigation.d.ts +163 -194
- package/dist/themes/navigation.d.ts.map +1 -0
- package/dist/themes/navigation.esm.js +1 -234
- package/dist/themes/navigation.js +1 -234
- package/dist/themes/screen-reader.d.ts +82 -641
- package/dist/themes/screen-reader.d.ts.map +1 -0
- package/dist/themes/screen-reader.esm.js +515 -616
- package/dist/themes/screen-reader.js +515 -616
- package/dist/themes/systemThemeDetector.d.ts +54 -144
- package/dist/themes/systemThemeDetector.d.ts.map +1 -0
- package/dist/themes/systemThemeDetector.esm.js +135 -164
- package/dist/themes/systemThemeDetector.js +135 -164
- package/dist/themes/themeCSSUpdater.d.ts +45 -228
- package/dist/themes/themeCSSUpdater.d.ts.map +1 -0
- package/dist/themes/themeCSSUpdater.esm.js +217 -252
- package/dist/themes/themeCSSUpdater.js +217 -252
- package/dist/themes/themePersistence.d.ts +80 -188
- package/dist/themes/themePersistence.d.ts.map +1 -0
- package/dist/themes/themePersistence.esm.js +181 -212
- package/dist/themes/themePersistence.js +181 -212
- package/dist/themes/themes/default.d.ts +9 -0
- package/dist/themes/themes/default.d.ts.map +1 -0
- package/dist/themes/themes/default.esm.js +584 -0
- package/dist/themes/themes/default.js +584 -0
- package/dist/themes/themes/harvey.d.ts +7 -0
- package/dist/themes/themes/harvey.d.ts.map +1 -0
- package/dist/themes/themes/harvey.esm.js +551 -0
- package/dist/themes/themes/harvey.js +551 -0
- package/dist/themes/themes/stan-design.d.ts +7 -678
- package/dist/themes/themes/stan-design.d.ts.map +1 -0
- package/dist/themes/themes/stan-design.esm.js +654 -658
- package/dist/themes/themes/stan-design.js +654 -658
- package/dist/themes/types.d.ts +330 -385
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.esm.js +1 -458
- package/dist/themes/types.js +1 -458
- package/dist/themes/useSystemTheme.d.ts +10 -42
- package/dist/themes/useSystemTheme.d.ts.map +1 -0
- package/dist/themes/useSystemTheme.esm.js +34 -42
- package/dist/themes/useSystemTheme.js +34 -42
- package/dist/themes/useTheme.d.ts +70 -20
- package/dist/themes/useTheme.d.ts.map +1 -0
- package/dist/themes/useTheme.esm.js +23 -28
- package/dist/themes/useTheme.js +23 -28
- package/dist/themes/validation.d.ts +70 -405
- package/dist/themes/validation.d.ts.map +1 -0
- package/dist/themes/validation.esm.js +380 -433
- package/dist/themes/validation.js +380 -433
- package/dist/tokens/index.d.ts +9 -23
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.esm.js +2 -13
- package/dist/tokens/index.js +2 -13
- package/dist/tokens/tokenExporter.d.ts +83 -335
- package/dist/tokens/tokenExporter.d.ts.map +1 -0
- package/dist/tokens/tokenExporter.esm.js +309 -373
- package/dist/tokens/tokenExporter.js +309 -373
- package/dist/tokens/tokenGenerator.d.ts +36 -249
- package/dist/tokens/tokenGenerator.d.ts.map +1 -0
- package/dist/tokens/tokenGenerator.esm.js +241 -273
- package/dist/tokens/tokenGenerator.js +241 -273
- package/dist/tokens/tokenManager.d.ts +87 -189
- package/dist/tokens/tokenManager.d.ts.map +1 -0
- package/dist/tokens/tokenManager.esm.js +187 -241
- package/dist/tokens/tokenManager.js +187 -241
- package/dist/tokens/tokenValidator.d.ts +84 -481
- package/dist/tokens/tokenValidator.d.ts.map +1 -0
- package/dist/tokens/tokenValidator.esm.js +402 -522
- package/dist/tokens/tokenValidator.js +402 -522
- package/dist/tokens/types.d.ts +40 -60
- package/dist/tokens/types.d.ts.map +1 -0
- package/dist/tokens/types.esm.js +1 -78
- package/dist/tokens/types.js +1 -78
- package/dist/types.d.ts +399 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.esm.js +3 -0
- package/dist/types.js +3 -0
- package/dist/utils/bundle-analyzer.d.ts +37 -254
- package/dist/utils/bundle-analyzer.d.ts.map +1 -0
- package/dist/utils/bundle-analyzer.esm.js +188 -246
- package/dist/utils/bundle-analyzer.js +188 -246
- package/dist/utils/bundle-splitting.d.ts +59 -471
- package/dist/utils/bundle-splitting.d.ts.map +1 -0
- package/dist/utils/bundle-splitting.esm.js +330 -458
- package/dist/utils/bundle-splitting.js +330 -458
- package/dist/utils/lazy-loading.d.ts +64 -429
- package/dist/utils/lazy-loading.d.ts.map +1 -0
- package/dist/utils/lazy-loading.esm.js +311 -417
- package/dist/utils/lazy-loading.js +311 -417
- package/dist/utils/performance-monitor.d.ts +72 -504
- package/dist/utils/performance-monitor.d.ts.map +1 -0
- package/dist/utils/performance-monitor.esm.js +369 -490
- package/dist/utils/performance-monitor.js +369 -490
- package/dist/utils/tree-shaking.d.ts +40 -267
- package/dist/utils/tree-shaking.d.ts.map +1 -0
- package/dist/utils/tree-shaking.esm.js +194 -264
- package/dist/utils/tree-shaking.js +194 -264
- package/package.json +18 -2
- package/src/index.ts +150 -149
- package/src/provider.tsx +3 -3
- package/src/theme.ts +1 -1
- package/src/themes/themes/default.ts +586 -0
- package/src/themes/themes/harvey.ts +554 -0
- package/src/types.ts +460 -0
|
@@ -1,653 +1,231 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
2
3
|
import { useTheme } from '../../../themes/useTheme';
|
|
3
|
-
import {
|
|
4
|
-
ChartProps,
|
|
5
|
-
ChartData
|
|
6
|
-
} from './types';
|
|
7
|
-
|
|
8
4
|
// Simple icon components (inline SVG)
|
|
9
|
-
const BarChartIcon
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fill="none"
|
|
13
|
-
stroke="currentColor"
|
|
14
|
-
viewBox="0 0 24 24"
|
|
15
|
-
>
|
|
16
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
|
|
17
|
-
</svg>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const LineChartIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (
|
|
21
|
-
<svg
|
|
22
|
-
className={className}
|
|
23
|
-
fill="none"
|
|
24
|
-
stroke="currentColor"
|
|
25
|
-
viewBox="0 0 24 24"
|
|
26
|
-
>
|
|
27
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 12l3-3 3 3 4-4" />
|
|
28
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 21l4-4 4-4 4-4" />
|
|
29
|
-
</svg>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const PieChartIcon: React.FC<{ className?: string }> = ({ className = 'w-4 h-4' }) => (
|
|
33
|
-
<svg
|
|
34
|
-
className={className}
|
|
35
|
-
fill="none"
|
|
36
|
-
stroke="currentColor"
|
|
37
|
-
viewBox="0 0 24 24"
|
|
38
|
-
>
|
|
39
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 2L12 12L22 12A10 10 0 0 0 12 2Z" />
|
|
40
|
-
<circle cx="12" cy="12" r="10" strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} />
|
|
41
|
-
</svg>
|
|
42
|
-
);
|
|
43
|
-
|
|
5
|
+
const BarChartIcon = ({ className = 'w-4 h-4' }) => (_jsx("svg", { className: className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }));
|
|
6
|
+
const LineChartIcon = ({ className = 'w-4 h-4' }) => (_jsxs("svg", { className: className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [_jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 12l3-3 3 3 4-4" }), _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 21l4-4 4-4 4-4" })] }));
|
|
7
|
+
const PieChartIcon = ({ className = 'w-4 h-4' }) => (_jsxs("svg", { className: className, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [_jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2L12 12L22 12A10 10 0 0 0 12 2Z" }), _jsx("circle", { cx: "12", cy: "12", r: "10", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2 })] }));
|
|
44
8
|
// Default color fallbacks for when theme is not available
|
|
45
9
|
const getDefaultColors = () => ({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
10
|
+
surface: {
|
|
11
|
+
background: '#ffffff',
|
|
12
|
+
surface: '#f3f4f6',
|
|
13
|
+
border: '#d1d5db',
|
|
14
|
+
divider: '#e5e7eb'
|
|
15
|
+
},
|
|
16
|
+
text: {
|
|
17
|
+
primary: '#111827',
|
|
18
|
+
secondary: '#6b7280',
|
|
19
|
+
muted: '#9ca3af',
|
|
20
|
+
inverse: '#ffffff',
|
|
21
|
+
onPrimary: '#ffffff',
|
|
22
|
+
onSecondary: '#ffffff',
|
|
23
|
+
onSurface: '#111827'
|
|
24
|
+
},
|
|
25
|
+
interactive: {
|
|
26
|
+
hover: '#f3f4f6',
|
|
27
|
+
active: '#e5e7eb',
|
|
28
|
+
focus: '#3b82f6',
|
|
29
|
+
disabled: '#d1d5db'
|
|
30
|
+
},
|
|
31
|
+
primary: { 500: '#3b82f6' },
|
|
32
|
+
semantic: {
|
|
33
|
+
success: '#10b981',
|
|
34
|
+
warning: '#f59e0b',
|
|
35
|
+
error: '#ef4444',
|
|
36
|
+
info: '#3b82f6'
|
|
37
|
+
}
|
|
74
38
|
});
|
|
75
|
-
|
|
76
39
|
// Chart color palette
|
|
77
|
-
const getChartColors = (colors
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
40
|
+
const getChartColors = (colors) => [
|
|
41
|
+
colors.primary[500],
|
|
42
|
+
colors.semantic.success,
|
|
43
|
+
colors.semantic.warning,
|
|
44
|
+
colors.semantic.error,
|
|
45
|
+
colors.semantic.info,
|
|
46
|
+
'#8b5cf6', // Purple
|
|
47
|
+
'#f97316', // Orange
|
|
48
|
+
'#06b6d4', // Cyan
|
|
49
|
+
'#84cc16', // Lime
|
|
50
|
+
'#ec4899', // Pink
|
|
88
51
|
];
|
|
89
|
-
|
|
90
52
|
// Chart Legend Component
|
|
91
|
-
const ChartLegend
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
md: 'chart__legend-color--md',
|
|
107
|
-
lg: 'chart__legend-color--lg'
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<div className={`chart__legend ${sizeClasses[size]}`}>
|
|
112
|
-
{datasets.map((dataset, index) => (
|
|
113
|
-
<div key={index} className="chart__legend-item">
|
|
114
|
-
<div
|
|
115
|
-
className={`chart__legend-color ${dotSizes[size]}`}
|
|
116
|
-
style={{
|
|
117
|
-
backgroundColor: dataset.color || chartColors[index % chartColors.length]
|
|
118
|
-
}}
|
|
119
|
-
/>
|
|
120
|
-
<span className="chart__legend-label">
|
|
121
|
-
{dataset.label}
|
|
122
|
-
</span>
|
|
123
|
-
</div>
|
|
124
|
-
))}
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
53
|
+
const ChartLegend = ({ datasets, colors, size }) => {
|
|
54
|
+
const chartColors = getChartColors(colors);
|
|
55
|
+
const sizeClasses = {
|
|
56
|
+
sm: 'chart__legend--sm',
|
|
57
|
+
md: 'chart__legend--md',
|
|
58
|
+
lg: 'chart__legend--lg'
|
|
59
|
+
};
|
|
60
|
+
const dotSizes = {
|
|
61
|
+
sm: 'chart__legend-color--sm',
|
|
62
|
+
md: 'chart__legend-color--md',
|
|
63
|
+
lg: 'chart__legend-color--lg'
|
|
64
|
+
};
|
|
65
|
+
return (_jsx("div", { className: `chart__legend ${sizeClasses[size]}`, children: datasets.map((dataset, index) => (_jsxs("div", { className: "chart__legend-item", children: [_jsx("div", { className: `chart__legend-color ${dotSizes[size]}`, style: {
|
|
66
|
+
backgroundColor: dataset.color || chartColors[index % chartColors.length]
|
|
67
|
+
} }), _jsx("span", { className: "chart__legend-label", children: dataset.label })] }, index))) }));
|
|
127
68
|
};
|
|
128
|
-
|
|
129
69
|
// Simple Bar Chart Component
|
|
130
|
-
const BarChart
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<svg width={width} height={height} style={{ background: colors.surface.background }}>
|
|
156
|
-
{/* Grid lines */}
|
|
157
|
-
{[0, 0.25, 0.5, 0.75, 1].map((percent, index) => {
|
|
158
|
-
const y = padding + chartHeight * (1 - percent);
|
|
159
|
-
return (
|
|
160
|
-
<g key={index}>
|
|
161
|
-
<line
|
|
162
|
-
x1={padding}
|
|
163
|
-
y1={y}
|
|
164
|
-
x2={padding + chartWidth}
|
|
165
|
-
y2={y}
|
|
166
|
-
stroke={colors.surface.border}
|
|
167
|
-
strokeWidth={1}
|
|
168
|
-
strokeDasharray={percent === 0 ? '0' : '2,2'}
|
|
169
|
-
/>
|
|
170
|
-
<text
|
|
171
|
-
x={padding - 10}
|
|
172
|
-
y={y + 4}
|
|
173
|
-
textAnchor="end"
|
|
174
|
-
fill={colors.text.muted}
|
|
175
|
-
fontSize="12"
|
|
176
|
-
>
|
|
177
|
-
{Math.round(maxValue * percent)}
|
|
178
|
-
</text>
|
|
179
|
-
</g>
|
|
180
|
-
);
|
|
181
|
-
})}
|
|
182
|
-
|
|
183
|
-
{/* Bars */}
|
|
184
|
-
{data.datasets.map((dataset, datasetIndex) => (
|
|
185
|
-
<g key={datasetIndex}>
|
|
186
|
-
{dataset.data.map((value, pointIndex) => {
|
|
187
|
-
const numericValue = typeof value === 'number' ? value : value.y;
|
|
188
|
-
const barHeight = (numericValue / maxValue) * chartHeight;
|
|
189
|
-
const x = padding + pointIndex * groupWidth + datasetIndex * barWidth;
|
|
190
|
-
const y = padding + chartHeight - barHeight;
|
|
191
|
-
const color = dataset.color || chartColors[datasetIndex % chartColors.length];
|
|
192
|
-
|
|
193
|
-
return (
|
|
194
|
-
<g key={pointIndex}>
|
|
195
|
-
<rect
|
|
196
|
-
x={x}
|
|
197
|
-
y={animate ? padding + chartHeight : y}
|
|
198
|
-
width={barWidth * 0.8}
|
|
199
|
-
height={animate ? 0 : barHeight}
|
|
200
|
-
fill={color}
|
|
201
|
-
rx={2}
|
|
202
|
-
>
|
|
203
|
-
{animate && (
|
|
204
|
-
<animate
|
|
205
|
-
attributeName="height"
|
|
206
|
-
from="0"
|
|
207
|
-
to={barHeight}
|
|
208
|
-
dur="0.8s"
|
|
209
|
-
begin={`${pointIndex * 0.1}s`}
|
|
210
|
-
fill="freeze"
|
|
211
|
-
/>
|
|
212
|
-
)}
|
|
213
|
-
{animate && (
|
|
214
|
-
<animate
|
|
215
|
-
attributeName="y"
|
|
216
|
-
from={padding + chartHeight}
|
|
217
|
-
to={y}
|
|
218
|
-
dur="0.8s"
|
|
219
|
-
begin={`${pointIndex * 0.1}s`}
|
|
220
|
-
fill="freeze"
|
|
221
|
-
/>
|
|
222
|
-
)}
|
|
223
|
-
</rect>
|
|
224
|
-
|
|
225
|
-
{/* Value labels */}
|
|
226
|
-
{showValues && (
|
|
227
|
-
<text
|
|
228
|
-
x={x + (barWidth * 0.8) / 2}
|
|
229
|
-
y={y - 5}
|
|
230
|
-
textAnchor="middle"
|
|
231
|
-
fill={colors.text.secondary}
|
|
232
|
-
fontSize="10"
|
|
233
|
-
>
|
|
234
|
-
{numericValue}
|
|
235
|
-
</text>
|
|
236
|
-
)}
|
|
237
|
-
</g>
|
|
238
|
-
);
|
|
239
|
-
})}
|
|
240
|
-
</g>
|
|
241
|
-
))}
|
|
242
|
-
|
|
243
|
-
{/* X-axis labels */}
|
|
244
|
-
{data.labels.map((label, index) => (
|
|
245
|
-
<text
|
|
246
|
-
key={index}
|
|
247
|
-
x={padding + index * groupWidth + groupWidth / 2}
|
|
248
|
-
y={height - padding + 20}
|
|
249
|
-
textAnchor="middle"
|
|
250
|
-
fill={colors.text.secondary}
|
|
251
|
-
fontSize="12"
|
|
252
|
-
>
|
|
253
|
-
{label}
|
|
254
|
-
</text>
|
|
255
|
-
))}
|
|
256
|
-
</svg>
|
|
257
|
-
);
|
|
70
|
+
const BarChart = ({ data, width, height, colors, showValues = false, animate = false }) => {
|
|
71
|
+
const chartColors = getChartColors(colors);
|
|
72
|
+
const padding = 60;
|
|
73
|
+
const chartWidth = width - padding * 2;
|
|
74
|
+
const chartHeight = height - padding * 2;
|
|
75
|
+
// Calculate max value for scaling
|
|
76
|
+
const maxValue = useMemo(() => {
|
|
77
|
+
const allValues = data.datasets.flatMap(dataset => dataset.data.map(point => typeof point === 'number' ? point : point.y));
|
|
78
|
+
return Math.max(...allValues, 0);
|
|
79
|
+
}, [data]);
|
|
80
|
+
const barWidth = chartWidth / (data.labels.length * data.datasets.length);
|
|
81
|
+
const groupWidth = chartWidth / data.labels.length;
|
|
82
|
+
return (_jsxs("svg", { width: width, height: height, style: { background: colors.surface.background }, children: [[0, 0.25, 0.5, 0.75, 1].map((percent, index) => {
|
|
83
|
+
const y = padding + chartHeight * (1 - percent);
|
|
84
|
+
return (_jsxs("g", { children: [_jsx("line", { x1: padding, y1: y, x2: padding + chartWidth, y2: y, stroke: colors.surface.border, strokeWidth: 1, strokeDasharray: percent === 0 ? '0' : '2,2' }), _jsx("text", { x: padding - 10, y: y + 4, textAnchor: "end", fill: colors.text.muted, fontSize: "12", children: Math.round(maxValue * percent) })] }, index));
|
|
85
|
+
}), data.datasets.map((dataset, datasetIndex) => (_jsx("g", { children: dataset.data.map((value, pointIndex) => {
|
|
86
|
+
const numericValue = typeof value === 'number' ? value : value.y;
|
|
87
|
+
const barHeight = (numericValue / maxValue) * chartHeight;
|
|
88
|
+
const x = padding + pointIndex * groupWidth + datasetIndex * barWidth;
|
|
89
|
+
const y = padding + chartHeight - barHeight;
|
|
90
|
+
const color = dataset.color || chartColors[datasetIndex % chartColors.length];
|
|
91
|
+
return (_jsxs("g", { children: [_jsxs("rect", { x: x, y: animate ? padding + chartHeight : y, width: barWidth * 0.8, height: animate ? 0 : barHeight, fill: color, rx: 2, children: [animate && (_jsx("animate", { attributeName: "height", from: "0", to: barHeight, dur: "0.8s", begin: `${pointIndex * 0.1}s`, fill: "freeze" })), animate && (_jsx("animate", { attributeName: "y", from: padding + chartHeight, to: y, dur: "0.8s", begin: `${pointIndex * 0.1}s`, fill: "freeze" }))] }), showValues && (_jsx("text", { x: x + (barWidth * 0.8) / 2, y: y - 5, textAnchor: "middle", fill: colors.text.secondary, fontSize: "10", children: numericValue }))] }, pointIndex));
|
|
92
|
+
}) }, datasetIndex))), data.labels.map((label, index) => (_jsx("text", { x: padding + index * groupWidth + groupWidth / 2, y: height - padding + 20, textAnchor: "middle", fill: colors.text.secondary, fontSize: "12", children: label }, index)))] }));
|
|
258
93
|
};
|
|
259
|
-
|
|
260
94
|
// Simple Line Chart Component
|
|
261
|
-
const LineChart
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<line
|
|
290
|
-
x1={padding}
|
|
291
|
-
y1={y}
|
|
292
|
-
x2={padding + chartWidth}
|
|
293
|
-
y2={y}
|
|
294
|
-
stroke={colors.surface.border}
|
|
295
|
-
strokeWidth={1}
|
|
296
|
-
strokeDasharray={percent === 0 ? '0' : '2,2'}
|
|
297
|
-
/>
|
|
298
|
-
<text
|
|
299
|
-
x={padding - 10}
|
|
300
|
-
y={y + 4}
|
|
301
|
-
textAnchor="end"
|
|
302
|
-
fill={colors.text.muted}
|
|
303
|
-
fontSize="12"
|
|
304
|
-
>
|
|
305
|
-
{Math.round(maxValue * percent)}
|
|
306
|
-
</text>
|
|
307
|
-
</g>
|
|
308
|
-
);
|
|
309
|
-
})}
|
|
310
|
-
|
|
311
|
-
{/* Lines and points */}
|
|
312
|
-
{data.datasets.map((dataset, datasetIndex) => {
|
|
313
|
-
const color = dataset.color || chartColors[datasetIndex % chartColors.length];
|
|
314
|
-
const points = dataset.data.map((value, index) => {
|
|
315
|
-
const numericValue = typeof value === 'number' ? value : value.y;
|
|
316
|
-
const x = padding + (index / (data.labels.length - 1)) * chartWidth;
|
|
317
|
-
const y = padding + chartHeight - (numericValue / maxValue) * chartHeight;
|
|
318
|
-
return { x, y, value: numericValue };
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
// Create path for line
|
|
322
|
-
const pathData = points.reduce((path, point, index) => {
|
|
323
|
-
const command = index === 0 ? 'M' : 'L';
|
|
324
|
-
return `${path} ${command} ${point.x} ${point.y}`;
|
|
325
|
-
}, '');
|
|
326
|
-
|
|
327
|
-
return (
|
|
328
|
-
<g key={datasetIndex}>
|
|
329
|
-
{/* Line */}
|
|
330
|
-
<path
|
|
331
|
-
d={pathData}
|
|
332
|
-
fill="none"
|
|
333
|
-
stroke={color}
|
|
334
|
-
strokeWidth={2}
|
|
335
|
-
strokeLinecap="round"
|
|
336
|
-
strokeLinejoin="round"
|
|
337
|
-
>
|
|
338
|
-
{animate && (
|
|
339
|
-
<animate
|
|
340
|
-
attributeName="stroke-dasharray"
|
|
341
|
-
from={`0 ${chartWidth * 2}`}
|
|
342
|
-
to={`${chartWidth * 2} 0`}
|
|
343
|
-
dur="1.5s"
|
|
344
|
-
fill="freeze"
|
|
345
|
-
/>
|
|
346
|
-
)}
|
|
347
|
-
</path>
|
|
348
|
-
|
|
349
|
-
{/* Points */}
|
|
350
|
-
{showPoints && points.map((point, pointIndex) => (
|
|
351
|
-
<circle
|
|
352
|
-
key={pointIndex}
|
|
353
|
-
cx={point.x}
|
|
354
|
-
cy={point.y}
|
|
355
|
-
r={4}
|
|
356
|
-
fill={color}
|
|
357
|
-
stroke={colors.surface.background}
|
|
358
|
-
strokeWidth={2}
|
|
359
|
-
>
|
|
360
|
-
{animate && (
|
|
361
|
-
<animate
|
|
362
|
-
attributeName="r"
|
|
363
|
-
from="0"
|
|
364
|
-
to="4"
|
|
365
|
-
dur="0.5s"
|
|
366
|
-
begin={`${1.5 + pointIndex * 0.1}s`}
|
|
367
|
-
fill="freeze"
|
|
368
|
-
/>
|
|
369
|
-
)}
|
|
370
|
-
</circle>
|
|
371
|
-
))}
|
|
372
|
-
</g>
|
|
373
|
-
);
|
|
374
|
-
})}
|
|
375
|
-
|
|
376
|
-
{/* X-axis labels */}
|
|
377
|
-
{data.labels.map((label, index) => (
|
|
378
|
-
<text
|
|
379
|
-
key={index}
|
|
380
|
-
x={padding + (index / (data.labels.length - 1)) * chartWidth}
|
|
381
|
-
y={height - padding + 20}
|
|
382
|
-
textAnchor="middle"
|
|
383
|
-
fill={colors.text.secondary}
|
|
384
|
-
fontSize="12"
|
|
385
|
-
>
|
|
386
|
-
{label}
|
|
387
|
-
</text>
|
|
388
|
-
))}
|
|
389
|
-
</svg>
|
|
390
|
-
);
|
|
95
|
+
const LineChart = ({ data, width, height, colors, showPoints = true, animate = false }) => {
|
|
96
|
+
const chartColors = getChartColors(colors);
|
|
97
|
+
const padding = 60;
|
|
98
|
+
const chartWidth = width - padding * 2;
|
|
99
|
+
const chartHeight = height - padding * 2;
|
|
100
|
+
// Calculate max value for scaling
|
|
101
|
+
const maxValue = useMemo(() => {
|
|
102
|
+
const allValues = data.datasets.flatMap(dataset => dataset.data.map(point => typeof point === 'number' ? point : point.y));
|
|
103
|
+
return Math.max(...allValues, 0);
|
|
104
|
+
}, [data]);
|
|
105
|
+
return (_jsxs("svg", { width: width, height: height, style: { background: colors.surface.background }, children: [[0, 0.25, 0.5, 0.75, 1].map((percent, index) => {
|
|
106
|
+
const y = padding + chartHeight * (1 - percent);
|
|
107
|
+
return (_jsxs("g", { children: [_jsx("line", { x1: padding, y1: y, x2: padding + chartWidth, y2: y, stroke: colors.surface.border, strokeWidth: 1, strokeDasharray: percent === 0 ? '0' : '2,2' }), _jsx("text", { x: padding - 10, y: y + 4, textAnchor: "end", fill: colors.text.muted, fontSize: "12", children: Math.round(maxValue * percent) })] }, index));
|
|
108
|
+
}), data.datasets.map((dataset, datasetIndex) => {
|
|
109
|
+
const color = dataset.color || chartColors[datasetIndex % chartColors.length];
|
|
110
|
+
const points = dataset.data.map((value, index) => {
|
|
111
|
+
const numericValue = typeof value === 'number' ? value : value.y;
|
|
112
|
+
const x = padding + (index / (data.labels.length - 1)) * chartWidth;
|
|
113
|
+
const y = padding + chartHeight - (numericValue / maxValue) * chartHeight;
|
|
114
|
+
return { x, y, value: numericValue };
|
|
115
|
+
});
|
|
116
|
+
// Create path for line
|
|
117
|
+
const pathData = points.reduce((path, point, index) => {
|
|
118
|
+
const command = index === 0 ? 'M' : 'L';
|
|
119
|
+
return `${path} ${command} ${point.x} ${point.y}`;
|
|
120
|
+
}, '');
|
|
121
|
+
return (_jsxs("g", { children: [_jsx("path", { d: pathData, fill: "none", stroke: color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: animate && (_jsx("animate", { attributeName: "stroke-dasharray", from: `0 ${chartWidth * 2}`, to: `${chartWidth * 2} 0`, dur: "1.5s", fill: "freeze" })) }), showPoints && points.map((point, pointIndex) => (_jsx("circle", { cx: point.x, cy: point.y, r: 4, fill: color, stroke: colors.surface.background, strokeWidth: 2, children: animate && (_jsx("animate", { attributeName: "r", from: "0", to: "4", dur: "0.5s", begin: `${1.5 + pointIndex * 0.1}s`, fill: "freeze" })) }, pointIndex)))] }, datasetIndex));
|
|
122
|
+
}), data.labels.map((label, index) => (_jsx("text", { x: padding + (index / (data.labels.length - 1)) * chartWidth, y: height - padding + 20, textAnchor: "middle", fill: colors.text.secondary, fontSize: "12", children: label }, index)))] }));
|
|
391
123
|
};
|
|
392
|
-
|
|
393
124
|
// Simple Pie Chart Component
|
|
394
|
-
const PieChart
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
const labelY = centerY + (radius * 0.7) * Math.sin(labelAngle);
|
|
433
|
-
|
|
434
|
-
return {
|
|
435
|
-
pathData,
|
|
436
|
-
color: chartColors[index % chartColors.length],
|
|
437
|
-
label: data.labels[index],
|
|
438
|
-
value,
|
|
439
|
-
percentage: Math.round(percentage * 100),
|
|
440
|
-
labelX,
|
|
441
|
-
labelY
|
|
442
|
-
};
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
return (
|
|
446
|
-
<svg width={width} height={height} style={{ background: colors.surface.background }}>
|
|
447
|
-
{segments.map((segment, index) => (
|
|
448
|
-
<g key={index}>
|
|
449
|
-
{/* Pie segment */}
|
|
450
|
-
<path
|
|
451
|
-
d={segment.pathData}
|
|
452
|
-
fill={segment.color}
|
|
453
|
-
stroke={colors.surface.background}
|
|
454
|
-
strokeWidth={2}
|
|
455
|
-
>
|
|
456
|
-
{animate && (
|
|
457
|
-
<animate
|
|
458
|
-
attributeName="opacity"
|
|
459
|
-
from="0"
|
|
460
|
-
to="1"
|
|
461
|
-
dur="0.5s"
|
|
462
|
-
begin={`${index * 0.2}s`}
|
|
463
|
-
fill="freeze"
|
|
464
|
-
/>
|
|
465
|
-
)}
|
|
466
|
-
</path>
|
|
467
|
-
|
|
468
|
-
{/* Labels */}
|
|
469
|
-
{showLabels && segment.percentage > 5 && (
|
|
470
|
-
<text
|
|
471
|
-
x={segment.labelX}
|
|
472
|
-
y={segment.labelY}
|
|
473
|
-
textAnchor="middle"
|
|
474
|
-
fill={colors.text.onPrimary}
|
|
475
|
-
fontSize="12"
|
|
476
|
-
fontWeight="bold"
|
|
477
|
-
>
|
|
478
|
-
{segment.percentage}%
|
|
479
|
-
</text>
|
|
480
|
-
)}
|
|
481
|
-
</g>
|
|
482
|
-
))}
|
|
483
|
-
|
|
484
|
-
{/* Center circle for doughnut effect */}
|
|
485
|
-
<circle
|
|
486
|
-
cx={centerX}
|
|
487
|
-
cy={centerY}
|
|
488
|
-
r={radius * 0.4}
|
|
489
|
-
fill={colors.surface.background}
|
|
490
|
-
stroke={colors.surface.border}
|
|
491
|
-
strokeWidth={1}
|
|
492
|
-
/>
|
|
493
|
-
</svg>
|
|
494
|
-
);
|
|
125
|
+
const PieChart = ({ data, width, height, colors, showLabels = true, animate = false }) => {
|
|
126
|
+
const chartColors = getChartColors(colors);
|
|
127
|
+
const centerX = width / 2;
|
|
128
|
+
const centerY = height / 2;
|
|
129
|
+
const radius = Math.min(width, height) / 2 - 40;
|
|
130
|
+
// Calculate total value and angles
|
|
131
|
+
const dataset = data.datasets[0];
|
|
132
|
+
const values = dataset?.data.map(point => typeof point === 'number' ? point : point.y) || [];
|
|
133
|
+
const total = values.reduce((sum, value) => sum + value, 0);
|
|
134
|
+
let currentAngle = -Math.PI / 2; // Start at top
|
|
135
|
+
const segments = values.map((value, index) => {
|
|
136
|
+
const percentage = value / total;
|
|
137
|
+
const angle = percentage * 2 * Math.PI;
|
|
138
|
+
const startAngle = currentAngle;
|
|
139
|
+
const endAngle = currentAngle + angle;
|
|
140
|
+
currentAngle += angle;
|
|
141
|
+
// Calculate arc path
|
|
142
|
+
const x1 = centerX + radius * Math.cos(startAngle);
|
|
143
|
+
const y1 = centerY + radius * Math.sin(startAngle);
|
|
144
|
+
const x2 = centerX + radius * Math.cos(endAngle);
|
|
145
|
+
const y2 = centerY + radius * Math.sin(endAngle);
|
|
146
|
+
const largeArc = angle > Math.PI ? 1 : 0;
|
|
147
|
+
const pathData = `M ${centerX} ${centerY} L ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2} Z`;
|
|
148
|
+
// Label position
|
|
149
|
+
const labelAngle = startAngle + angle / 2;
|
|
150
|
+
const labelX = centerX + (radius * 0.7) * Math.cos(labelAngle);
|
|
151
|
+
const labelY = centerY + (radius * 0.7) * Math.sin(labelAngle);
|
|
152
|
+
return {
|
|
153
|
+
pathData,
|
|
154
|
+
color: chartColors[index % chartColors.length],
|
|
155
|
+
label: data.labels[index],
|
|
156
|
+
value,
|
|
157
|
+
percentage: Math.round(percentage * 100),
|
|
158
|
+
labelX,
|
|
159
|
+
labelY
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
return (_jsxs("svg", { width: width, height: height, style: { background: colors.surface.background }, children: [segments.map((segment, index) => (_jsxs("g", { children: [_jsx("path", { d: segment.pathData, fill: segment.color, stroke: colors.surface.background, strokeWidth: 2, children: animate && (_jsx("animate", { attributeName: "opacity", from: "0", to: "1", dur: "0.5s", begin: `${index * 0.2}s`, fill: "freeze" })) }), showLabels && segment.percentage > 5 && (_jsxs("text", { x: segment.labelX, y: segment.labelY, textAnchor: "middle", fill: colors.text.onPrimary, fontSize: "12", fontWeight: "bold", children: [segment.percentage, "%"] }))] }, index))), _jsx("circle", { cx: centerX, cy: centerY, r: radius * 0.4, fill: colors.surface.background, stroke: colors.surface.border, strokeWidth: 1 })] }));
|
|
495
163
|
};
|
|
496
|
-
|
|
497
164
|
// Main Chart Component
|
|
498
|
-
export const Chart
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
// For responsive width, we'll use a default and let CSS handle it
|
|
529
|
-
return {
|
|
530
|
-
width: 600,
|
|
531
|
-
height: typeof height === 'number' ? height : 400
|
|
165
|
+
export const Chart = ({ type = 'bar', data, options = {}, height = 400, width = '100%', showLegend = true, showValues = false, animate = true, loading = false, error = null, emptyMessage = 'No data available', className = '', theme = 'stan-design', size = 'md', variant = 'default' }) => {
|
|
166
|
+
const { getTheme } = useTheme();
|
|
167
|
+
const themeConfig = getTheme(theme);
|
|
168
|
+
const colors = themeConfig?.colors || getDefaultColors();
|
|
169
|
+
const containerRef = useRef(null);
|
|
170
|
+
// Calculate responsive dimensions
|
|
171
|
+
const dimensions = useMemo(() => {
|
|
172
|
+
if (typeof width === 'number') {
|
|
173
|
+
return { width, height: typeof height === 'number' ? height : 400 };
|
|
174
|
+
}
|
|
175
|
+
// For responsive width, we'll use a default and let CSS handle it
|
|
176
|
+
return {
|
|
177
|
+
width: 600,
|
|
178
|
+
height: typeof height === 'number' ? height : 400
|
|
179
|
+
};
|
|
180
|
+
}, [width, height]);
|
|
181
|
+
// Chart type icon
|
|
182
|
+
const getChartIcon = () => {
|
|
183
|
+
switch (type) {
|
|
184
|
+
case 'line':
|
|
185
|
+
case 'area':
|
|
186
|
+
return _jsx(LineChartIcon, { className: "chart__icon" });
|
|
187
|
+
case 'pie':
|
|
188
|
+
case 'doughnut':
|
|
189
|
+
return _jsx(PieChartIcon, { className: "chart__icon" });
|
|
190
|
+
case 'bar':
|
|
191
|
+
default:
|
|
192
|
+
return _jsx(BarChartIcon, { className: "chart__icon" });
|
|
193
|
+
}
|
|
532
194
|
};
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
width: dimensions.width,
|
|
555
|
-
height: dimensions.height,
|
|
556
|
-
colors,
|
|
557
|
-
animate,
|
|
558
|
-
...options
|
|
195
|
+
// Render appropriate chart component
|
|
196
|
+
const renderChart = () => {
|
|
197
|
+
const chartProps = {
|
|
198
|
+
data,
|
|
199
|
+
width: dimensions.width,
|
|
200
|
+
height: dimensions.height,
|
|
201
|
+
colors,
|
|
202
|
+
animate,
|
|
203
|
+
...options
|
|
204
|
+
};
|
|
205
|
+
switch (type) {
|
|
206
|
+
case 'line':
|
|
207
|
+
case 'area':
|
|
208
|
+
return _jsx(LineChart, { ...chartProps, showPoints: options.showPoints });
|
|
209
|
+
case 'pie':
|
|
210
|
+
case 'doughnut':
|
|
211
|
+
return _jsx(PieChart, { ...chartProps, showLabels: options.showLabels });
|
|
212
|
+
case 'bar':
|
|
213
|
+
default:
|
|
214
|
+
return _jsx(BarChart, { ...chartProps, showValues: showValues });
|
|
215
|
+
}
|
|
559
216
|
};
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
return
|
|
568
|
-
case 'bar':
|
|
569
|
-
default:
|
|
570
|
-
return <BarChart {...chartProps} showValues={showValues} />;
|
|
217
|
+
if (loading) {
|
|
218
|
+
return (_jsxs("div", { className: `chart__loading chart__container--${size} chart__container--${variant} ${className}`, children: [_jsx("div", { className: "chart__loading-spinner" }), _jsx("span", { children: "Loading chart..." })] }));
|
|
219
|
+
}
|
|
220
|
+
if (error) {
|
|
221
|
+
return (_jsx("div", { className: `chart__error chart__container--${size} chart__container--${variant} ${className}`, children: _jsxs("div", { className: "chart__error-content", children: [_jsxs("div", { className: "chart__error-header", children: [getChartIcon(), _jsx("span", { children: "Chart Error" })] }), _jsx("p", { children: error })] }) }));
|
|
222
|
+
}
|
|
223
|
+
if (!data.datasets.length || !data.labels.length) {
|
|
224
|
+
return (_jsx("div", { className: `chart__empty chart__container--${size} chart__container--${variant} ${className}`, children: _jsxs("div", { className: "chart__empty-content", children: [_jsx("div", { className: "chart__empty-icon", children: getChartIcon() }), _jsx("span", { children: "No Data" }), _jsx("p", { children: emptyMessage })] }) }));
|
|
571
225
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
<div className={`chart__loading chart__container--${size} chart__container--${variant} ${className}`}>
|
|
577
|
-
<div className="chart__loading-spinner"></div>
|
|
578
|
-
<span>Loading chart...</span>
|
|
579
|
-
</div>
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
if (error) {
|
|
584
|
-
return (
|
|
585
|
-
<div className={`chart__error chart__container--${size} chart__container--${variant} ${className}`}>
|
|
586
|
-
<div className="chart__error-content">
|
|
587
|
-
<div className="chart__error-header">
|
|
588
|
-
{getChartIcon()}
|
|
589
|
-
<span>Chart Error</span>
|
|
590
|
-
</div>
|
|
591
|
-
<p>{error}</p>
|
|
592
|
-
</div>
|
|
593
|
-
</div>
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
if (!data.datasets.length || !data.labels.length) {
|
|
598
|
-
return (
|
|
599
|
-
<div className={`chart__empty chart__container--${size} chart__container--${variant} ${className}`}>
|
|
600
|
-
<div className="chart__empty-content">
|
|
601
|
-
<div className="chart__empty-icon">
|
|
602
|
-
{getChartIcon()}
|
|
603
|
-
</div>
|
|
604
|
-
<span>No Data</span>
|
|
605
|
-
<p>{emptyMessage}</p>
|
|
606
|
-
</div>
|
|
607
|
-
</div>
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
return (
|
|
612
|
-
<div
|
|
613
|
-
ref={containerRef}
|
|
614
|
-
className={`chart__container ${className || ''}`}
|
|
615
|
-
>
|
|
616
|
-
{/* Chart Title */}
|
|
617
|
-
{options.title && (
|
|
618
|
-
<div className="chart__header">
|
|
619
|
-
<h3 className="chart__title">
|
|
620
|
-
{options.title}
|
|
621
|
-
</h3>
|
|
622
|
-
{options.subtitle && (
|
|
623
|
-
<p className="chart__subtitle">
|
|
624
|
-
{options.subtitle}
|
|
625
|
-
</p>
|
|
626
|
-
)}
|
|
627
|
-
</div>
|
|
628
|
-
)}
|
|
629
|
-
|
|
630
|
-
{/* Chart Container */}
|
|
631
|
-
<div
|
|
632
|
-
className="chart__canvas"
|
|
633
|
-
style={{
|
|
634
|
-
width: typeof width === 'string' ? width : `${width}px`,
|
|
635
|
-
maxWidth: '100%'
|
|
636
|
-
}}
|
|
637
|
-
>
|
|
638
|
-
{renderChart()}
|
|
639
|
-
</div>
|
|
640
|
-
|
|
641
|
-
{/* Legend */}
|
|
642
|
-
{showLegend && data.datasets.length > 1 && (
|
|
643
|
-
<ChartLegend
|
|
644
|
-
datasets={data.datasets}
|
|
645
|
-
colors={colors}
|
|
646
|
-
size={size}
|
|
647
|
-
/>
|
|
648
|
-
)}
|
|
649
|
-
</div>
|
|
650
|
-
);
|
|
226
|
+
return (_jsxs("div", { ref: containerRef, className: `chart__container ${className || ''}`, children: [options.title && (_jsxs("div", { className: "chart__header", children: [_jsx("h3", { className: "chart__title", children: options.title }), options.subtitle && (_jsx("p", { className: "chart__subtitle", children: options.subtitle }))] })), _jsx("div", { className: "chart__canvas", style: {
|
|
227
|
+
width: typeof width === 'string' ? width : `${width}px`,
|
|
228
|
+
maxWidth: '100%'
|
|
229
|
+
}, children: renderChart() }), showLegend && data.datasets.length > 1 && (_jsx(ChartLegend, { datasets: data.datasets, colors: colors, size: size }))] }));
|
|
651
230
|
};
|
|
652
|
-
|
|
653
231
|
export default Chart;
|