@skel-ui/react 0.2.0 → 0.3.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 CHANGED
@@ -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,15 @@ 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({
43
+ as,
44
+ color,
45
+ width,
46
+ height,
47
+ radius,
48
+ children,
49
+ ...rest
50
+ }) {
43
51
  const isLoading = import_react.default.useContext(IsLoadingContext);
44
52
  const component = as || "p";
45
53
  const Component = typeof component === "string" ? component : isLoading ? "div" : component;
@@ -49,7 +57,8 @@ function Item({ as, color, radius, children, ...rest }) {
49
57
  ...rest,
50
58
  style: {
51
59
  ...rest.style,
52
- "--skel-ui-color": color,
60
+ "--skel-ui-width": width,
61
+ "--skel-ui-height": height,
53
62
  "--skel-ui-radius": radius
54
63
  },
55
64
  "data-loading": isLoading,
package/dist/esm/index.js CHANGED
@@ -5,7 +5,15 @@ 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({
9
+ as,
10
+ color,
11
+ width,
12
+ height,
13
+ radius,
14
+ children,
15
+ ...rest
16
+ }) {
9
17
  const isLoading = React.useContext(IsLoadingContext);
10
18
  const component = as || "p";
11
19
  const Component = typeof component === "string" ? component : isLoading ? "div" : component;
@@ -15,7 +23,8 @@ function Item({ as, color, radius, children, ...rest }) {
15
23
  ...rest,
16
24
  style: {
17
25
  ...rest.style,
18
- "--skel-ui-color": color,
26
+ "--skel-ui-width": width,
27
+ "--skel-ui-height": height,
19
28
  "--skel-ui-radius": radius
20
29
  },
21
30
  "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
+ width?: string;
11
+ height?: 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, color, width, height, 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.0",
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",