cynx-ui 1.2.18 → 1.2.20
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/Tabs.jsx +15 -2
- package/components/XTable.jsx +3 -2
- package/package.json +1 -1
package/components/Tabs.jsx
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
export function Tabs({ tabs, value, onChange, style }) {
|
|
2
2
|
return (
|
|
3
|
-
<div
|
|
3
|
+
<div style={{ display: 'inline-flex', gap: 3, background: 'var(--grey-1, #f5f5f8)', borderRadius: 'var(--radxs, 6px)', padding: '3px', border: '1px solid var(--border-light, #ebebf0)', ...style }}>
|
|
4
4
|
{tabs.map(t => {
|
|
5
5
|
const label = typeof t === 'string' ? t : t.label;
|
|
6
6
|
const key = typeof t === 'string' ? t : t.value;
|
|
7
7
|
const active = key === value;
|
|
8
8
|
return (
|
|
9
|
-
<button key={key}
|
|
9
|
+
<button key={key} onClick={() => onChange(key)} style={{
|
|
10
|
+
display: 'flex', alignItems: 'center', gap: 5,
|
|
11
|
+
padding: '5px 12px',
|
|
12
|
+
border: 'none',
|
|
13
|
+
borderRadius: 'var(--radxs, 6px)',
|
|
14
|
+
background: active ? '#fff' : 'transparent',
|
|
15
|
+
boxShadow: active ? '0 1px 2px rgba(0,0,0,.06)' : 'none',
|
|
16
|
+
fontSize: '.75rem', fontWeight: active ? 600 : 500,
|
|
17
|
+
color: active ? 'var(--primary-text, #0f111c)' : 'var(--muted, #9b9daa)',
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
transition: 'all .18s ease',
|
|
20
|
+
fontFamily: 'inherit',
|
|
21
|
+
whiteSpace: 'nowrap',
|
|
22
|
+
}}>
|
|
10
23
|
{label}
|
|
11
24
|
</button>
|
|
12
25
|
);
|
package/components/XTable.jsx
CHANGED
|
@@ -14,12 +14,13 @@ export function XTd({ children, style, className = '', colSpan }) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function SkeletonTable({ rows = 6, cols = 5 }) {
|
|
17
|
+
const widths = ['20%', '14%', '10%', '12%', '8%', '14%', '14%', '8%'];
|
|
17
18
|
return (
|
|
18
19
|
<div>
|
|
19
20
|
{Array.from({ length: rows }).map((_, i) => (
|
|
20
|
-
<div key={i} style={{ display: 'flex', gap: 8, padding: '
|
|
21
|
+
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '10px', borderBottom: '1px solid var(--border-light, #ebebf0)' }}>
|
|
21
22
|
{Array.from({ length: cols }).map((_, j) => (
|
|
22
|
-
<div key={j} style={{ height:
|
|
23
|
+
<div key={j} style={{ height: 10, width: widths[j] || '10%', background: 'linear-gradient(90deg, var(--grey-1, #f5f5f8) 25%, var(--border-light, #ebebf0) 50%, var(--grey-1, #f5f5f8) 75%)', backgroundSize: '600px 100%', animation: 'shimmer 1.4s ease infinite', borderRadius: 4, flexShrink: 0 }} />
|
|
23
24
|
))}
|
|
24
25
|
</div>
|
|
25
26
|
))}
|