@skel-ui/react 0.3.0 → 0.3.1
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 +3 -11
- package/dist/esm/index.js +3 -11
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -39,15 +39,7 @@ function Root({ as, isLoading = true, children, ...rest }) {
|
|
|
39
39
|
const Component = as || "div";
|
|
40
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 }) });
|
|
41
41
|
}
|
|
42
|
-
function Item({
|
|
43
|
-
as,
|
|
44
|
-
color,
|
|
45
|
-
width,
|
|
46
|
-
height,
|
|
47
|
-
radius,
|
|
48
|
-
children,
|
|
49
|
-
...rest
|
|
50
|
-
}) {
|
|
42
|
+
function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
51
43
|
const isLoading = import_react.default.useContext(IsLoadingContext);
|
|
52
44
|
const component = as || "p";
|
|
53
45
|
const Component = typeof component === "string" ? component : isLoading ? "div" : component;
|
|
@@ -57,8 +49,8 @@ function Item({
|
|
|
57
49
|
...rest,
|
|
58
50
|
style: {
|
|
59
51
|
...rest.style,
|
|
60
|
-
"--skel-ui-width":
|
|
61
|
-
"--skel-ui-height":
|
|
52
|
+
"--skel-ui-width": sw,
|
|
53
|
+
"--skel-ui-height": sh,
|
|
62
54
|
"--skel-ui-radius": radius
|
|
63
55
|
},
|
|
64
56
|
"data-loading": isLoading,
|
package/dist/esm/index.js
CHANGED
|
@@ -5,15 +5,7 @@ function Root({ as, isLoading = true, children, ...rest }) {
|
|
|
5
5
|
const Component = as || "div";
|
|
6
6
|
return /* @__PURE__ */ jsx(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ jsx(Component, { ...rest, "data-loading": isLoading, children }) });
|
|
7
7
|
}
|
|
8
|
-
function Item({
|
|
9
|
-
as,
|
|
10
|
-
color,
|
|
11
|
-
width,
|
|
12
|
-
height,
|
|
13
|
-
radius,
|
|
14
|
-
children,
|
|
15
|
-
...rest
|
|
16
|
-
}) {
|
|
8
|
+
function Item({ as, sw, sh, color, radius, children, ...rest }) {
|
|
17
9
|
const isLoading = React.useContext(IsLoadingContext);
|
|
18
10
|
const component = as || "p";
|
|
19
11
|
const Component = typeof component === "string" ? component : isLoading ? "div" : component;
|
|
@@ -23,8 +15,8 @@ function Item({
|
|
|
23
15
|
...rest,
|
|
24
16
|
style: {
|
|
25
17
|
...rest.style,
|
|
26
|
-
"--skel-ui-width":
|
|
27
|
-
"--skel-ui-height":
|
|
18
|
+
"--skel-ui-width": sw,
|
|
19
|
+
"--skel-ui-height": sh,
|
|
28
20
|
"--skel-ui-radius": radius
|
|
29
21
|
},
|
|
30
22
|
"data-loading": isLoading,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ type RootProps<T extends React.ElementType = "div"> = {
|
|
|
7
7
|
} & HTMLProps<T>;
|
|
8
8
|
type ItemProps<T extends React.ElementType = "p"> = {
|
|
9
9
|
as?: T;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
sw?: string;
|
|
11
|
+
sh?: string;
|
|
12
12
|
radius?: string;
|
|
13
13
|
children?: React.ReactNode | (() => React.ReactNode);
|
|
14
14
|
} & HTMLProps<T>;
|
|
15
15
|
declare function Root<T extends React.ElementType = "div">({ as, isLoading, children, ...rest }: RootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare function Item<T extends React.ElementType = "p">({ as,
|
|
16
|
+
declare function Item<T extends React.ElementType = "p">({ as, sw, sh, color, radius, children, ...rest }: ItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export declare function generatePlaceholder<T = {
|
|
18
18
|
[k: string]: unknown;
|
|
19
19
|
}>(length: number, primary: string): T[];
|