@skel-ui/react 0.3.1 → 0.4.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/README.md +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/styles.css +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var import_react = __toESM(require("react"));
|
|
|
37
37
|
const IsLoadingContext = import_react.default.createContext(false);
|
|
38
38
|
function Root({ as, isLoading = true, children, ...rest }) {
|
|
39
39
|
const Component = as || "div";
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...rest, "data-loading": isLoading, children }) });
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...rest, "aria-hidden": isLoading, "data-loading": isLoading, children }) });
|
|
41
41
|
}
|
|
42
42
|
function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
43
43
|
const isLoading = import_react.default.useContext(IsLoadingContext);
|
|
@@ -53,6 +53,7 @@ function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
|
53
53
|
"--skel-ui-height": sh,
|
|
54
54
|
"--skel-ui-radius": radius
|
|
55
55
|
},
|
|
56
|
+
"aria-hidden": isLoading,
|
|
56
57
|
"data-loading": isLoading,
|
|
57
58
|
"data-skel-item": true,
|
|
58
59
|
children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
const IsLoadingContext = React.createContext(false);
|
|
4
4
|
function Root({ as, isLoading = true, children, ...rest }) {
|
|
5
5
|
const Component = as || "div";
|
|
6
|
-
return /* @__PURE__ */ jsx(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ jsx(Component, { ...rest, "data-loading": isLoading, children }) });
|
|
6
|
+
return /* @__PURE__ */ jsx(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ jsx(Component, { ...rest, "aria-hidden": isLoading, "data-loading": isLoading, children }) });
|
|
7
7
|
}
|
|
8
8
|
function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
9
9
|
const isLoading = React.useContext(IsLoadingContext);
|
|
@@ -19,6 +19,7 @@ function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
|
19
19
|
"--skel-ui-height": sh,
|
|
20
20
|
"--skel-ui-radius": radius
|
|
21
21
|
},
|
|
22
|
+
"aria-hidden": isLoading,
|
|
22
23
|
"data-loading": isLoading,
|
|
23
24
|
"data-skel-item": true,
|
|
24
25
|
children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
|
package/dist/styles.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--skel-ui-
|
|
3
|
-
--skel-ui-
|
|
2
|
+
--skel-ui-color1: #cbd5e1;
|
|
3
|
+
--skel-ui-color2: #f1f0f0;
|
|
4
4
|
--skel-ui-radius: 0.25rem;
|
|
5
5
|
}
|
|
6
6
|
[data-skel-item][data-loading=true] {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
background:
|
|
9
9
|
linear-gradient(
|
|
10
10
|
to right,
|
|
11
|
-
var(--skel-ui-
|
|
12
|
-
var(--skel-ui-
|
|
13
|
-
var(--skel-ui-
|
|
11
|
+
var(--skel-ui-color1) 33%,
|
|
12
|
+
var(--skel-ui-color2),
|
|
13
|
+
var(--skel-ui-color1) 66%);
|
|
14
14
|
background-size: 300%;
|
|
15
15
|
width: var(--skel-ui-width);
|
|
16
16
|
height: var(--skel-ui-height);
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
user-select: none !important;
|
|
20
20
|
pointer-events: none !important;
|
|
21
21
|
}
|
|
22
|
-
.skel-ui-
|
|
22
|
+
.skel-ui-pulse [data-skel-item][data-loading=true] {
|
|
23
23
|
animation: skel-ui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
|
|
24
|
-
background-color: var(--skel-ui-
|
|
24
|
+
background-color: var(--skel-ui-color1) !important;
|
|
25
25
|
}
|
|
26
26
|
@keyframes skel-ui-pulse {
|
|
27
27
|
0% {
|
|
28
28
|
opacity: 1;
|
|
29
29
|
}
|
|
30
30
|
50% {
|
|
31
|
-
opacity: 0.
|
|
31
|
+
opacity: 0.25;
|
|
32
32
|
}
|
|
33
33
|
100% {
|
|
34
34
|
opacity: 1;
|