@lowdefy/blocks-loaders 5.0.0 → 5.2.0

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.
@@ -18,34 +18,36 @@
18
18
  .skeleton {
19
19
  position: relative;
20
20
  overflow: hidden;
21
- background: var(--ant-color-fill-tertiary);
21
+ background-color: var(--ant-color-fill-secondary);
22
+ border-radius: var(--ant-border-radius-sm, 4px);
23
+ isolation: isolate;
22
24
  }
23
25
 
24
- .skeleton::before {
26
+ .skeleton::after {
25
27
  content: '';
26
- display: block;
27
28
  position: absolute;
28
- left: -100%;
29
- max-width: 600px;
30
- top: 0;
31
- height: 200%;
32
- width: 100%;
33
- background: linear-gradient(
34
- to right,
29
+ inset: 0;
30
+ transform: translateX(-100%);
31
+ background-image: linear-gradient(
32
+ 90deg,
35
33
  transparent 0%,
36
- var(--ant-color-fill-secondary) 50%,
34
+ var(--ant-color-fill-quaternary) 20%,
35
+ var(--ant-color-fill) 60%,
37
36
  transparent 100%
38
37
  );
39
- animation: load 1.8s infinite;
40
- /* transform: rotate(45deg); */
38
+ animation: skeleton-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
39
+ will-change: transform;
41
40
  }
42
41
 
43
- @keyframes load {
44
- from {
45
- left: -100%;
42
+ @keyframes skeleton-shimmer {
43
+ 100% {
44
+ transform: translateX(100%);
46
45
  }
47
- to {
48
- left: 100%;
46
+ }
47
+
48
+ @media (prefers-reduced-motion: reduce) {
49
+ .skeleton::after {
50
+ animation: none;
49
51
  }
50
52
  }
51
53
  }
@@ -30,11 +30,12 @@ const SkeletonAvatar = ({ classNames, properties, styles })=>{
30
30
  size = 32;
31
31
  }
32
32
  }
33
+ const borderRadius = properties.shape === 'square' ? 'var(--ant-border-radius-lg, 8px)' : size / 2;
33
34
  return /*#__PURE__*/ React.createElement(Skeleton, {
34
35
  classNames: classNames,
35
36
  styles: {
36
37
  element: {
37
- borderRadius: properties.shape === 'square' ? '0' : size / 2,
38
+ borderRadius,
38
39
  ...styles?.element
39
40
  }
40
41
  },
@@ -27,11 +27,12 @@ const SkeletonButton = ({ classNames, properties, styles })=>{
27
27
  default:
28
28
  height = 32;
29
29
  }
30
+ const borderRadius = properties.shape === 'round' ? height / 2 : 'var(--ant-border-radius, 6px)';
30
31
  return /*#__PURE__*/ React.createElement(Skeleton, {
31
32
  classNames: classNames,
32
33
  styles: {
33
34
  element: {
34
- borderRadius: properties.shape === 'round' && height / 2,
35
+ borderRadius,
35
36
  ...styles?.element
36
37
  }
37
38
  },
@@ -29,11 +29,16 @@ const SkeletonInput = ({ classNames, properties, styles })=>{
29
29
  }
30
30
  return /*#__PURE__*/ React.createElement("div", {
31
31
  className: classNames?.element,
32
- style: styles?.element
32
+ style: {
33
+ display: 'flex',
34
+ flexDirection: 'column',
35
+ gap: 10,
36
+ ...styles?.element
37
+ }
33
38
  }, properties.label !== false && /*#__PURE__*/ React.createElement(Skeleton, {
34
39
  styles: {
35
40
  element: {
36
- marginBottom: 10
41
+ borderRadius: 'var(--ant-border-radius-sm, 4px)'
37
42
  }
38
43
  },
39
44
  properties: {
@@ -42,7 +47,10 @@ const SkeletonInput = ({ classNames, properties, styles })=>{
42
47
  }
43
48
  }), /*#__PURE__*/ React.createElement(Skeleton, {
44
49
  styles: {
45
- element: styles?.input ?? {}
50
+ element: {
51
+ borderRadius: 'var(--ant-border-radius, 6px)',
52
+ ...styles?.input
53
+ }
46
54
  },
47
55
  properties: {
48
56
  width: properties.width ?? '100%',
@@ -23,18 +23,16 @@ const SkeletonParagraph = ({ classNames, properties, styles })=>{
23
23
  className: classNames?.element,
24
24
  style: {
25
25
  width: properties.width ?? '100%',
26
+ display: 'flex',
27
+ flexDirection: 'column',
28
+ gap: '0.75rem',
26
29
  ...styles?.element
27
30
  }
28
31
  }, lines.map((key)=>/*#__PURE__*/ React.createElement(Skeleton, {
29
32
  key: key,
30
- styles: {
31
- element: {
32
- marginBottom: '1rem'
33
- }
34
- },
35
33
  properties: {
36
- height: '1.25rem',
37
- width: key === lines.length - 1 && key !== 0 ? '40%' : '100%'
34
+ height: '0.875rem',
35
+ width: key === lines.length - 1 && key !== 0 ? '60%' : '100%'
38
36
  }
39
37
  })));
40
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/blocks-loaders",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy loader blocks.",
6
6
  "homepage": "https://lowdefy.com",
@@ -42,16 +42,16 @@
42
42
  "dist/*"
43
43
  ],
44
44
  "dependencies": {
45
- "@lowdefy/block-utils": "5.0.0",
46
- "@lowdefy/helpers": "5.0.0"
45
+ "@lowdefy/block-utils": "5.2.0",
46
+ "@lowdefy/helpers": "5.2.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": ">=18",
50
50
  "react-dom": ">=18"
51
51
  },
52
52
  "devDependencies": {
53
- "@lowdefy/block-dev-e2e": "5.0.0",
54
- "@lowdefy/e2e-utils": "5.0.0",
53
+ "@lowdefy/block-dev-e2e": "5.2.0",
54
+ "@lowdefy/e2e-utils": "5.2.0",
55
55
  "@playwright/test": "1.50.1",
56
56
  "@swc/cli": "0.8.0",
57
57
  "@swc/core": "1.15.18",