@skel-ui/react 0.1.2 → 0.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.
package/dist/cjs/index.js CHANGED
@@ -48,19 +48,18 @@ function Item({ as, color, radius, children, ...rest }) {
48
48
  {
49
49
  ...rest,
50
50
  style: {
51
- // @ts-ignore
52
51
  ...rest.style,
53
52
  "--skel-ui-color": color,
54
53
  "--skel-ui-radius": radius
55
54
  },
56
55
  "data-loading": isLoading,
57
56
  "data-skel-item": true,
58
- children: isLoading ? "\u200C" : typeof children === "function" ? children() : children
57
+ children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
59
58
  }
60
59
  );
61
60
  }
62
61
  function generatePlaceholder(length, primary) {
63
- return Array(length).fill(null).map((_, index) => ({ [primary]: `id-${index}` }));
62
+ return Array(length).fill(null).map((_, index) => ({ [primary]: `skel-ui-id-${index}` }));
64
63
  }
65
64
  const Skel = { Root, Item };
66
65
  var src_default = Skel;
package/dist/esm/index.js CHANGED
@@ -14,19 +14,18 @@ function Item({ as, color, radius, children, ...rest }) {
14
14
  {
15
15
  ...rest,
16
16
  style: {
17
- // @ts-ignore
18
17
  ...rest.style,
19
18
  "--skel-ui-color": color,
20
19
  "--skel-ui-radius": radius
21
20
  },
22
21
  "data-loading": isLoading,
23
22
  "data-skel-item": true,
24
- children: isLoading ? "\u200C" : typeof children === "function" ? children() : children
23
+ children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
25
24
  }
26
25
  );
27
26
  }
28
27
  function generatePlaceholder(length, primary) {
29
- return Array(length).fill(null).map((_, index) => ({ [primary]: `id-${index}` }));
28
+ return Array(length).fill(null).map((_, index) => ({ [primary]: `skel-ui-id-${index}` }));
30
29
  }
31
30
  const Skel = { Root, Item };
32
31
  var src_default = Skel;
package/dist/styles.css CHANGED
@@ -1,21 +1,42 @@
1
1
  :root {
2
2
  --skel-ui-color: #cbd5e1;
3
+ --skel-ui-shimmer: #f1f0f0;
3
4
  --skel-ui-radius: 0.25rem;
4
5
  }
5
6
  [data-skel-item][data-loading=true] {
7
+ animation: skel-ui-shimmer 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
8
+ background:
9
+ linear-gradient(
10
+ to right,
11
+ var(--skel-ui-color) 33%,
12
+ var(--skel-ui-shimmer),
13
+ var(--skel-ui-color) 66%);
14
+ background-size: 300%;
6
15
  border-radius: var(--skel-ui-radius);
7
- background-color: var(--skel-ui-color) !important;
8
- color: transparent !important;
9
16
  cursor: default !important;
10
17
  user-select: none !important;
11
18
  pointer-events: none !important;
12
- animation: skel-ui-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate-reverse !important;
19
+ }
20
+ .skel-ui-pluse [data-skel-item][data-loading=true] {
21
+ animation: skel-ui-pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
22
+ background-color: var(--skel-ui-color) !important;
13
23
  }
14
24
  @keyframes skel-ui-pulse {
15
25
  0% {
16
26
  opacity: 1;
17
27
  }
18
- 100% {
28
+ 50% {
19
29
  opacity: 0.5;
20
30
  }
31
+ 100% {
32
+ opacity: 1;
33
+ }
34
+ }
35
+ @keyframes skel-ui-shimmer {
36
+ 0% {
37
+ background-position: 100%;
38
+ }
39
+ 100% {
40
+ background-position: 0%;
41
+ }
21
42
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skel-ui/react",
3
3
  "author": "https://github.com/sudoaugustin",
4
- "version": "0.1.2",
4
+ "version": "0.2.0",
5
5
  "license": "MIT",
6
6
  "description": "Next era of skeleton loading for React",
7
7
  "files": [
@@ -39,23 +39,24 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@chromatic-com/storybook": "^1.9.0",
42
- "@storybook/addon-essentials": "^8.3.3",
43
- "@storybook/addon-interactions": "^8.3.3",
44
- "@storybook/addon-links": "^8.3.3",
45
- "@storybook/addon-onboarding": "^8.3.3",
46
- "@storybook/blocks": "^8.3.3",
47
- "@storybook/react": "^8.3.3",
48
- "@storybook/react-vite": "^8.3.3",
49
- "@storybook/test": "^8.3.3",
50
- "@types/react": "^18.3.9",
51
- "@types/react-dom": "^18.0.10",
42
+ "@heroicons/react": "^2.1.5",
43
+ "@storybook/addon-essentials": "^8.3.4",
44
+ "@storybook/addon-interactions": "^8.3.4",
45
+ "@storybook/addon-links": "^8.3.4",
46
+ "@storybook/addon-onboarding": "^8.3.4",
47
+ "@storybook/blocks": "^8.3.4",
48
+ "@storybook/react": "^8.3.4",
49
+ "@storybook/react-vite": "^8.3.4",
50
+ "@storybook/test": "^8.3.4",
51
+ "@types/react": "^18.2.0",
52
+ "@types/react-dom": "^18.2.0",
52
53
  "esbuild": "^0.24.0",
53
- "react": "^17.0.0",
54
- "react-dom": "^17.0.0",
55
- "storybook": "^8.3.3",
56
- "swr": "^2.2.5",
54
+ "react": "^18.3.1",
55
+ "react-dom": "^18.3.1",
56
+ "storybook": "^8.3.4",
57
57
  "tailwindcss": "^3.4.13",
58
- "typescript": "^5.6.2"
58
+ "typescript": "^5.6.2",
59
+ "hooks": "0.0.1"
59
60
  },
60
61
  "peerDependencies": {
61
62
  "react": "^17.0 || ^18.0",