cynx-ui 1.3.26 → 1.3.27

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.
@@ -1,5 +1,6 @@
1
1
  const STYLES = `
2
2
  @keyframes sk-shimmer{0%{background-position:-600px 0}100%{background-position:600px 0}}
3
+ @keyframes shimmer{0%{background-position:-600px 0}100%{background-position:600px 0}}
3
4
  .skeleton{background:linear-gradient(90deg,var(--grey-1,#f0f1f5) 25%,var(--border-light,#e8e8ec) 50%,var(--grey-1,#f0f1f5) 75%);background-size:600px 100%;animation:sk-shimmer 1.4s ease infinite;border-radius:var(--radxs,4px)}
4
5
  .skeleton-text{height:12px;margin-bottom:6px}
5
6
  `;
@@ -13,7 +13,23 @@ export function XTd({ children, style, className = '', colSpan }) {
13
13
  return <td style={{ padding: '9px 10px', verticalAlign: 'middle', color: 'var(--primary-text, #0f111c)', ...style }} colSpan={colSpan}>{children}</td>;
14
14
  }
15
15
 
16
+ const SKELETON_STYLES = `
17
+ @keyframes shimmer{0%{background-position:-600px 0}100%{background-position:600px 0}}
18
+ @keyframes sk-shimmer{0%{background-position:-600px 0}100%{background-position:600px 0}}
19
+ `;
20
+ let _tbl_sk_id = 'cynx-table-skeleton-styles';
21
+ function ensureSkeletonStyles() {
22
+ if (typeof document === 'undefined') return;
23
+ if (document.getElementById(_tbl_sk_id)) return;
24
+ const tag = document.createElement('style');
25
+ tag.id = _tbl_sk_id;
26
+ tag.textContent = SKELETON_STYLES;
27
+ document.head.appendChild(tag);
28
+ }
29
+ if (typeof document !== 'undefined') ensureSkeletonStyles();
30
+
16
31
  export function SkeletonTable({ rows = 6, cols = 5 }) {
32
+ ensureSkeletonStyles();
17
33
  return (
18
34
  <div>
19
35
  {Array.from({ length: rows }).map((_, i) => (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-ui",
3
- "version": "1.3.26",
3
+ "version": "1.3.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js"