@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 CHANGED
@@ -24,7 +24,7 @@ Now you are ready to develop your UI.
24
24
 
25
25
  ```jsx
26
26
  import Skel from "@skel-ui/react";
27
- import Image from "next/Image";
27
+ import Image from "next/image";
28
28
 
29
29
  function Profile() {
30
30
  const { user, isLoading } = useProfile();
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": width,
61
- "--skel-ui-height": 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": width,
27
- "--skel-ui-height": 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
- width?: string;
11
- height?: string;
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, color, width, height, radius, children, ...rest }: ItemProps<T>): import("react/jsx-runtime").JSX.Element;
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[];
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.3.0",
4
+ "version": "0.3.1",
5
5
  "license": "MIT",
6
6
  "description": "Next era of skeleton loading for React",
7
7
  "files": [