cynx-lib 1.3.28
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/index.js +3 -0
- package/package.json +36 -0
- package/ui/components/ActionsMenu.jsx +158 -0
- package/ui/components/ActivityCard.jsx +184 -0
- package/ui/components/AuthOverlay.jsx +94 -0
- package/ui/components/Badge.jsx +186 -0
- package/ui/components/BrandingCard.jsx +146 -0
- package/ui/components/Button.jsx +148 -0
- package/ui/components/Card.jsx +132 -0
- package/ui/components/Checkbox.jsx +59 -0
- package/ui/components/ChipSelect.jsx +54 -0
- package/ui/components/CircularProgress.jsx +216 -0
- package/ui/components/Confirm.jsx +79 -0
- package/ui/components/DatePicker.jsx +605 -0
- package/ui/components/Divider.jsx +96 -0
- package/ui/components/Dropzone.jsx +203 -0
- package/ui/components/FilePicker.jsx +205 -0
- package/ui/components/HoverCard.jsx +81 -0
- package/ui/components/ImageUpload.jsx +147 -0
- package/ui/components/InfoBadge.jsx +204 -0
- package/ui/components/Input.jsx +229 -0
- package/ui/components/LineProgress.jsx +133 -0
- package/ui/components/LinearProgress.jsx +132 -0
- package/ui/components/Modal.jsx +212 -0
- package/ui/components/Pagination.jsx +52 -0
- package/ui/components/PulseDot.jsx +77 -0
- package/ui/components/Select.jsx +415 -0
- package/ui/components/Skeleton.jsx +118 -0
- package/ui/components/Spinner.jsx +108 -0
- package/ui/components/StatBarCard.jsx +25 -0
- package/ui/components/StatsBar.jsx +88 -0
- package/ui/components/StatsCard.jsx +171 -0
- package/ui/components/TabBar.jsx +404 -0
- package/ui/components/Tabs.jsx +29 -0
- package/ui/components/TimePicker.jsx +1069 -0
- package/ui/components/Toast.jsx +106 -0
- package/ui/components/Toggle.jsx +67 -0
- package/ui/components/UptimeBar.jsx +135 -0
- package/ui/components/XTable.jsx +44 -0
- package/ui/index.js +97 -0
- package/utils/index.js +11 -0
- package/utils/utils/oidc.js +209 -0
- package/utils/utils/realtime.js +1040 -0
- package/utils/utils/storage.js +393 -0
- package/utils/utils/tz.js +625 -0
- package/utils/utils/uid.js +252 -0
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cynx-lib",
|
|
3
|
+
"version": "1.3.28",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./ui": "./ui/index.js",
|
|
9
|
+
"./utils": "./utils/index.js"
|
|
10
|
+
},
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"react": ">=18",
|
|
13
|
+
"react-dom": ">=18",
|
|
14
|
+
"react-router-dom": ">=6",
|
|
15
|
+
"lucide-react": ">=0.300"
|
|
16
|
+
},
|
|
17
|
+
"peerDependenciesMeta": {
|
|
18
|
+
"react": {
|
|
19
|
+
"optional": true
|
|
20
|
+
},
|
|
21
|
+
"react-dom": {
|
|
22
|
+
"optional": true
|
|
23
|
+
},
|
|
24
|
+
"react-router-dom": {
|
|
25
|
+
"optional": true
|
|
26
|
+
},
|
|
27
|
+
"lucide-react": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"ui/",
|
|
33
|
+
"utils/",
|
|
34
|
+
"index.js"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { useState, useRef, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
|
|
4
|
+
export function ActionsMenu({ items, align = 'right' }) {
|
|
5
|
+
const [open, setOpen] = useState(false);
|
|
6
|
+
const [closing, setClosing] = useState(false);
|
|
7
|
+
const wrapRef = useRef(null);
|
|
8
|
+
const menuRef = useRef(null);
|
|
9
|
+
const btnRef = useRef(null);
|
|
10
|
+
|
|
11
|
+
const close = useCallback(() => {
|
|
12
|
+
setClosing(true);
|
|
13
|
+
setTimeout(() => { setClosing(false); setOpen(false); }, 140);
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
const positionMenu = useCallback(() => {
|
|
17
|
+
const btn = btnRef.current;
|
|
18
|
+
const menu = menuRef.current;
|
|
19
|
+
if (!btn || !menu) return;
|
|
20
|
+
const br = btn.getBoundingClientRect();
|
|
21
|
+
const mw = menu.offsetWidth || 180;
|
|
22
|
+
const mh = menu.offsetHeight || 120;
|
|
23
|
+
const spaceBelow = window.innerHeight - br.bottom;
|
|
24
|
+
const spaceAbove = br.top;
|
|
25
|
+
const openUp = spaceBelow < mh + 12 && spaceAbove > spaceBelow;
|
|
26
|
+
|
|
27
|
+
let top, left;
|
|
28
|
+
if (openUp) {
|
|
29
|
+
top = br.top - mh - 6;
|
|
30
|
+
} else {
|
|
31
|
+
top = br.bottom + 6;
|
|
32
|
+
}
|
|
33
|
+
if (align === 'left') {
|
|
34
|
+
left = br.left;
|
|
35
|
+
} else {
|
|
36
|
+
left = br.right - mw;
|
|
37
|
+
}
|
|
38
|
+
left = Math.max(8, Math.min(left, window.innerWidth - mw - 8));
|
|
39
|
+
|
|
40
|
+
menu.style.top = top + 'px';
|
|
41
|
+
menu.style.left = left + 'px';
|
|
42
|
+
menu.classList.toggle('open-up', openUp);
|
|
43
|
+
}, [align]);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!open) return;
|
|
47
|
+
function onDocClick(e) {
|
|
48
|
+
if (
|
|
49
|
+
wrapRef.current && !wrapRef.current.contains(e.target) &&
|
|
50
|
+
menuRef.current && !menuRef.current.contains(e.target)
|
|
51
|
+
) {
|
|
52
|
+
close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function onScroll() { positionMenu(); }
|
|
56
|
+
document.addEventListener('mousedown', onDocClick);
|
|
57
|
+
document.addEventListener('scroll', onScroll, true);
|
|
58
|
+
window.addEventListener('resize', onScroll);
|
|
59
|
+
return () => {
|
|
60
|
+
document.removeEventListener('mousedown', onDocClick);
|
|
61
|
+
document.removeEventListener('scroll', onScroll, true);
|
|
62
|
+
window.removeEventListener('resize', onScroll);
|
|
63
|
+
};
|
|
64
|
+
}, [open, close, positionMenu]);
|
|
65
|
+
|
|
66
|
+
useLayoutEffect(() => {
|
|
67
|
+
if (open) {
|
|
68
|
+
positionMenu();
|
|
69
|
+
}
|
|
70
|
+
}, [open, positionMenu]);
|
|
71
|
+
|
|
72
|
+
function toggle() {
|
|
73
|
+
if (open) close();
|
|
74
|
+
else { setOpen(true); setClosing(false); }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const isOpen = open && !closing;
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div ref={wrapRef} style={{ position: 'relative', display: 'inline-block' }}>
|
|
81
|
+
<button
|
|
82
|
+
ref={btnRef}
|
|
83
|
+
type="button"
|
|
84
|
+
onClick={toggle}
|
|
85
|
+
style={{
|
|
86
|
+
width: 32, height: 32, borderRadius: 'var(--rads,8px)',
|
|
87
|
+
border: isOpen ? '1px solid var(--accent,#f99e2c)' : '1px solid var(--border-light,#d7d8e0)',
|
|
88
|
+
background: 'var(--surface,#fff)',
|
|
89
|
+
cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
90
|
+
color: isOpen ? 'var(--accent, #f99e2c)' : 'var(--muted,#797b8d)', transition: 'all .14s',
|
|
91
|
+
boxShadow: isOpen ? 'var(--pd, rgba(249,158,44,.12))' : 'var(--shadow, 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06))',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
95
|
+
<circle cx="5" cy="12" r="1.5" /><circle cx="12" cy="12" r="1.5" /><circle cx="19" cy="12" r="1.5" />
|
|
96
|
+
</svg>
|
|
97
|
+
</button>
|
|
98
|
+
|
|
99
|
+
{open && typeof document !== 'undefined' && createPortal(
|
|
100
|
+
<div
|
|
101
|
+
ref={menuRef}
|
|
102
|
+
style={{
|
|
103
|
+
position: 'fixed', zIndex: 99999, minWidth: 180, padding: 5,
|
|
104
|
+
background: 'var(--surface,#fff)', border: '1.5px solid var(--border-light,#e2e8f0)',
|
|
105
|
+
borderRadius: 'var(--rads,8px)',
|
|
106
|
+
boxShadow: 'var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.06))',
|
|
107
|
+
animation: closing
|
|
108
|
+
? 'actionsClose .14s ease forwards'
|
|
109
|
+
: 'actionsDrop .14s cubic-bezier(.16,1,.3,1)',
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
{items.map((item, i) => (
|
|
113
|
+
item.dividerBefore ? (
|
|
114
|
+
<div key={i} style={{ height: 1, background: 'var(--border-light,#e2e8f0)', margin: '4px 0' }} />
|
|
115
|
+
) : (
|
|
116
|
+
<div
|
|
117
|
+
key={i}
|
|
118
|
+
onClick={() => { close(); item.onClick?.(); }}
|
|
119
|
+
style={{
|
|
120
|
+
display: 'flex', alignItems: 'center', gap: 8,
|
|
121
|
+
padding: '6px 10px', borderRadius: 'var(--rads,8px)',
|
|
122
|
+
fontSize: 12, cursor: 'pointer', transition: 'all .14s',
|
|
123
|
+
color: item.variant === 'danger' ? 'var(--danger, #f64747)' : item.variant === 'success' ? 'var(--success, #27ae60)' : item.variant === 'warning' ? 'var(--accent, #f99e2c)' : 'var(--text,#1a1a2e)',
|
|
124
|
+
fontWeight: 500,
|
|
125
|
+
}}
|
|
126
|
+
onMouseEnter={e => {
|
|
127
|
+
e.currentTarget.style.background = item.variant === 'danger' ? 'var(--dd, rgba(246,71,71,.08))' : item.variant === 'warning' ? 'var(--pd, rgba(249,158,44,.08))' : 'var(--grey-1,#f5f5f8)';
|
|
128
|
+
}}
|
|
129
|
+
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; }}
|
|
130
|
+
>
|
|
131
|
+
{item.icon && (
|
|
132
|
+
<span style={{
|
|
133
|
+
width: 24, height: 24, borderRadius: 5,
|
|
134
|
+
display: 'flex', alignItems: 'center', justifyContent: 'center',
|
|
135
|
+
flexShrink: 0, color: 'inherit', fontSize: 12,
|
|
136
|
+
}}>{item.icon}</span>
|
|
137
|
+
)}
|
|
138
|
+
<span>{item.label}</span>
|
|
139
|
+
</div>
|
|
140
|
+
)
|
|
141
|
+
))}
|
|
142
|
+
</div>,
|
|
143
|
+
document.body
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
<style>{`
|
|
147
|
+
@keyframes actionsDrop {
|
|
148
|
+
from { opacity: 0; transform: translateY(-6px) scaleY(.96); }
|
|
149
|
+
to { opacity: 1; transform: translateY(0) scaleY(1); }
|
|
150
|
+
}
|
|
151
|
+
@keyframes actionsClose {
|
|
152
|
+
from { opacity: 1; transform: translateY(0) scaleY(1); }
|
|
153
|
+
to { opacity: 0; transform: translateY(-4px) scaleY(.96); }
|
|
154
|
+
}
|
|
155
|
+
`}</style>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { useMemo, useState, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
const MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
|
4
|
+
|
|
5
|
+
function LegendDot({ color, label }) {
|
|
6
|
+
return (
|
|
7
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
|
8
|
+
<span style={{ width: 7, height: 7, borderRadius: 2, background: color, flexShrink: 0 }} />
|
|
9
|
+
<span style={{ fontSize: '.55rem', color: 'var(--muted, #797b8d)', fontWeight: 500 }}>{label}</span>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* ActivityCard — day-block bar with hover tooltip
|
|
16
|
+
*/
|
|
17
|
+
export default function ActivityCard({
|
|
18
|
+
title = 'Activity',
|
|
19
|
+
subtitle,
|
|
20
|
+
primary = [],
|
|
21
|
+
additional = [],
|
|
22
|
+
totalSlots = 90,
|
|
23
|
+
greenColor = 'var(--success, #27ae60)',
|
|
24
|
+
redColor = 'var(--danger, #f64747)',
|
|
25
|
+
emptyColor = 'var(--grey-1, #f5f5f8)',
|
|
26
|
+
barHeight = 28,
|
|
27
|
+
barRadius = 3,
|
|
28
|
+
leftLabel,
|
|
29
|
+
rightLabel,
|
|
30
|
+
showDot = true,
|
|
31
|
+
dotColor,
|
|
32
|
+
style,
|
|
33
|
+
}) {
|
|
34
|
+
const [hovered, setHovered] = useState(null);
|
|
35
|
+
const [tooltipPos, setTooltipPos] = useState({ x: 0, y: 0 });
|
|
36
|
+
const containerRef = useRef(null);
|
|
37
|
+
|
|
38
|
+
const bars = useMemo(() => {
|
|
39
|
+
const len = Math.max(primary.length, additional.length, totalSlots);
|
|
40
|
+
const result = [];
|
|
41
|
+
const stepS = primary.length / len;
|
|
42
|
+
const stepF = additional.length / len;
|
|
43
|
+
for (let i = 0; i < len; i++) {
|
|
44
|
+
const si = Math.min(Math.floor(i * stepS), primary.length - 1);
|
|
45
|
+
const fi = Math.min(Math.floor(i * stepF), additional.length - 1);
|
|
46
|
+
result.push({ success: primary[si] || 0, failed: additional[fi] || 0 });
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}, [primary, additional, totalSlots]);
|
|
50
|
+
|
|
51
|
+
const dates = useMemo(() => {
|
|
52
|
+
const result = [];
|
|
53
|
+
const now = new Date();
|
|
54
|
+
for (let i = 0; i < bars.length; i++) {
|
|
55
|
+
const d = new Date(now);
|
|
56
|
+
d.setDate(d.getDate() - (bars.length - 1 - i));
|
|
57
|
+
result.push(d);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}, [bars.length]);
|
|
61
|
+
|
|
62
|
+
const totalSuccess = bars.reduce((a, b) => a + b.success, 0);
|
|
63
|
+
const totalFailed = bars.reduce((a, b) => a + b.failed, 0);
|
|
64
|
+
const totalAll = totalSuccess + totalFailed;
|
|
65
|
+
const uptimePercent = totalAll > 0 ? Math.round((totalSuccess / totalAll) * 100) : 100;
|
|
66
|
+
|
|
67
|
+
function handleMouseEnter(e, idx) {
|
|
68
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
69
|
+
const containerRect = containerRef.current.getBoundingClientRect();
|
|
70
|
+
setTooltipPos({
|
|
71
|
+
x: rect.left - containerRect.left + rect.width / 2,
|
|
72
|
+
y: rect.top - containerRect.top - 8,
|
|
73
|
+
});
|
|
74
|
+
setHovered(idx);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const h = hovered !== null ? bars[hovered] : null;
|
|
78
|
+
const hTotal = h ? h.success + h.failed : 0;
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div ref={containerRef} style={{
|
|
82
|
+
background: 'var(--surface,#fff)', border: '1px solid var(--border, #e2e8f0)', borderRadius: 'var(--rad, 10px)',
|
|
83
|
+
boxShadow: 'var(--shadow, 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04))',
|
|
84
|
+
padding: '14px 18px', position: 'relative', ...style,
|
|
85
|
+
}}>
|
|
86
|
+
{/* Header */}
|
|
87
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
|
|
88
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
|
89
|
+
{showDot && (
|
|
90
|
+
<span style={{ width: 8, height: 8, borderRadius: '50%', background: dotColor || greenColor, flexShrink: 0 }} />
|
|
91
|
+
)}
|
|
92
|
+
<span style={{ fontSize: '.78rem', fontWeight: 700, color: 'var(--primary-text, #0f172a)', letterSpacing: '-.01em' }}>{title}</span>
|
|
93
|
+
{subtitle && <span style={{ fontSize: '.65rem', color: 'var(--muted, #797b8d)', fontWeight: 500 }}>{subtitle}</span>}
|
|
94
|
+
</div>
|
|
95
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
|
96
|
+
<LegendDot color={greenColor} label="Success" />
|
|
97
|
+
<LegendDot color={redColor} label="Failed" />
|
|
98
|
+
<LegendDot color={emptyColor} label="None" />
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
{/* Bars */}
|
|
103
|
+
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 2, height: barHeight, marginBottom: 6 }}>
|
|
104
|
+
{bars.map((b, i) => {
|
|
105
|
+
const total = b.success + b.failed;
|
|
106
|
+
const hasData = total > 0;
|
|
107
|
+
const successPct = hasData ? (b.success / total) * 100 : 0;
|
|
108
|
+
const failedPct = hasData ? (b.failed / total) * 100 : 0;
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<div
|
|
112
|
+
key={i}
|
|
113
|
+
onMouseEnter={(e) => handleMouseEnter(e, i)}
|
|
114
|
+
onMouseLeave={() => setHovered(null)}
|
|
115
|
+
style={{
|
|
116
|
+
flex: 1, height: '100%', borderRadius: barRadius, overflow: 'hidden',
|
|
117
|
+
display: 'flex', flexDirection: 'column',
|
|
118
|
+
background: hasData ? 'transparent' : emptyColor,
|
|
119
|
+
cursor: hasData ? 'pointer' : 'default',
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
{hasData && (
|
|
123
|
+
<>
|
|
124
|
+
{b.failed > 0 && <div style={{ height: `${failedPct}%`, background: redColor, marginTop: 'auto' }} />}
|
|
125
|
+
{b.success > 0 && <div style={{ height: `${successPct}%`, background: greenColor }} />}
|
|
126
|
+
</>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
})}
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
{/* Tooltip */}
|
|
134
|
+
{hovered !== null && (
|
|
135
|
+
<div style={{
|
|
136
|
+
position: 'absolute', left: tooltipPos.x, top: tooltipPos.y,
|
|
137
|
+
transform: 'translate(-50%, -100%)', background: 'var(--surface,#fff)',
|
|
138
|
+
border: '1px solid var(--border, #e2e8f0)', borderRadius: 'var(--rads, 8px)',
|
|
139
|
+
boxShadow: 'var(--smd, 0 4px 12px rgba(0,0,0,.12))', padding: '10px 14px',
|
|
140
|
+
pointerEvents: 'none', zIndex: 100, whiteSpace: 'nowrap',
|
|
141
|
+
animation: 'hoverCardIn .15s ease',
|
|
142
|
+
}}>
|
|
143
|
+
<div style={{ fontSize: '.65rem', color: 'var(--muted, #797b8d)', fontWeight: 500, marginBottom: 4 }}>
|
|
144
|
+
{dates[hovered]?.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}
|
|
145
|
+
</div>
|
|
146
|
+
{h.success > 0 && (
|
|
147
|
+
<div style={{ fontSize: '.7rem', fontWeight: 700, color: greenColor }}>
|
|
148
|
+
{h.success} success{h.success !== 1 ? 'es' : ''}
|
|
149
|
+
{h.failed > 0 && <span style={{ fontWeight: 500, color: 'var(--muted, #797b8d)' }}> ({Math.round((h.success / hTotal) * 100)}%)</span>}
|
|
150
|
+
</div>
|
|
151
|
+
)}
|
|
152
|
+
{h.failed > 0 && (
|
|
153
|
+
<div style={{ fontSize: '.7rem', fontWeight: 700, color: redColor }}>
|
|
154
|
+
{h.failed} failed{h.failed !== 1 ? 's' : ''}
|
|
155
|
+
{h.success > 0 && <span style={{ fontWeight: 500, color: 'var(--muted, #797b8d)' }}> ({Math.round((h.failed / hTotal) * 100)}%)</span>}
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
{!h.success && !h.failed && (
|
|
159
|
+
<div style={{ fontSize: '.7rem', fontWeight: 500, color: 'var(--muted, #797b8d)' }}>No activity</div>
|
|
160
|
+
)}
|
|
161
|
+
<div style={{
|
|
162
|
+
position: 'absolute', left: '50%', bottom: -5,
|
|
163
|
+
transform: 'translateX(-50%) rotate(45deg)',
|
|
164
|
+
width: 8, height: 8, background: 'var(--surface,#fff)',
|
|
165
|
+
borderRight: '1px solid var(--border, #e2e8f0)', borderBottom: '1px solid var(--border, #e2e8f0)',
|
|
166
|
+
}} />
|
|
167
|
+
</div>
|
|
168
|
+
)}
|
|
169
|
+
|
|
170
|
+
{/* Footer */}
|
|
171
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
172
|
+
<span style={{ fontSize: '.58rem', color: 'var(--muted, #797b8d)', fontWeight: 500 }}>{leftLabel || ''}</span>
|
|
173
|
+
<span style={{ fontSize: '.78rem', fontWeight: 700, color: greenColor, fontFamily: 'var(--mono, ui-monospace, monospace)' }}>{uptimePercent}%</span>
|
|
174
|
+
<span style={{ fontSize: '.58rem', color: 'var(--muted, #797b8d)', fontWeight: 500 }}>{rightLabel || ''}</span>
|
|
175
|
+
</div>
|
|
176
|
+
<style>{`
|
|
177
|
+
@keyframes hoverCardIn {
|
|
178
|
+
from { opacity: 0; transform: translate(-50%, -100%) translateY(4px); }
|
|
179
|
+
to { opacity: 1; transform: translate(-50%, -100%) translateY(0); }
|
|
180
|
+
}
|
|
181
|
+
`}</style>
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
}
|