@hive-ui/skeleton-loader 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/dist/index.d.mts +8 -0
- package/dist/index.mjs +64 -0
- package/package.json +39 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BoxProps } from "@hive-ui/box";
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/SkeletonLoader.d.ts
|
|
5
|
+
type SkeletonLoaderProps = Pick<BoxProps<"div">, "element" | "display" | "maxHeight" | "minHeight" | "size" | "maxWidth" | "minWidth" | "children" | "borderRadius" | "width" | "height" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderTopLeftRadius" | "borderTopRightRadius">;
|
|
6
|
+
declare const SkeletonLoader: _$react.ForwardRefExoticComponent<SkeletonLoaderProps & _$react.RefAttributes<HTMLElement>>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { SkeletonLoader, type SkeletonLoaderProps };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Box } from "@hive-ui/box";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { css, keyframes, styled } from "@hive-ui/css-library";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/SkeletonLoaderInner.ts
|
|
6
|
+
const SkeletonLoaderKeyframes = keyframes`
|
|
7
|
+
0% {
|
|
8
|
+
transform: translateX(-100%) skew(155deg);
|
|
9
|
+
}
|
|
10
|
+
50%,
|
|
11
|
+
100% {
|
|
12
|
+
transform: translateX(100%) skew(155deg);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const SkeletonLoaderInner = styled.div(css({
|
|
16
|
+
position: "absolute",
|
|
17
|
+
top: 0,
|
|
18
|
+
bottom: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
right: 0,
|
|
21
|
+
background: `linear-gradient(
|
|
22
|
+
90deg,
|
|
23
|
+
transparent,
|
|
24
|
+
var(--colorBackground) 40%,
|
|
25
|
+
var(--colorBackground) 60%,
|
|
26
|
+
transparent
|
|
27
|
+
)`,
|
|
28
|
+
transform: "translateX(-100%) skew(155deg)",
|
|
29
|
+
animationTimingFunction: "cubic-bezier(0.06, 0.42, 0.57, 0.89)",
|
|
30
|
+
animationName: SkeletonLoaderKeyframes,
|
|
31
|
+
animationDuration: "4.5s",
|
|
32
|
+
animationIterationCount: "infinite"
|
|
33
|
+
}));
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/SkeletonLoader.tsx
|
|
36
|
+
const SkeletonLoader = forwardRef(({ element = "SKELETON_LOADER", children, borderBottomLeftRadius, borderBottomRightRadius, borderRadius = "borderRadius20", borderTopLeftRadius, borderTopRightRadius, display, height = "sizeIcon20", maxHeight, maxWidth, minHeight, minWidth, size = null, width = null, ...props }, ref) => {
|
|
37
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
38
|
+
...props,
|
|
39
|
+
"aria-busy": "true",
|
|
40
|
+
backgroundColor: "colorBackgroundStrong",
|
|
41
|
+
borderBottomLeftRadius,
|
|
42
|
+
borderBottomRightRadius,
|
|
43
|
+
borderRadius,
|
|
44
|
+
borderTopLeftRadius,
|
|
45
|
+
borderTopRightRadius,
|
|
46
|
+
display,
|
|
47
|
+
element,
|
|
48
|
+
height,
|
|
49
|
+
maxHeight,
|
|
50
|
+
maxWidth,
|
|
51
|
+
minHeight,
|
|
52
|
+
minWidth,
|
|
53
|
+
overflow: "hidden",
|
|
54
|
+
pointerEvents: "none",
|
|
55
|
+
position: "relative",
|
|
56
|
+
userSelect: "none",
|
|
57
|
+
size,
|
|
58
|
+
width,
|
|
59
|
+
ref,
|
|
60
|
+
children: /* @__PURE__ */ jsx(SkeletonLoaderInner, {})
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { SkeletonLoader };
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hive-ui/skeleton-loader",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Hive UI Skeleton Loader Component",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.mjs",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "vp pack",
|
|
18
|
+
"dev": "vp pack --watch",
|
|
19
|
+
"test": "vp test",
|
|
20
|
+
"check": "vp check",
|
|
21
|
+
"prepublishOnly": "vp run build"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@hive-ui/box": "^0.3.1",
|
|
25
|
+
"@hive-ui/style-props": "^0.3.1",
|
|
26
|
+
"@hive-ui/css-library": "^0.3.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^25.6.2",
|
|
30
|
+
"@typescript/native-preview": "7.0.0-dev.20260509.2",
|
|
31
|
+
"bumpp": "^11.1.0",
|
|
32
|
+
"typescript": "^6.0.3",
|
|
33
|
+
"vite-plus": "^0.1.20",
|
|
34
|
+
"vitest": "npm:@voidzero-dev/vite-plus-test@^0.1.20"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "19.2.6"
|
|
38
|
+
}
|
|
39
|
+
}
|