@shohojdhara/atomix 0.6.5 → 0.6.6

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 (39) hide show
  1. package/dist/atomix.css +2 -2
  2. package/dist/atomix.css.map +1 -1
  3. package/dist/atomix.min.css +1 -1
  4. package/dist/atomix.min.css.map +1 -1
  5. package/dist/atomix.umd.js +1 -1
  6. package/dist/atomix.umd.js.map +1 -1
  7. package/dist/atomix.umd.min.js +1 -1
  8. package/dist/charts.js +65 -255
  9. package/dist/charts.js.map +1 -1
  10. package/dist/core.js +65 -255
  11. package/dist/core.js.map +1 -1
  12. package/dist/forms.js +65 -255
  13. package/dist/forms.js.map +1 -1
  14. package/dist/heavy.js +65 -255
  15. package/dist/heavy.js.map +1 -1
  16. package/dist/index.d.ts +6 -37
  17. package/dist/index.esm.js +66 -300
  18. package/dist/index.esm.js.map +1 -1
  19. package/dist/index.js +66 -300
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.min.js +1 -1
  22. package/dist/index.min.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/components/AtomixGlass/AtomixGlass.tsx +0 -9
  25. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +0 -2
  26. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +1 -1
  27. package/src/components/AtomixGlass/glass-utils.ts +82 -53
  28. package/src/components/AtomixGlass/shader-utils.ts +19 -77
  29. package/src/components/Form/Select.test.tsx +6 -6
  30. package/src/components/Form/Textarea.stories.tsx +5 -5
  31. package/src/lib/composables/useAtomixGlass.ts +2 -134
  32. package/src/lib/composables/useAtomixGlassStyles.ts +3 -3
  33. package/src/lib/composables/usePerformanceMonitor.ts +0 -66
  34. package/src/lib/constants/components.ts +6 -1
  35. package/src/styles/01-settings/_settings.atomix-glass.scss +2 -2
  36. package/src/styles/02-tools/_tools.button.scss +51 -42
  37. package/src/styles/06-components/_components.atomix-glass.scss +2 -2
  38. package/src/components/AtomixGlass/PerformanceDashboard.tsx +0 -171
  39. package/src/components/AtomixGlass/animation-system.ts +0 -578
@@ -385,69 +385,3 @@ export function usePerformanceMonitor(
385
385
  toggleMonitoring,
386
386
  };
387
387
  }
388
-
389
- /**
390
- * Debug Overlay Component (Optional)
391
- *
392
- * Shows real-time performance metrics on screen.
393
- * Only rendered when showOverlay is enabled.
394
- */
395
- export function PerformanceOverlay({ metrics }: { metrics: PerformanceMetrics }) {
396
- if (typeof window === 'undefined') return null;
397
-
398
- const overlayStyle: React.CSSProperties = {
399
- position: 'fixed',
400
- top: '10px',
401
- right: '10px',
402
- padding: '10px',
403
- backgroundColor: 'rgba(0, 0, 0, 0.8)',
404
- color: '#fff',
405
- fontFamily: 'monospace',
406
- fontSize: '12px',
407
- borderRadius: '4px',
408
- zIndex: 9999,
409
- pointerEvents: 'none',
410
- minWidth: '150px',
411
- };
412
-
413
- const getFpsColor = (fps: number) => {
414
- if (fps >= 58) return '#4ade80'; // Green
415
- if (fps >= 45) return '#fbbf24'; // Yellow
416
- return '#ef4444'; // Red
417
- };
418
-
419
- // Performance overlay removed - will be implemented as separate component
420
- return null;
421
- }
422
-
423
- /**
424
- * Utility to get quality multipliers for glass parameters
425
- */
426
- export function getQualityMultipliers(quality: 'low' | 'medium' | 'high') {
427
- switch (quality) {
428
- case 'low':
429
- return {
430
- distortionOctaves: 2,
431
- displacementScale: 0.6,
432
- blurAmount: 0.7,
433
- animationSpeed: 0.8,
434
- chromaticIntensity: 0.5,
435
- };
436
- case 'medium':
437
- return {
438
- distortionOctaves: 4,
439
- displacementScale: 0.85,
440
- blurAmount: 0.9,
441
- animationSpeed: 0.95,
442
- chromaticIntensity: 0.75,
443
- };
444
- case 'high':
445
- return {
446
- distortionOctaves: 5,
447
- displacementScale: 1.0,
448
- blurAmount: 1.0,
449
- animationSpeed: 1.0,
450
- chromaticIntensity: 1.0,
451
- };
452
- }
453
- }
@@ -2015,6 +2015,11 @@ export const ATOMIX_GLASS = {
2015
2015
  MIN_BLUR: 0.1,
2016
2016
  MOUSE_INFLUENCE_DIVISOR: 100,
2017
2017
  EDGE_FADE_PIXELS: 2,
2018
+ // Interaction intensity multipliers shared by the hook and the imperative style updater
2019
+ INTERACTION: {
2020
+ HOVER_INTENSITY: 1.4,
2021
+ ACTIVE_INTENSITY: 1.6,
2022
+ },
2018
2023
  // Elasticity physics constants — Apple-tuned: soft springs, fast settling, minimal stretch
2019
2024
  ELASTICITY_TRANSLATION_FACTOR: 0.06, // Subtler elastic shift (was 0.1)
2020
2025
  ELASTICITY_DISTANCE_THRESHOLD: 200,
@@ -2131,7 +2136,7 @@ export const ATOMIX_GLASS = {
2131
2136
  // Container shadows — hairline inner catch + soft floating lift (Apple player bar)
2132
2137
  CONTAINER_SHADOW: {
2133
2138
  LIGHT:
2134
- 'inset 0 0.5px 0 rgba(255, 255, 255, 0.32), inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.16)',
2139
+ 'inset 0 0.5px 0 rgba(255, 255, 255, 0.32), inset 0 1px 2px rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08)',
2135
2140
  },
2136
2141
 
2137
2142
  // Phase 1: Animation System Constants
@@ -29,8 +29,8 @@ $glass-border-1-opacity: 0.08 !default;
29
29
 
30
30
  // Rim shadow tokens (inset hairline + inner catch + outer lift)
31
31
  $glass-border-color: rgba(255, 255, 255, 0.28) !default;
32
- $glass-inner-shadow-color: rgba(255, 255, 255, 0.30) !default;
33
- $glass-outer-shadow-color: rgba(0, 0, 0, 0.18) !default;
32
+ $glass-inner-shadow-color: rgba(255, 255, 255, 0.20) !default;
33
+ $glass-outer-shadow-color: rgba(0, 0, 0, 0.08) !default;
34
34
 
35
35
  // Border-only backdrop (ring sampling)
36
36
  $glass-border-backdrop-blur: 40px !default;
@@ -65,54 +65,63 @@
65
65
  $active-border: null
66
66
  ) {
67
67
  $btn-color: var(--#{config.$prefix}#{$color}, #{map.get(tokens.$theme-colors, $color)});
68
- $btn-hover-color: if(
69
- $color-hover,
70
- var(--#{config.$prefix}#{$color-hover}, #{map.get(tokens.$theme-colors, $color-hover)}),
71
- var(--#{config.$prefix}white, #{colors.$white})
68
+ $btn-hover-color: var(--#{config.$prefix}white, #{colors.$white});
69
+ $btn-hover-bg: var(
70
+ --#{config.$prefix}#{$color}-hover,
71
+ #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -15%)}
72
72
  );
73
- $btn-hover-bg: if(
74
- $hover-background,
75
- var(
76
- --#{config.$prefix}#{$hover-background},
77
- #{map.get(tokens.$theme-colors, $hover-background)}
78
- ),
79
- var(
80
- --#{config.$prefix}#{$color}-hover,
81
- #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -15%)}
82
- )
73
+ $btn-hover-border: var(
74
+ --#{config.$prefix}#{$color}-hover,
75
+ #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -10%)}
83
76
  );
84
- $btn-hover-border: if(
85
- $hover-border,
86
- var(--#{config.$prefix}#{$hover-border}, #{map.get(tokens.$theme-colors, $hover-border)}),
87
- var(
88
- --#{config.$prefix}#{$color}-hover,
89
- #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -10%)}
90
- )
77
+ $btn-active-color: var(--#{config.$prefix}white, #{colors.$white});
78
+ $btn-active-bg: var(
79
+ --#{config.$prefix}#{$color}-hover,
80
+ #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -20%)}
91
81
  );
92
- $btn-active-color: if(
93
- $color-hover,
94
- var(--#{config.$prefix}#{$color-hover}, #{map.get(tokens.$theme-colors, $color-hover)}),
95
- var(--#{config.$prefix}white, #{colors.$white})
82
+ $btn-active-border: var(
83
+ --#{config.$prefix}#{$color}-hover,
84
+ #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -25%)}
96
85
  );
97
- $btn-active-bg: if(
98
- $active-background,
99
- var(
86
+
87
+ @if $color-hover {
88
+ $btn-hover-color: var(
89
+ --#{config.$prefix}#{$color-hover},
90
+ #{map.get(tokens.$theme-colors, $color-hover)}
91
+ );
92
+ $btn-active-color: var(
93
+ --#{config.$prefix}#{$color-hover},
94
+ #{map.get(tokens.$theme-colors, $color-hover)}
95
+ );
96
+ }
97
+
98
+ @if $hover-background {
99
+ $btn-hover-bg: var(
100
+ --#{config.$prefix}#{$hover-background},
101
+ #{map.get(tokens.$theme-colors, $hover-background)}
102
+ );
103
+ }
104
+
105
+ @if $hover-border {
106
+ $btn-hover-border: var(
107
+ --#{config.$prefix}#{$hover-border},
108
+ #{map.get(tokens.$theme-colors, $hover-border)}
109
+ );
110
+ }
111
+
112
+ @if $active-background {
113
+ $btn-active-bg: var(
100
114
  --#{config.$prefix}#{$active-background},
101
115
  #{map.get(tokens.$theme-colors, $active-background)}
102
- ),
103
- var(
104
- --#{config.$prefix}#{$color}-hover,
105
- #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -20%)}
106
- )
107
- );
108
- $btn-active-border: if(
109
- $active-border,
110
- var(--#{config.$prefix}#{$active-border}, #{map.get(tokens.$theme-colors, $active-border)}),
111
- var(
112
- --#{config.$prefix}#{$color}-hover,
113
- #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -25%)}
114
- )
115
- );
116
+ );
117
+ }
118
+
119
+ @if $active-border {
120
+ $btn-active-border: var(
121
+ --#{config.$prefix}#{$active-border},
122
+ #{map.get(tokens.$theme-colors, $active-border)}
123
+ );
124
+ }
116
125
 
117
126
  --#{config.$prefix}btn-color: #{$btn-color};
118
127
  --#{config.$prefix}btn-bg: transparent;
@@ -76,8 +76,8 @@
76
76
 
77
77
  --atomix-glass-border-shadow:
78
78
  0 0 0 0.5px var(--atomix-glass-border-color, #{$glass-border-color}) inset,
79
- 0 1px 2px var(--atomix-glass-inner-shadow-color, #{$glass-inner-shadow-color}) inset,
80
- 0 2px 6px var(--atomix-glass-outer-shadow-color, #{$glass-outer-shadow-color});
79
+ 0 1px 1px var(--atomix-glass-inner-shadow-color, #{$glass-inner-shadow-color}) inset,
80
+ 0 1px 3px var(--atomix-glass-outer-shadow-color, #{$glass-outer-shadow-color});
81
81
 
82
82
  // ── Over-light decorative layers (base, overlay) ─────────────────────────
83
83
  // These use var-based positioning so they correctly follow the container in
@@ -1,171 +0,0 @@
1
- import React, { memo } from 'react';
2
- import type { PerformanceMetrics } from '../../lib/composables/usePerformanceMonitor';
3
-
4
- interface PerformanceDashboardProps {
5
- metrics: PerformanceMetrics;
6
- isVisible?: boolean;
7
- onClose?: () => void;
8
- }
9
-
10
- /** Map an FPS value to a semantic color token string. */
11
- const getFpsColor = (fps: number): string => {
12
- if (fps >= 58) return 'var(--atomix-color-success, #4ade80)';
13
- if (fps >= 45) return 'var(--atomix-color-warning, #fbbf24)';
14
- return 'var(--atomix-color-danger, #ef4444)';
15
- };
16
-
17
- /** Map a quality level string to a semantic color token string. */
18
- const getQualityColor = (quality: string): string => {
19
- switch (quality) {
20
- case 'high': return 'var(--atomix-color-success, #4ade80)';
21
- case 'medium': return 'var(--atomix-color-warning, #fbbf24)';
22
- case 'low': return 'var(--atomix-color-danger, #ef4444)';
23
- default: return '#9ca3af';
24
- }
25
- };
26
-
27
- const getFpsLabel = (fps: number): string => {
28
- if (fps >= 58) return 'Optimal';
29
- if (fps >= 45) return 'Warning';
30
- return 'Critical';
31
- };
32
-
33
- // Keyframes for pulse animation (injected via style tag)
34
- const keyframesStyle = `
35
- @keyframes perf-dashboard-pulse {
36
- 0%, 100% { opacity: 1; }
37
- 50% { opacity: 0.5; }
38
- }
39
- `;
40
-
41
- // Inject keyframes once
42
- if (typeof document !== 'undefined') {
43
- const styleId = 'perf-dashboard-keyframes';
44
- if (!document.getElementById(styleId)) {
45
- const styleEl = document.createElement('style');
46
- styleEl.id = styleId;
47
- styleEl.textContent = keyframesStyle;
48
- document.head.appendChild(styleEl);
49
- }
50
- }
51
-
52
- /**
53
- * PerformanceDashboard - Real-time performance monitoring overlay.
54
- *
55
- * Displays FPS, frame time, quality level, GPU memory, and auto-scaling status.
56
- * Rendered only when `debugPerformance={true}` on the parent `AtomixGlass`.
57
- */
58
- export const PerformanceDashboard: React.FC<PerformanceDashboardProps> = memo(
59
- ({ metrics, isVisible = true, onClose }) => {
60
- if (!isVisible) return null;
61
-
62
- const fpsColor = getFpsColor(metrics.fps);
63
- const isCritical = metrics.fps < 45;
64
-
65
- return (
66
- <div
67
- className="c-perf-dashboard u-position-fixed u-top-4 u-end-4 u-p-3 u-px-4 u-text-xs u-font-mono u-text-white u-rounded-md u-border u-border-white-alpha-10 u-shadow-lg"
68
- style={{
69
- zIndex: 9999,
70
- minWidth: '12.5rem', // 200px
71
- backgroundColor: 'rgba(17, 24, 39, 0.95)',
72
- backdropFilter: 'blur(8px)',
73
- transition: 'opacity 0.3s ease',
74
- }}
75
- >
76
- {/* Header */}
77
- <div className="u-flex u-items-center u-justify-between u-mb-2 u-pb-2 u-border-b u-border-white-alpha-10">
78
- <span className="u-text-sm u-font-bold u-text-white">Performance Monitor</span>
79
- {onClose && (
80
- <button
81
- className="u-bg-transparent u-border-none u-p-0 u-line-height-1 u-text-base u-text-gray-400 u-cursor-pointer hover:u-text-white"
82
- onClick={onClose}
83
- aria-label="Close performance dashboard"
84
- style={{ transition: 'color 0.2s ease' }}
85
- >
86
- ×
87
- </button>
88
- )}
89
- </div>
90
-
91
- {/* FPS */}
92
- <div className="u-flex u-items-center u-justify-between u-mb-1-5">
93
- <span className="u-text-gray-400 u-me-3">FPS</span>
94
- <span className="u-font-bold" style={{ color: fpsColor }}>
95
- {Math.round(metrics.fps)}
96
- </span>
97
- </div>
98
-
99
- {/* Frame Time */}
100
- <div className="u-flex u-items-center u-justify-between u-mb-1-5">
101
- <span className="u-text-gray-400 u-me-3">Frame Time</span>
102
- <span className="u-font-bold">
103
- {metrics.frameTime.toFixed(2)}ms
104
- </span>
105
- </div>
106
-
107
- {/* Quality Level */}
108
- <div className="u-flex u-items-center u-justify-between u-mb-1-5">
109
- <span className="u-text-gray-400 u-me-3">Quality</span>
110
- <span
111
- className="u-font-bold u-text-uppercase"
112
- style={{
113
- fontSize: '0.6875rem', // 11px
114
- color: getQualityColor(metrics.qualityLevel)
115
- }}
116
- >
117
- {metrics.qualityLevel}
118
- </span>
119
- </div>
120
-
121
- {/* GPU Memory (if available) */}
122
- {metrics.gpuMemory && (
123
- <div className="u-flex u-items-center u-justify-between u-mb-1-5">
124
- <span className="u-text-gray-400 u-me-3">GPU Memory</span>
125
- <span className="u-font-bold">
126
- ~{Math.round(metrics.gpuMemory / 1024)}MB
127
- </span>
128
- </div>
129
- )}
130
-
131
- {/* Auto-scaling notice */}
132
- {metrics.isAutoScaling && (
133
- <div
134
- className="u-mt-2 u-pt-2 u-border-t u-border-white-alpha-10 u-text-center"
135
- style={{
136
- fontSize: '0.625rem', // 10px
137
- color: '#6b7280',
138
- }}
139
- >
140
- Auto-scaling active
141
- </div>
142
- )}
143
-
144
- {/* Status indicator */}
145
- <div className="u-flex u-items-center u-gap-2 u-mt-2 u-pt-2 u-border-t u-border-white-alpha-10">
146
- <div
147
- className="u-rounded-full"
148
- style={{
149
- width: '0.5rem',
150
- height: '0.5rem',
151
- flexShrink: 0,
152
- backgroundColor: fpsColor,
153
- ...(isCritical && { animation: 'perf-dashboard-pulse 1s infinite' }),
154
- }}
155
- />
156
- <span
157
- className="u-text-xs"
158
- style={{
159
- fontSize: '0.625rem', // 10px
160
- color: fpsColor
161
- }}
162
- >
163
- {getFpsLabel(metrics.fps)}
164
- </span>
165
- </div>
166
- </div>
167
- );
168
- }
169
- );
170
-
171
- PerformanceDashboard.displayName = 'PerformanceDashboard';