@shohojdhara/atomix 0.6.5 → 0.6.7
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/dist/atomix.css +660 -658
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +45 -45
- package/dist/atomix.min.css.map +1 -1
- package/dist/atomix.umd.js +1 -1
- package/dist/atomix.umd.js.map +1 -1
- package/dist/atomix.umd.min.js +1 -1
- package/dist/charts.js +65 -255
- package/dist/charts.js.map +1 -1
- package/dist/core.js +65 -255
- package/dist/core.js.map +1 -1
- package/dist/forms.js +65 -255
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +65 -255
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +6 -37
- package/dist/index.esm.js +66 -300
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +66 -300
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +0 -9
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +0 -2
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +1 -1
- package/src/components/AtomixGlass/glass-utils.ts +82 -53
- package/src/components/AtomixGlass/shader-utils.ts +19 -77
- package/src/components/Form/Select.test.tsx +6 -6
- package/src/components/Form/Textarea.stories.tsx +5 -5
- package/src/layouts/Grid/Grid.stories.tsx +54 -2
- package/src/layouts/Grid/README.md +6 -2
- package/src/lib/composables/useAtomixGlass.ts +2 -134
- package/src/lib/composables/useAtomixGlassStyles.ts +3 -3
- package/src/lib/composables/usePerformanceMonitor.ts +0 -66
- package/src/lib/constants/components.ts +6 -1
- package/src/styles/01-settings/_settings.atomix-glass.scss +2 -2
- package/src/styles/01-settings/_settings.colors.scss +73 -73
- package/src/styles/02-tools/_tools.button.scss +51 -42
- package/src/styles/05-objects/_objects.grid.scss +4 -1
- package/src/styles/06-components/_components.atomix-glass.scss +2 -2
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +0 -171
- package/src/components/AtomixGlass/animation-system.ts +0 -578
|
@@ -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';
|