cynx-ui 1.2.22 → 1.2.24
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/components/Card.jsx +1 -1
- package/components/Modal.jsx +4 -4
- package/components/Spinner.jsx +58 -2
- package/package.json +1 -1
package/components/Card.jsx
CHANGED
|
@@ -32,7 +32,7 @@ export function TableCardFooter({ total, page, limit, pages, onChange }) {
|
|
|
32
32
|
|
|
33
33
|
export function CardHdr({ title, icon: Icon, tabs, children }) {
|
|
34
34
|
return (
|
|
35
|
-
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '
|
|
35
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '0', height: 48, borderBottom: '1px solid var(--border-light, #ebebf0)' }}>
|
|
36
36
|
<div style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: '.85rem', fontWeight: 600, color: 'var(--primary-text, #0f111c)' }}>
|
|
37
37
|
{Icon && <Icon size={14} />}
|
|
38
38
|
{title}
|
package/components/Modal.jsx
CHANGED
|
@@ -30,8 +30,8 @@ const STYLES = `
|
|
|
30
30
|
}
|
|
31
31
|
.modal-card {
|
|
32
32
|
background: var(--surface); border: 1px solid var(--border);
|
|
33
|
-
border-radius: 14px; width: 100%; max-width: 480px;
|
|
34
|
-
box-shadow: var(--shadow-lg); overflow:
|
|
33
|
+
border-radius: 14px; width: 100%; max-width: 480px; max-height: 60vh;
|
|
34
|
+
box-shadow: var(--shadow-lg); overflow: hidden;
|
|
35
35
|
display: flex; flex-direction: column;
|
|
36
36
|
}
|
|
37
37
|
.modal-close {
|
|
@@ -148,9 +148,9 @@ export function Modal({ open, onClose, onBeforeClose, title, children, footer, m
|
|
|
148
148
|
className="modal-card"
|
|
149
149
|
style={{
|
|
150
150
|
background: 'var(--surface)', border: '1px solid var(--border)',
|
|
151
|
-
borderRadius: 14, width: '100%', maxWidth,
|
|
151
|
+
borderRadius: 14, width: '100%', maxWidth, maxHeight: '60vh',
|
|
152
152
|
boxShadow: '0 20px 60px rgba(0,0,0,.25)',
|
|
153
|
-
overflow: '
|
|
153
|
+
overflow: 'hidden', display: 'flex', flexDirection: 'column',
|
|
154
154
|
animation: `${closing ? 'modalCardOut' : 'modalCardIn'} .26s cubic-bezier(.4,0,.2,1) forwards`,
|
|
155
155
|
}}
|
|
156
156
|
onMouseDown={e => e.stopPropagation()}
|
package/components/Spinner.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const STYLES = `.spin{animation:cx-spin .7s linear infinite}@keyframes cx-spin{to{transform:rotate(360deg)}}`;
|
|
1
|
+
const STYLES = `.spin{animation:cx-spin .7s linear infinite}@keyframes cx-spin{to{transform:rotate(360deg)}}.v-progress-circular--indeterminate>svg{animation:progress-circular-rotate .8s linear infinite;transform-origin:center center;transition:all .2s ease-in-out}.v-progress-circular>svg{width:100%;height:100%;margin:auto;position:absolute;inset:0;z-index:0}@keyframes progress-circular-rotate{100%{transform:rotate(270deg)}}@keyframes progress-circular-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.v-progress-circular--indeterminate .v-progress-circular__overlay{animation:progress-circular-dash 1.4s ease-in-out infinite;stroke-linecap:round}`;
|
|
2
2
|
|
|
3
3
|
let _id = 'cynx-spinner-styles';
|
|
4
4
|
function ensureStyles() {
|
|
@@ -13,7 +13,7 @@ function ensureStyles() {
|
|
|
13
13
|
// Auto-inject on module load
|
|
14
14
|
if (typeof document !== 'undefined') ensureStyles();
|
|
15
15
|
|
|
16
|
-
export function
|
|
16
|
+
export function SpinnerClassic({ size = 20, inline = false, color = 'currentColor', fullPage = false }) {
|
|
17
17
|
ensureStyles();
|
|
18
18
|
const s = inline ? 14 : size;
|
|
19
19
|
const svg = (
|
|
@@ -49,4 +49,60 @@ export function Spinner({ size = 20, inline = false, color = 'currentColor', ful
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export function Spinner({ size = 20, inline = false, color = 'currentColor', fullPage = false }) {
|
|
53
|
+
ensureStyles();
|
|
54
|
+
const s = inline ? 14 : size;
|
|
55
|
+
|
|
56
|
+
const svg = (
|
|
57
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42.42 42.42"
|
|
58
|
+
style={{ width: s, height: s, transform: 'rotate(-90deg)' }}>
|
|
59
|
+
<circle fill="transparent" cx="50%" cy="50%" r="20"
|
|
60
|
+
stroke="var(--grey-2, #e0e0e0)" strokeWidth="2.42" strokeDasharray="125.66" strokeDashoffset="0" />
|
|
61
|
+
<circle className="v-progress-circular__overlay" fill="transparent" cx="50%" cy="50%" r="20"
|
|
62
|
+
stroke={color} strokeWidth="2.42" strokeDasharray="125.66" strokeDashoffset="125.66" />
|
|
63
|
+
</svg>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
if (fullPage) {
|
|
67
|
+
return (
|
|
68
|
+
<div style={{
|
|
69
|
+
position: 'fixed', inset: 0,
|
|
70
|
+
background: 'var(--bg)',
|
|
71
|
+
display: 'flex', flexDirection: 'column',
|
|
72
|
+
alignItems: 'center', justifyContent: 'center', gap: 16,
|
|
73
|
+
zIndex: 9999,
|
|
74
|
+
}}>
|
|
75
|
+
<div className="v-progress-circular v-progress-circular--indeterminate" style={{ width: s, height: s }}>
|
|
76
|
+
{svg}
|
|
77
|
+
</div>
|
|
78
|
+
<div style={{ fontSize: '.75rem', fontFamily: 'var(--mono)', color: 'var(--muted)' }}>
|
|
79
|
+
Loading...
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (inline) {
|
|
86
|
+
return (
|
|
87
|
+
<div className="v-progress-circular v-progress-circular--indeterminate"
|
|
88
|
+
style={{ width: s, height: s, position: 'relative', display: 'inline-flex', flexShrink: 0 }}>
|
|
89
|
+
<svg viewBox="0 0 42.42 42.42"
|
|
90
|
+
style={{ width: '100%', height: '100%', transform: 'rotate(-90deg)' }}>
|
|
91
|
+
<circle className="v-progress-circular__overlay" fill="transparent" cx="50%" cy="50%" r="20"
|
|
92
|
+
stroke={color} strokeWidth="2.42" strokeDasharray="125.66" strokeDashoffset="125.66" />
|
|
93
|
+
</svg>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '48px 0' }}>
|
|
100
|
+
<div className="v-progress-circular v-progress-circular--indeterminate" style={{ width: s, height: s }}>
|
|
101
|
+
{svg}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { Spinner as SpinnerNew };
|
|
52
108
|
export default Spinner;
|