@skel-ui/react 0.2.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();
@@ -63,7 +63,7 @@ Each `Skel.Item` will have a `data-loading` attribute that is set to `"true"` wh
63
63
  width: 5rem;
64
64
  }
65
65
 
66
- /* This style will be applied after loading is complete. */
66
+ /* This style will be applied after loading is done. */
67
67
  .user-email[data-loading="false"]:hover {
68
68
  background: #f97316;
69
69
  }
package/dist/cjs/index.js CHANGED
@@ -39,7 +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({ as, color, radius, children, ...rest }) {
42
+ function Item({ as, sw, sh, color, radius, children, ...rest }) {
43
43
  const isLoading = import_react.default.useContext(IsLoadingContext);
44
44
  const component = as || "p";
45
45
  const Component = typeof component === "string" ? component : isLoading ? "div" : component;
@@ -49,7 +49,8 @@ function Item({ as, color, radius, children, ...rest }) {
49
49
  ...rest,
50
50
  style: {
51
51
  ...rest.style,
52
- "--skel-ui-color": color,
52
+ "--skel-ui-width": sw,
53
+ "--skel-ui-height": sh,
53
54
  "--skel-ui-radius": radius
54
55
  },
55
56
  "data-loading": isLoading,
package/dist/esm/index.js CHANGED
@@ -5,7 +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({ as, color, radius, children, ...rest }) {
8
+ function Item({ as, sw, sh, color, radius, children, ...rest }) {
9
9
  const isLoading = React.useContext(IsLoadingContext);
10
10
  const component = as || "p";
11
11
  const Component = typeof component === "string" ? component : isLoading ? "div" : component;
@@ -15,7 +15,8 @@ function Item({ as, color, radius, children, ...rest }) {
15
15
  ...rest,
16
16
  style: {
17
17
  ...rest.style,
18
- "--skel-ui-color": color,
18
+ "--skel-ui-width": sw,
19
+ "--skel-ui-height": sh,
19
20
  "--skel-ui-radius": radius
20
21
  },
21
22
  "data-loading": isLoading,
package/dist/index.d.ts CHANGED
@@ -7,12 +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
- color?: string;
10
+ sw?: string;
11
+ sh?: string;
11
12
  radius?: string;
12
13
  children?: React.ReactNode | (() => React.ReactNode);
13
14
  } & HTMLProps<T>;
14
- declare function Root<T extends React.ElementType = "div">({ as, isLoading, children, ...rest }: RootProps<T>): React.JSX.Element;
15
- declare function Item<T extends React.ElementType = "p">({ as, color, radius, children, ...rest }: ItemProps<T>): React.JSX.Element;
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, sw, sh, color, radius, children, ...rest }: ItemProps<T>): import("react/jsx-runtime").JSX.Element;
16
17
  export declare function generatePlaceholder<T = {
17
18
  [k: string]: unknown;
18
19
  }>(length: number, primary: string): T[];
package/dist/styles.css CHANGED
@@ -12,13 +12,15 @@
12
12
  var(--skel-ui-shimmer),
13
13
  var(--skel-ui-color) 66%);
14
14
  background-size: 300%;
15
+ width: var(--skel-ui-width);
16
+ height: var(--skel-ui-height);
15
17
  border-radius: var(--skel-ui-radius);
16
18
  cursor: default !important;
17
19
  user-select: none !important;
18
20
  pointer-events: none !important;
19
21
  }
20
22
  .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;
23
+ animation: skel-ui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
22
24
  background-color: var(--skel-ui-color) !important;
23
25
  }
24
26
  @keyframes skel-ui-pulse {
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.2.0",
4
+ "version": "0.3.1",
5
5
  "license": "MIT",
6
6
  "description": "Next era of skeleton loading for React",
7
7
  "files": [
@@ -27,7 +27,8 @@
27
27
  "import": "./dist/esm/tailwind.js",
28
28
  "require": "./dist/cjs/tailwind.js"
29
29
  },
30
- "./styles.css": "./dist/styles.css"
30
+ "./styles.css": "./dist/styles.css",
31
+ "./$components": "./stories/components/index.tsx"
31
32
  },
32
33
  "bugs": {
33
34
  "url": "https://github.com/sudoaugustin/skel-ui/issues"
@@ -55,8 +56,7 @@
55
56
  "react-dom": "^18.3.1",
56
57
  "storybook": "^8.3.4",
57
58
  "tailwindcss": "^3.4.13",
58
- "typescript": "^5.6.2",
59
- "hooks": "0.0.1"
59
+ "typescript": "^5.6.2"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^17.0 || ^18.0",