@skel-ui/react 0.4.0 → 1.0.0-alpha.01475df

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
@@ -1,42 +1,39 @@
1
- # Getting Started
1
+ Skel UI resolves the challenges of implementing skeletons by eliminating the need to create dedicated loading screens and providing an easier way to manage skeleton states using React Context.
2
2
 
3
- Skel UI resolves the challenges of implementing skeletons by eliminating the need to create dedicated loading screens and providing an easier way to manage skeleton states using react-context. Learn more [here](https://skel-ui.augustin.zip).
3
+ See the comparision [here](https://skel-ui.augustin.zip/#comparision).
4
4
 
5
- ## Installation
5
+ ## Get Started
6
6
 
7
- Install the package into your project via command line.
8
-
9
- ```bash
10
- npm install @skel-ui/react
11
- ```
12
-
13
- ## Importing CSS
7
+ ### Import CSS
14
8
 
15
9
  Import the CSS file into the root of your application.
16
10
 
17
- ```js
11
+ ```ts
18
12
  import "@skel-ui/react/styles.css";
19
13
  ```
20
14
 
21
- ## Start crafting UI
15
+ ### Implement Skel UI
22
16
 
23
- Now you are ready to develop your UI.
17
+ Now it's time for you to craft your user interface to life!
24
18
 
25
- ```jsx
26
- import Skel from "@skel-ui/react";
27
- import Image from "next/image";
19
+ ```tsx
20
+ import * as Skel from "@skel-ui/react";
21
+ import Image from "@ui/image";
28
22
 
29
- function Profile() {
30
- const { user, isLoading } = useProfile();
23
+ export default function PostCard() {
24
+ const { post, isLoading } = usePost();
31
25
 
32
26
  return (
33
27
  <Skel.Root isLoading={isLoading}>
34
- <Skel.Item className="user-avatar">
35
- <Image src={user.profile} />
36
- </Skel.Item>
37
- <Skel.Item as="h1" className="user-email">
38
- {user.email}
39
- </Skel.Item>
28
+ <div className="group w-full max-w-80 p-2.5 bg-white border border-slate-200 rounded-lg overflow-hidden duration-300">
29
+ <Skel.Item
30
+ as={Image}
31
+ src={post?.image}
32
+ className="rounded aspect-[800/530] duration-150 loaded:group-hover:scale-110"
33
+ />
34
+ <Skel.h1 className="text-xl font-bold mt-4 loading:max-w-48">{post?.title}</Skel.h1>
35
+ <Skel.p className="text-sm my-2 loading:h-[3.75rem]">{post?.description}</Skel.p>
36
+ </div>
40
37
  </Skel.Root>
41
38
  );
42
39
  }
@@ -44,27 +41,6 @@ function Profile() {
44
41
 
45
42
  Now, not only have you designed the skeleton, but you have also done the actual UI. Additionally, the skeleton state for the entire UI is handled in a single place at the `<Skel.Root>` .
46
43
 
47
- ## Customization
48
44
 
49
- Customize the default color and border-radius of skeleton using css variables.
50
-
51
- ```css title="global.css"
52
- :root {
53
- --skel-ui-color1: #cbd5e1;
54
- --skel-ui-radius: 0.5rem;
55
- }
56
- ```
57
45
 
58
- Each `Skel.Item` will have a `data-loading` attribute that is set to `"true"` when the item is in a loading state, and `"false"` otherwise. You can use this attribute in your CSS to create styles based on the loading state.
59
-
60
- ```css
61
- /* This style will be applied during loading. */
62
- .user-email[data-loading="true"] {
63
- width: 5rem;
64
- }
65
-
66
- /* This style will be applied after loading is done. */
67
- .user-email[data-loading="false"]:hover {
68
- background: #f97316;
69
- }
70
- ```
46
+ For full documentation, visit [skel-ui.augustin.zip](https://skel-ui.augustin.zip/)
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ "use client";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -26,42 +27,240 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
27
  mod
27
28
  ));
28
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
31
- default: () => src_default,
32
- generatePlaceholder: () => generatePlaceholder
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ Item: () => Item,
33
+ Root: () => Root,
34
+ a: () => a,
35
+ address: () => address,
36
+ article: () => article,
37
+ aside: () => aside,
38
+ b: () => b,
39
+ bdi: () => bdi,
40
+ bdo: () => bdo,
41
+ blockquote: () => blockquote,
42
+ br: () => br,
43
+ button: () => button,
44
+ canvas: () => canvas,
45
+ caption: () => caption,
46
+ cite: () => cite,
47
+ code: () => code,
48
+ col: () => col,
49
+ colgroup: () => colgroup,
50
+ data: () => data,
51
+ datalist: () => datalist,
52
+ dd: () => dd,
53
+ del: () => del,
54
+ details: () => details,
55
+ dfn: () => dfn,
56
+ dialog: () => dialog,
57
+ div: () => div,
58
+ dl: () => dl,
59
+ dt: () => dt,
60
+ em: () => em,
61
+ embed: () => embed,
62
+ fieldset: () => fieldset,
63
+ figcaption: () => figcaption,
64
+ figure: () => figure,
65
+ footer: () => footer,
66
+ form: () => form,
67
+ h1: () => h1,
68
+ h2: () => h2,
69
+ h3: () => h3,
70
+ h4: () => h4,
71
+ h5: () => h5,
72
+ h6: () => h6,
73
+ header: () => header,
74
+ hgroup: () => hgroup,
75
+ hr: () => hr,
76
+ i: () => i,
77
+ iframe: () => iframe,
78
+ img: () => img,
79
+ input: () => input,
80
+ ins: () => ins,
81
+ kbd: () => kbd,
82
+ label: () => label,
83
+ legend: () => legend,
84
+ li: () => li,
85
+ main: () => main,
86
+ map: () => map,
87
+ mark: () => mark,
88
+ menu: () => menu,
89
+ menuitem: () => menuitem,
90
+ meter: () => meter,
91
+ nav: () => nav,
92
+ object: () => object,
93
+ ol: () => ol,
94
+ optgroup: () => optgroup,
95
+ option: () => option,
96
+ output: () => output,
97
+ p: () => p,
98
+ param: () => param,
99
+ picture: () => picture,
100
+ pre: () => pre,
101
+ progress: () => progress,
102
+ q: () => q,
103
+ rp: () => rp,
104
+ rt: () => rt,
105
+ ruby: () => ruby,
106
+ s: () => s,
107
+ samp: () => samp,
108
+ section: () => section,
109
+ select: () => select,
110
+ small: () => small,
111
+ source: () => source,
112
+ span: () => span,
113
+ strong: () => strong,
114
+ sub: () => sub,
115
+ summary: () => summary,
116
+ sup: () => sup,
117
+ table: () => table,
118
+ tbody: () => tbody,
119
+ td: () => td,
120
+ textarea: () => textarea,
121
+ tfoot: () => tfoot,
122
+ th: () => th,
123
+ thead: () => thead,
124
+ time: () => time,
125
+ tr: () => tr,
126
+ track: () => track,
127
+ u: () => u,
128
+ ul: () => ul,
129
+ video: () => video,
130
+ wbr: () => wbr,
131
+ webview: () => webview
33
132
  });
34
- module.exports = __toCommonJS(src_exports);
35
- var import_jsx_runtime = require("react/jsx-runtime");
133
+ module.exports = __toCommonJS(index_exports);
134
+ var import_core = require("@skel-ui/core");
36
135
  var import_react = __toESM(require("react"));
37
- const IsLoadingContext = import_react.default.createContext(false);
38
- function Root({ as, isLoading = true, children, ...rest }) {
39
- const Component = as || "div";
40
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...rest, "aria-hidden": isLoading, "data-loading": isLoading, children }) });
41
- }
42
- function Item({ as, sw, sh, color, radius, children, ...rest }) {
43
- const isLoading = import_react.default.useContext(IsLoadingContext);
44
- const component = as || "p";
45
- const Component = typeof component === "string" ? component : isLoading ? "div" : component;
46
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
47
- Component,
48
- {
49
- ...rest,
50
- style: {
51
- ...rest.style,
52
- "--skel-ui-width": sw,
53
- "--skel-ui-height": sh,
54
- "--skel-ui-radius": radius
136
+ function createSkelComponent(type, isVoidTag = false) {
137
+ return ({ sw, sh, sr, style, children, ...props }) => {
138
+ const isLoading = import_react.default.useContext(import_core.IsLoadingContext);
139
+ const loadingStyle = isLoading ? {
140
+ width: sw,
141
+ height: sh,
142
+ borderRadius: sr,
143
+ color: "transparent",
144
+ cursor: "default",
145
+ userSelect: "none",
146
+ pointerEvents: "none"
147
+ } : {};
148
+ return import_react.default.createElement(
149
+ type,
150
+ {
151
+ ...props,
152
+ style: { ...style, ...loadingStyle },
153
+ "aria-hidden": isLoading,
154
+ "data-loading": isLoading,
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
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgEB/6mZBQAAAABJRU5ErkJggg=="
158
+ } : {}
55
159
  },
56
- "aria-hidden": isLoading,
57
- "data-loading": isLoading,
58
- "data-skel-item": true,
59
- children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
60
- }
61
- );
160
+ isVoidTag ? void 0 : isLoading && typeof type === "string" ? " \u200C " : children
161
+ );
162
+ };
62
163
  }
63
- function generatePlaceholder(length, primary) {
64
- return Array(length).fill(null).map((_, index) => ({ [primary]: `skel-ui-id-${index}` }));
164
+ function SkelItem({ as, ...rest }) {
165
+ return createSkelComponent(as)(rest);
65
166
  }
66
- const Skel = { Root, Item };
67
- var src_default = Skel;
167
+ const Root = import_core.SkelRoot;
168
+ const Item = SkelItem;
169
+ const a = createSkelComponent("a");
170
+ const address = createSkelComponent("address");
171
+ const article = createSkelComponent("article");
172
+ const aside = createSkelComponent("aside");
173
+ const b = createSkelComponent("b");
174
+ const br = createSkelComponent("br", true);
175
+ const bdi = createSkelComponent("bdi");
176
+ const bdo = createSkelComponent("bdo");
177
+ const blockquote = createSkelComponent("blockquote");
178
+ const button = createSkelComponent("button");
179
+ const canvas = createSkelComponent("canvas");
180
+ const caption = createSkelComponent("caption");
181
+ const cite = createSkelComponent("cite");
182
+ const code = createSkelComponent("code");
183
+ const col = createSkelComponent("col");
184
+ const colgroup = createSkelComponent("colgroup");
185
+ const data = createSkelComponent("data");
186
+ const datalist = createSkelComponent("datalist");
187
+ const dd = createSkelComponent("dd");
188
+ const del = createSkelComponent("del");
189
+ const details = createSkelComponent("details");
190
+ const dfn = createSkelComponent("dfn");
191
+ const dialog = createSkelComponent("dialog");
192
+ const div = createSkelComponent("div");
193
+ const dl = createSkelComponent("dl");
194
+ const dt = createSkelComponent("dt");
195
+ const em = createSkelComponent("em");
196
+ const embed = createSkelComponent("embed", true);
197
+ const fieldset = createSkelComponent("fieldset");
198
+ const figcaption = createSkelComponent("figcaption");
199
+ const figure = createSkelComponent("figure");
200
+ const footer = createSkelComponent("footer");
201
+ const form = createSkelComponent("form");
202
+ const h1 = createSkelComponent("h1");
203
+ const h2 = createSkelComponent("h2");
204
+ const h3 = createSkelComponent("h3");
205
+ const h4 = createSkelComponent("h4");
206
+ const h5 = createSkelComponent("h5");
207
+ const h6 = createSkelComponent("h6");
208
+ const header = createSkelComponent("header");
209
+ const hgroup = createSkelComponent("hgroup");
210
+ const hr = createSkelComponent("hr", true);
211
+ const i = createSkelComponent("i");
212
+ const iframe = createSkelComponent("iframe");
213
+ const img = createSkelComponent("img", true);
214
+ const input = createSkelComponent("input", true);
215
+ const ins = createSkelComponent("ins");
216
+ const kbd = createSkelComponent("kbd");
217
+ const label = createSkelComponent("label");
218
+ const legend = createSkelComponent("legend");
219
+ const li = createSkelComponent("li");
220
+ const main = createSkelComponent("main");
221
+ const map = createSkelComponent("map");
222
+ const mark = createSkelComponent("mark");
223
+ const menu = createSkelComponent("menu");
224
+ const menuitem = createSkelComponent("menuitem");
225
+ const meter = createSkelComponent("meter");
226
+ const nav = createSkelComponent("nav");
227
+ const object = createSkelComponent("object");
228
+ const ol = createSkelComponent("ol");
229
+ const optgroup = createSkelComponent("optgroup");
230
+ const option = createSkelComponent("option");
231
+ const output = createSkelComponent("output");
232
+ const p = createSkelComponent("p");
233
+ const param = createSkelComponent("param");
234
+ const picture = createSkelComponent("picture");
235
+ const pre = createSkelComponent("pre");
236
+ const progress = createSkelComponent("progress");
237
+ const q = createSkelComponent("q");
238
+ const rp = createSkelComponent("rp");
239
+ const rt = createSkelComponent("rt");
240
+ const ruby = createSkelComponent("ruby");
241
+ const s = createSkelComponent("s");
242
+ const samp = createSkelComponent("samp");
243
+ const section = createSkelComponent("section");
244
+ const select = createSkelComponent("select");
245
+ const small = createSkelComponent("small");
246
+ const source = createSkelComponent("source");
247
+ const span = createSkelComponent("span");
248
+ const strong = createSkelComponent("strong");
249
+ const sub = createSkelComponent("sub");
250
+ const summary = createSkelComponent("summary");
251
+ const sup = createSkelComponent("sup");
252
+ const table = createSkelComponent("table");
253
+ const tbody = createSkelComponent("tbody");
254
+ const td = createSkelComponent("td");
255
+ const textarea = createSkelComponent("textarea");
256
+ const tfoot = createSkelComponent("tfoot");
257
+ const th = createSkelComponent("th");
258
+ const thead = createSkelComponent("thead");
259
+ const time = createSkelComponent("time");
260
+ const tr = createSkelComponent("tr");
261
+ const track = createSkelComponent("track");
262
+ const u = createSkelComponent("u");
263
+ const ul = createSkelComponent("ul");
264
+ const video = createSkelComponent("video");
265
+ const wbr = createSkelComponent("wbr", true);
266
+ const webview = createSkelComponent("webview");
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var utils_exports = {};
20
+ __export(utils_exports, {
21
+ generatePlaceholder: () => import_core.generatePlaceholder
22
+ });
23
+ module.exports = __toCommonJS(utils_exports);
24
+ var import_core = require("@skel-ui/core");
package/dist/esm/index.js CHANGED
@@ -1,37 +1,236 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ "use client";
2
+ import { IsLoadingContext, SkelRoot } from "@skel-ui/core";
2
3
  import React from "react";
3
- const IsLoadingContext = React.createContext(false);
4
- function Root({ as, isLoading = true, children, ...rest }) {
5
- const Component = as || "div";
6
- return /* @__PURE__ */ jsx(IsLoadingContext.Provider, { value: isLoading, children: /* @__PURE__ */ jsx(Component, { ...rest, "aria-hidden": isLoading, "data-loading": isLoading, children }) });
7
- }
8
- function Item({ as, sw, sh, color, radius, children, ...rest }) {
9
- const isLoading = React.useContext(IsLoadingContext);
10
- const component = as || "p";
11
- const Component = typeof component === "string" ? component : isLoading ? "div" : component;
12
- return /* @__PURE__ */ jsx(
13
- Component,
14
- {
15
- ...rest,
16
- style: {
17
- ...rest.style,
18
- "--skel-ui-width": sw,
19
- "--skel-ui-height": sh,
20
- "--skel-ui-radius": radius
4
+ function createSkelComponent(type, isVoidTag = false) {
5
+ return ({ sw, sh, sr, style, children, ...props }) => {
6
+ const isLoading = React.useContext(IsLoadingContext);
7
+ const loadingStyle = isLoading ? {
8
+ width: sw,
9
+ height: sh,
10
+ borderRadius: sr,
11
+ color: "transparent",
12
+ cursor: "default",
13
+ userSelect: "none",
14
+ pointerEvents: "none"
15
+ } : {};
16
+ return React.createElement(
17
+ type,
18
+ {
19
+ ...props,
20
+ style: { ...style, ...loadingStyle },
21
+ "aria-hidden": isLoading,
22
+ "data-loading": isLoading,
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
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgEB/6mZBQAAAABJRU5ErkJggg=="
26
+ } : {}
21
27
  },
22
- "aria-hidden": isLoading,
23
- "data-loading": isLoading,
24
- "data-skel-item": true,
25
- children: isLoading ? " \u200C " : typeof children === "function" ? children() : children
26
- }
27
- );
28
+ isVoidTag ? void 0 : isLoading && typeof type === "string" ? " \u200C " : children
29
+ );
30
+ };
28
31
  }
29
- function generatePlaceholder(length, primary) {
30
- return Array(length).fill(null).map((_, index) => ({ [primary]: `skel-ui-id-${index}` }));
32
+ function SkelItem({ as, ...rest }) {
33
+ return createSkelComponent(as)(rest);
31
34
  }
32
- const Skel = { Root, Item };
33
- var src_default = Skel;
35
+ const Root = SkelRoot;
36
+ const Item = SkelItem;
37
+ const a = createSkelComponent("a");
38
+ const address = createSkelComponent("address");
39
+ const article = createSkelComponent("article");
40
+ const aside = createSkelComponent("aside");
41
+ const b = createSkelComponent("b");
42
+ const br = createSkelComponent("br", true);
43
+ const bdi = createSkelComponent("bdi");
44
+ const bdo = createSkelComponent("bdo");
45
+ const blockquote = createSkelComponent("blockquote");
46
+ const button = createSkelComponent("button");
47
+ const canvas = createSkelComponent("canvas");
48
+ const caption = createSkelComponent("caption");
49
+ const cite = createSkelComponent("cite");
50
+ const code = createSkelComponent("code");
51
+ const col = createSkelComponent("col");
52
+ const colgroup = createSkelComponent("colgroup");
53
+ const data = createSkelComponent("data");
54
+ const datalist = createSkelComponent("datalist");
55
+ const dd = createSkelComponent("dd");
56
+ const del = createSkelComponent("del");
57
+ const details = createSkelComponent("details");
58
+ const dfn = createSkelComponent("dfn");
59
+ const dialog = createSkelComponent("dialog");
60
+ const div = createSkelComponent("div");
61
+ const dl = createSkelComponent("dl");
62
+ const dt = createSkelComponent("dt");
63
+ const em = createSkelComponent("em");
64
+ const embed = createSkelComponent("embed", true);
65
+ const fieldset = createSkelComponent("fieldset");
66
+ const figcaption = createSkelComponent("figcaption");
67
+ const figure = createSkelComponent("figure");
68
+ const footer = createSkelComponent("footer");
69
+ const form = createSkelComponent("form");
70
+ const h1 = createSkelComponent("h1");
71
+ const h2 = createSkelComponent("h2");
72
+ const h3 = createSkelComponent("h3");
73
+ const h4 = createSkelComponent("h4");
74
+ const h5 = createSkelComponent("h5");
75
+ const h6 = createSkelComponent("h6");
76
+ const header = createSkelComponent("header");
77
+ const hgroup = createSkelComponent("hgroup");
78
+ const hr = createSkelComponent("hr", true);
79
+ const i = createSkelComponent("i");
80
+ const iframe = createSkelComponent("iframe");
81
+ const img = createSkelComponent("img", true);
82
+ const input = createSkelComponent("input", true);
83
+ const ins = createSkelComponent("ins");
84
+ const kbd = createSkelComponent("kbd");
85
+ const label = createSkelComponent("label");
86
+ const legend = createSkelComponent("legend");
87
+ const li = createSkelComponent("li");
88
+ const main = createSkelComponent("main");
89
+ const map = createSkelComponent("map");
90
+ const mark = createSkelComponent("mark");
91
+ const menu = createSkelComponent("menu");
92
+ const menuitem = createSkelComponent("menuitem");
93
+ const meter = createSkelComponent("meter");
94
+ const nav = createSkelComponent("nav");
95
+ const object = createSkelComponent("object");
96
+ const ol = createSkelComponent("ol");
97
+ const optgroup = createSkelComponent("optgroup");
98
+ const option = createSkelComponent("option");
99
+ const output = createSkelComponent("output");
100
+ const p = createSkelComponent("p");
101
+ const param = createSkelComponent("param");
102
+ const picture = createSkelComponent("picture");
103
+ const pre = createSkelComponent("pre");
104
+ const progress = createSkelComponent("progress");
105
+ const q = createSkelComponent("q");
106
+ const rp = createSkelComponent("rp");
107
+ const rt = createSkelComponent("rt");
108
+ const ruby = createSkelComponent("ruby");
109
+ const s = createSkelComponent("s");
110
+ const samp = createSkelComponent("samp");
111
+ const section = createSkelComponent("section");
112
+ const select = createSkelComponent("select");
113
+ const small = createSkelComponent("small");
114
+ const source = createSkelComponent("source");
115
+ const span = createSkelComponent("span");
116
+ const strong = createSkelComponent("strong");
117
+ const sub = createSkelComponent("sub");
118
+ const summary = createSkelComponent("summary");
119
+ const sup = createSkelComponent("sup");
120
+ const table = createSkelComponent("table");
121
+ const tbody = createSkelComponent("tbody");
122
+ const td = createSkelComponent("td");
123
+ const textarea = createSkelComponent("textarea");
124
+ const tfoot = createSkelComponent("tfoot");
125
+ const th = createSkelComponent("th");
126
+ const thead = createSkelComponent("thead");
127
+ const time = createSkelComponent("time");
128
+ const tr = createSkelComponent("tr");
129
+ const track = createSkelComponent("track");
130
+ const u = createSkelComponent("u");
131
+ const ul = createSkelComponent("ul");
132
+ const video = createSkelComponent("video");
133
+ const wbr = createSkelComponent("wbr", true);
134
+ const webview = createSkelComponent("webview");
34
135
  export {
35
- src_default as default,
36
- generatePlaceholder
136
+ Item,
137
+ Root,
138
+ a,
139
+ address,
140
+ article,
141
+ aside,
142
+ b,
143
+ bdi,
144
+ bdo,
145
+ blockquote,
146
+ br,
147
+ button,
148
+ canvas,
149
+ caption,
150
+ cite,
151
+ code,
152
+ col,
153
+ colgroup,
154
+ data,
155
+ datalist,
156
+ dd,
157
+ del,
158
+ details,
159
+ dfn,
160
+ dialog,
161
+ div,
162
+ dl,
163
+ dt,
164
+ em,
165
+ embed,
166
+ fieldset,
167
+ figcaption,
168
+ figure,
169
+ footer,
170
+ form,
171
+ h1,
172
+ h2,
173
+ h3,
174
+ h4,
175
+ h5,
176
+ h6,
177
+ header,
178
+ hgroup,
179
+ hr,
180
+ i,
181
+ iframe,
182
+ img,
183
+ input,
184
+ ins,
185
+ kbd,
186
+ label,
187
+ legend,
188
+ li,
189
+ main,
190
+ map,
191
+ mark,
192
+ menu,
193
+ menuitem,
194
+ meter,
195
+ nav,
196
+ object,
197
+ ol,
198
+ optgroup,
199
+ option,
200
+ output,
201
+ p,
202
+ param,
203
+ picture,
204
+ pre,
205
+ progress,
206
+ q,
207
+ rp,
208
+ rt,
209
+ ruby,
210
+ s,
211
+ samp,
212
+ section,
213
+ select,
214
+ small,
215
+ source,
216
+ span,
217
+ strong,
218
+ sub,
219
+ summary,
220
+ sup,
221
+ table,
222
+ tbody,
223
+ td,
224
+ textarea,
225
+ tfoot,
226
+ th,
227
+ thead,
228
+ time,
229
+ tr,
230
+ track,
231
+ u,
232
+ ul,
233
+ video,
234
+ wbr,
235
+ webview
37
236
  };
@@ -0,0 +1,4 @@
1
+ import { generatePlaceholder } from "@skel-ui/core";
2
+ export {
3
+ generatePlaceholder
4
+ };
package/dist/index.d.ts CHANGED
@@ -1,24 +1,108 @@
1
+ import { SkelComponentProps, SkelRoot } from "@skel-ui/core";
2
+ import type { ComponentProps, ComponentType } from "react";
1
3
  import React from "react";
2
- type HTMLProps<T extends React.ElementType> = Omit<React.ComponentPropsWithoutRef<T>, "children">;
3
- type RootProps<T extends React.ElementType = "div"> = {
4
- as?: T;
5
- children: React.ReactNode;
6
- isLoading: boolean;
7
- } & HTMLProps<T>;
8
- type ItemProps<T extends React.ElementType = "p"> = {
9
- as?: T;
10
- sw?: string;
11
- sh?: string;
12
- radius?: string;
13
- children?: React.ReactNode | (() => React.ReactNode);
14
- } & HTMLProps<T>;
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;
17
- export declare function generatePlaceholder<T = {
18
- [k: string]: unknown;
19
- }>(length: number, primary: string): T[];
20
- declare const Skel: {
21
- Root: typeof Root;
22
- Item: typeof Item;
23
- };
24
- export default Skel;
4
+ type SkelItemProps<T extends ComponentType<ComponentProps<T>>> = {
5
+ as: T;
6
+ } & ComponentProps<T> & Pick<SkelComponentProps<T>, "sw" | "sh" | "sr">;
7
+ declare function SkelItem<T extends ComponentType<ComponentProps<T>>>({ as, ...rest }: SkelItemProps<T>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
8
+ export declare const Root: typeof SkelRoot;
9
+ export declare const Item: typeof SkelItem;
10
+ export declare const a: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"a">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
+ export declare const address: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"address">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
12
+ export declare const article: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"article">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
13
+ export declare const aside: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"aside">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
14
+ export declare const b: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"b">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
15
+ export declare const br: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"br">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
16
+ export declare const bdi: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"bdi">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
17
+ export declare const bdo: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"bdo">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
18
+ export declare const blockquote: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"blockquote">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
19
+ export declare const button: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"button">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
20
+ export declare const canvas: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"canvas">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
21
+ export declare const caption: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"caption">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
22
+ export declare const cite: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"cite">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
23
+ export declare const code: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"code">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
24
+ export declare const col: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"col">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
25
+ export declare const colgroup: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"colgroup">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
26
+ export declare const data: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"data">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
27
+ export declare const datalist: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"datalist">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
28
+ export declare const dd: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"dd">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
29
+ export declare const del: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"del">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
30
+ export declare const details: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"details">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
31
+ export declare const dfn: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"dfn">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
32
+ export declare const dialog: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"dialog">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
33
+ export declare const div: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"div">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
34
+ export declare const dl: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"dl">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
35
+ export declare const dt: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"dt">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
36
+ export declare const em: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"em">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
37
+ export declare const embed: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"embed">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
38
+ export declare const fieldset: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"fieldset">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
39
+ export declare const figcaption: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"figcaption">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
40
+ export declare const figure: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"figure">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
41
+ export declare const footer: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"footer">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
42
+ export declare const form: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"form">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
43
+ export declare const h1: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h1">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
44
+ export declare const h2: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h2">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
45
+ export declare const h3: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h3">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
46
+ export declare const h4: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h4">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
47
+ export declare const h5: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h5">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
48
+ export declare const h6: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"h6">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
49
+ export declare const header: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"header">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
50
+ export declare const hgroup: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"hgroup">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
51
+ export declare const hr: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"hr">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
52
+ export declare const i: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"i">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
53
+ export declare const iframe: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"iframe">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
54
+ export declare const img: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"img">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
55
+ export declare const input: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"input">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
56
+ export declare const ins: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"ins">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
57
+ export declare const kbd: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"kbd">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
58
+ export declare const label: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"label">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
59
+ export declare const legend: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"legend">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
60
+ export declare const li: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"li">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
61
+ export declare const main: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"main">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
62
+ export declare const map: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"map">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
63
+ export declare const mark: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"mark">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
64
+ export declare const menu: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"menu">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
65
+ export declare const menuitem: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"menuitem">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
66
+ export declare const meter: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"meter">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
67
+ export declare const nav: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"nav">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
68
+ export declare const object: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"object">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
69
+ export declare const ol: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"ol">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
70
+ export declare const optgroup: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"optgroup">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
71
+ export declare const option: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"option">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
72
+ export declare const output: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"output">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
73
+ export declare const p: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"p">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
74
+ export declare const param: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"param">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
75
+ export declare const picture: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"picture">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
76
+ export declare const pre: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"pre">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
77
+ export declare const progress: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"progress">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
78
+ export declare const q: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"q">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
79
+ export declare const rp: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"rp">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
80
+ export declare const rt: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"rt">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
81
+ export declare const ruby: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"ruby">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
82
+ export declare const s: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"s">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
83
+ export declare const samp: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"samp">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
84
+ export declare const section: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"section">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
85
+ export declare const select: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"select">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
86
+ export declare const small: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"small">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
87
+ export declare const source: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"source">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
88
+ export declare const span: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"span">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
89
+ export declare const strong: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"strong">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
90
+ export declare const sub: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"sub">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
91
+ export declare const summary: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"summary">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
92
+ export declare const sup: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"sup">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
93
+ export declare const table: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"table">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
94
+ export declare const tbody: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"tbody">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
95
+ export declare const td: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"td">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
96
+ export declare const textarea: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"textarea">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
97
+ export declare const tfoot: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"tfoot">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
98
+ export declare const th: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"th">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
99
+ export declare const thead: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"thead">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
100
+ export declare const time: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"time">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
101
+ export declare const tr: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"tr">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
102
+ export declare const track: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"track">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
103
+ export declare const u: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"u">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
104
+ export declare const ul: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"ul">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
105
+ export declare const video: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"video">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
106
+ export declare const wbr: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"wbr">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
107
+ export declare const webview: ({ sw, sh, sr, style, children, ...props }: SkelComponentProps<"webview">) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
108
+ export {};
package/dist/styles.css CHANGED
@@ -1,37 +1,32 @@
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
+ --skel-ui-animation-easing: cubic-bezier(0.4, 0, 0.6, 1);
5
6
  }
6
- [data-skel-item][data-loading=true] {
7
- animation: skel-ui-shimmer 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
8
- background:
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;
12
+ background-image:
9
13
  linear-gradient(
10
14
  to right,
11
- var(--skel-ui-color1) 33%,
12
- var(--skel-ui-color2),
13
- var(--skel-ui-color1) 66%);
15
+ var(--skel-ui-color) 33%,
16
+ var(--skel-ui-shimmer-color, #f1f0f0),
17
+ var(--skel-ui-color) 66%);
14
18
  background-size: 300%;
15
- width: var(--skel-ui-width);
16
- height: var(--skel-ui-height);
17
- border-radius: var(--skel-ui-radius);
18
- cursor: default !important;
19
- user-select: none !important;
20
- pointer-events: none !important;
21
19
  }
22
- .skel-ui-pulse [data-skel-item][data-loading=true] {
23
- animation: skel-ui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
24
- background-color: var(--skel-ui-color1) !important;
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);
25
23
  }
26
24
  @keyframes skel-ui-pulse {
27
25
  0% {
28
26
  opacity: 1;
29
27
  }
30
- 50% {
31
- opacity: 0.25;
32
- }
33
28
  100% {
34
- opacity: 1;
29
+ opacity: 0.35;
35
30
  }
36
31
  }
37
32
  @keyframes skel-ui-shimmer {
@@ -0,0 +1,2 @@
1
+ import { generatePlaceholder } from "@skel-ui/core";
2
+ export { generatePlaceholder };
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": "0.4.0",
4
+ "version": "1.0.0-alpha.01475df",
5
5
  "license": "MIT",
6
- "description": "Next era of skeleton loading for React",
6
+ "description": "Lightweight and powerful skeleton loading library for React.",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
@@ -22,6 +22,11 @@
22
22
  "import": "./dist/esm/index.js",
23
23
  "require": "./dist/cjs/index.js"
24
24
  },
25
+ "./utils": {
26
+ "types": "./dist/utils.d.ts",
27
+ "import": "./dist/esm/utils.js",
28
+ "require": "./dist/cjs/utils.js"
29
+ },
25
30
  "./tailwind": {
26
31
  "types": "./dist/tailwind.d.ts",
27
32
  "import": "./dist/esm/tailwind.js",
@@ -30,6 +35,16 @@
30
35
  "./styles.css": "./dist/styles.css",
31
36
  "./$components": "./stories/components/index.tsx"
32
37
  },
38
+ "typesVersions": {
39
+ "*": {
40
+ "utils": [
41
+ "./dist/utils.d.ts"
42
+ ],
43
+ "tailwind": [
44
+ "./dist/tailwind.d.ts"
45
+ ]
46
+ }
47
+ },
33
48
  "bugs": {
34
49
  "url": "https://github.com/sudoaugustin/skel-ui/issues"
35
50
  },
@@ -38,9 +53,11 @@
38
53
  "type": "git",
39
54
  "url": "git+https://github.com/sudoaugustin/skel-ui"
40
55
  },
56
+ "dependencies": {
57
+ "@skel-ui/core": "1.0.0"
58
+ },
41
59
  "devDependencies": {
42
60
  "@chromatic-com/storybook": "^1.9.0",
43
- "@heroicons/react": "^2.1.5",
44
61
  "@storybook/addon-essentials": "^8.3.4",
45
62
  "@storybook/addon-interactions": "^8.3.4",
46
63
  "@storybook/addon-links": "^8.3.4",
@@ -49,14 +66,17 @@
49
66
  "@storybook/react": "^8.3.4",
50
67
  "@storybook/react-vite": "^8.3.4",
51
68
  "@storybook/test": "^8.3.4",
52
- "@types/react": "^18.2.0",
53
- "@types/react-dom": "^18.2.0",
69
+ "@types/react": "^18.3.12",
70
+ "@types/react-dom": "^18.3.1",
54
71
  "esbuild": "^0.24.0",
55
72
  "react": "^18.3.1",
56
73
  "react-dom": "^18.3.1",
57
74
  "storybook": "^8.3.4",
58
75
  "tailwindcss": "^3.4.13",
59
- "typescript": "^5.6.2"
76
+ "typescript": "^5.7.2",
77
+ "@skel-ui/core": "1.0.0",
78
+ "commons-tsconfig": "0.0.1",
79
+ "commons-utils": "0.0.1"
60
80
  },
61
81
  "peerDependencies": {
62
82
  "react": "^17.0 || ^18.0",
@@ -67,7 +87,7 @@
67
87
  "build": "rm -rf dist && pnpm build:dts && pnpm build:css && pnpm build:esm && pnpm build:cjs",
68
88
  "build:dts": "tsc -p tsconfig.build.json --outDir dist",
69
89
  "build:css": "esbuild src/styles.css --outdir=dist",
70
- "build:esm": "esbuild src/*.ts* --jsx=automatic --format=esm --outdir=dist/esm",
71
- "build:cjs": "esbuild src/*.ts* --jsx=automatic --format=cjs --outdir=dist/cjs"
90
+ "build:esm": "esbuild src/*.ts* --format=esm --outdir=dist/esm",
91
+ "build:cjs": "esbuild src/*.ts* --format=cjs --outdir=dist/cjs"
72
92
  }
73
93
  }