@skel-ui/react 1.0.0-alpha.9f753ec → 1.0.0-alpha.a8d28e6

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/dist/cjs/index.js CHANGED
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var src_exports = {};
31
- __export(src_exports, {
32
- Custom: () => Custom,
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ Item: () => Item,
33
33
  Root: () => Root,
34
34
  a: () => a,
35
35
  address: () => address,
@@ -130,7 +130,7 @@ __export(src_exports, {
130
130
  wbr: () => wbr,
131
131
  webview: () => webview
132
132
  });
133
- module.exports = __toCommonJS(src_exports);
133
+ module.exports = __toCommonJS(index_exports);
134
134
  var import_core = require("@skel-ui/core");
135
135
  var import_react = __toESM(require("react"));
136
136
  function createSkelComponent(type, isVoidTag = false) {
@@ -139,7 +139,7 @@ function createSkelComponent(type, isVoidTag = false) {
139
139
  const loadingStyle = isLoading ? {
140
140
  width: sw,
141
141
  height: sh,
142
- borderRadius: sr || "var(--skel-ui-radius)",
142
+ borderRadius: sr,
143
143
  color: "transparent",
144
144
  cursor: "default",
145
145
  userSelect: "none",
@@ -152,8 +152,8 @@ function createSkelComponent(type, isVoidTag = false) {
152
152
  style: { ...style, ...loadingStyle },
153
153
  "aria-hidden": isLoading,
154
154
  "data-loading": isLoading,
155
- // Use base64 transparent image while loading to avoid broken image ui. This doesn't trigger error on other media tags.
156
- ...isLoading && "src" in props && props.src === void 0 ? {
155
+ // Use base64 transparent image while loading to avoid broken image ui for falsy src. This doesn't trigger error on other media tags.
156
+ ...isLoading && "src" in props ? {
157
157
  src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgEB/6mZBQAAAABJRU5ErkJggg=="
158
158
  } : {}
159
159
  },
@@ -161,11 +161,11 @@ function createSkelComponent(type, isVoidTag = false) {
161
161
  );
162
162
  };
163
163
  }
164
- function SkelCustom({ as, ...rest }) {
164
+ function SkelItem({ as, ...rest }) {
165
165
  return createSkelComponent(as)(rest);
166
166
  }
167
167
  const Root = import_core.SkelRoot;
168
- const Custom = SkelCustom;
168
+ const Item = SkelItem;
169
169
  const a = createSkelComponent("a");
170
170
  const address = createSkelComponent("address");
171
171
  const article = createSkelComponent("article");
package/dist/esm/index.js CHANGED
@@ -7,7 +7,7 @@ function createSkelComponent(type, isVoidTag = false) {
7
7
  const loadingStyle = isLoading ? {
8
8
  width: sw,
9
9
  height: sh,
10
- borderRadius: sr || "var(--skel-ui-radius)",
10
+ borderRadius: sr,
11
11
  color: "transparent",
12
12
  cursor: "default",
13
13
  userSelect: "none",
@@ -20,8 +20,8 @@ function createSkelComponent(type, isVoidTag = false) {
20
20
  style: { ...style, ...loadingStyle },
21
21
  "aria-hidden": isLoading,
22
22
  "data-loading": isLoading,
23
- // Use base64 transparent image while loading to avoid broken image ui. This doesn't trigger error on other media tags.
24
- ...isLoading && "src" in props && props.src === void 0 ? {
23
+ // Use base64 transparent image while loading to avoid broken image ui for falsy src. This doesn't trigger error on other media tags.
24
+ ...isLoading && "src" in props ? {
25
25
  src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgEB/6mZBQAAAABJRU5ErkJggg=="
26
26
  } : {}
27
27
  },
@@ -29,11 +29,11 @@ function createSkelComponent(type, isVoidTag = false) {
29
29
  );
30
30
  };
31
31
  }
32
- function SkelCustom({ as, ...rest }) {
32
+ function SkelItem({ as, ...rest }) {
33
33
  return createSkelComponent(as)(rest);
34
34
  }
35
35
  const Root = SkelRoot;
36
- const Custom = SkelCustom;
36
+ const Item = SkelItem;
37
37
  const a = createSkelComponent("a");
38
38
  const address = createSkelComponent("address");
39
39
  const article = createSkelComponent("article");
@@ -133,7 +133,7 @@ const video = createSkelComponent("video");
133
133
  const wbr = createSkelComponent("wbr", true);
134
134
  const webview = createSkelComponent("webview");
135
135
  export {
136
- Custom,
136
+ Item,
137
137
  Root,
138
138
  a,
139
139
  address,
@@ -1,12 +1,12 @@
1
1
  import { SkelComponentProps, SkelRoot } from "@skel-ui/core";
2
2
  import type { ComponentProps, ComponentType } from "react";
3
3
  import React from "react";
4
- type SkelCustomProps<T extends ComponentType<ComponentProps<T>>> = {
4
+ type SkelItemProps<T extends ComponentType<ComponentProps<T>>> = {
5
5
  as: T;
6
6
  } & ComponentProps<T> & Pick<SkelComponentProps<T>, "sw" | "sh" | "sr">;
7
- declare function SkelCustom<T extends ComponentType<ComponentProps<T>>>({ as, ...rest }: SkelCustomProps<T>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
7
+ declare function SkelItem<T extends ComponentType<ComponentProps<T>>>({ as, ...rest }: SkelItemProps<T>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
8
8
  export declare const Root: typeof SkelRoot;
9
- export declare const Custom: typeof SkelCustom;
9
+ export declare const Item: typeof SkelItem;
10
10
  export declare const a: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"a">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
11
  export declare const address: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"address">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
12
  export declare const article: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"article">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
package/dist/styles.css CHANGED
@@ -1,22 +1,25 @@
1
1
  :root {
2
- --skel-ui-color1: #cbd5e1;
3
- --skel-ui-color2: #f1f0f0;
2
+ --skel-ui-color: #cbd5e1;
4
3
  --skel-ui-radius: 0.25rem;
4
+ --skel-ui-animation-delay: 0s;
5
5
  --skel-ui-animation-easing: cubic-bezier(0.4, 0, 0.6, 1);
6
6
  }
7
- [aria-hidden=true][data-loading=true] {
8
- animation: skel-ui-shimmer var(--skel-ui-animation-duration, 2s) var(--skel-ui-animation-easing) infinite !important;
7
+ [data-loading=true] {
8
+ border-radius: var(--skel-ui-radius);
9
+ }
10
+ [data-loading=true] {
11
+ animation: skel-ui-shimmer var(--skel-ui-animation-duration, 2s) var(--skel-ui-animation-easing) var(--skel-ui-animation-delay) infinite !important;
9
12
  background-image:
10
13
  linear-gradient(
11
14
  to right,
12
- var(--skel-ui-color1) 33%,
13
- var(--skel-ui-color2),
14
- var(--skel-ui-color1) 66%);
15
+ var(--skel-ui-color) 33%,
16
+ var(--skel-ui-shimmer-color, #f1f0f0),
17
+ var(--skel-ui-color) 66%);
15
18
  background-size: 300%;
16
19
  }
17
- .skel-ui-pulse [aria-hidden=true][data-loading=true] {
18
- animation: skel-ui-pulse var(--skel-ui-animation-duration, 1s) var(--skel-ui-animation-easing) infinite alternate-reverse !important;
19
- background-color: var(--skel-ui-color1);
20
+ .skel-ui-pulse [data-loading=true] {
21
+ animation: skel-ui-pulse var(--skel-ui-animation-duration, 1s) var(--skel-ui-animation-easing) var(--skel-ui-animation-delay) infinite alternate-reverse !important;
22
+ background-color: var(--skel-ui-color);
20
23
  }
21
24
  @keyframes skel-ui-pulse {
22
25
  0% {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@skel-ui/react",
3
3
  "author": "https://github.com/sudoaugustin",
4
- "version": "1.0.0-alpha.9f753ec",
4
+ "version": "1.0.0-alpha.a8d28e6",
5
5
  "license": "MIT",
6
- "description": "Next era of skeleton loading for React",
6
+ "description": "Small but mighty skeleton loading for React",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -35,6 +35,16 @@
35
35
  "./styles.css": "./dist/styles.css",
36
36
  "./$components": "./stories/components/index.tsx"
37
37
  },
38
+ "typesVersions": {
39
+ "*": {
40
+ "utils": [
41
+ "./dist/utils.d.ts"
42
+ ],
43
+ "tailwind": [
44
+ "./dist/tailwind.d.ts"
45
+ ]
46
+ }
47
+ },
38
48
  "bugs": {
39
49
  "url": "https://github.com/sudoaugustin/skel-ui/issues"
40
50
  },
@@ -64,9 +74,9 @@
64
74
  "storybook": "^8.3.4",
65
75
  "tailwindcss": "^3.4.13",
66
76
  "typescript": "^5.7.2",
67
- "commons-tsconfig": "0.0.1",
77
+ "@skel-ui/core": "1.0.0",
68
78
  "commons-utils": "0.0.1",
69
- "@skel-ui/core": "1.0.0"
79
+ "commons-tsconfig": "0.0.1"
70
80
  },
71
81
  "peerDependencies": {
72
82
  "react": "^17.0 || ^18.0",
@@ -75,7 +85,7 @@
75
85
  "scripts": {
76
86
  "dev": "storybook dev -p 6006 --no-open",
77
87
  "build": "rm -rf dist && pnpm build:dts && pnpm build:css && pnpm build:esm && pnpm build:cjs",
78
- "build:dts": "tsc -p tsconfig.json --outDir dist --emitDeclarationOnly",
88
+ "build:dts": "tsc -p tsconfig.build.json --outDir dist",
79
89
  "build:css": "esbuild src/styles.css --outdir=dist",
80
90
  "build:esm": "esbuild src/*.ts* --format=esm --outdir=dist/esm",
81
91
  "build:cjs": "esbuild src/*.ts* --format=cjs --outdir=dist/cjs"
@@ -1 +0,0 @@
1
- export default function Animations(): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- import { ImgHTMLAttributes } from "react";
2
- type Props = ImgHTMLAttributes<HTMLImageElement>;
3
- export default function Image({ ...rest }: Props): import("react/jsx-runtime").JSX.Element;
4
- export {};
@@ -1,5 +0,0 @@
1
- type Props = {
2
- isLoading?: boolean;
3
- };
4
- export default function PostCard(props: Props): import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1 +0,0 @@
1
- export default function PostCardList(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- import Animations from "./Animations";
2
- import Image from "./Image";
3
- import PostCard from "./PostCard";
4
- import PostCardList from "./PostCardList";
5
- export { Animations, Image, PostCard, PostCardList };
@@ -1,8 +0,0 @@
1
- import "../src/styles.css";
2
- import { Animations, PostCard, PostCardList } from "./components";
3
- declare const _default: {
4
- title: string;
5
- component: typeof import("@skel-ui/core").SkelRoot;
6
- };
7
- export default _default;
8
- export { Animations, PostCard, PostCardList };
File without changes
File without changes