@sharper-ui/react-skeletons
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -22,10 +22,12 @@ "use strict"; | ||
const Skeleton = (_a) => { | ||
var { variant = "default" } = _a, props = __rest(_a, ["variant"]); | ||
if (variant === "default") { | ||
return react_1.default.createElement(DefaultSkeleton_1.DefaultSkeleton, Object.assign({}, props)); | ||
} | ||
if (variant === "circle") { | ||
return react_1.default.createElement(CircleSkeleton_1.CircleSkeleton, Object.assign({}, props)); | ||
} | ||
var { count = 1, variant = "default" } = _a, props = __rest(_a, ["count", "variant"]); | ||
return Array.from({ length: count }).map((_, index) => { | ||
if (variant === "default") { | ||
return react_1.default.createElement(DefaultSkeleton_1.DefaultSkeleton, Object.assign({ key: index }, props)); | ||
} | ||
if (variant === "circle") { | ||
return react_1.default.createElement(CircleSkeleton_1.CircleSkeleton, Object.assign({ key: index }, props)); | ||
} | ||
}); | ||
}; | ||
exports.Skeleton = Skeleton; |
import React from "react"; | ||
import { SkeletonProps } from "../types"; | ||
export declare const Skeleton: ({ variant, ...props }: SkeletonProps) => React.JSX.Element | undefined; | ||
export declare const Skeleton: ({ count, variant, ...props }: SkeletonProps) => (React.JSX.Element | undefined)[]; |
@@ -12,2 +12,3 @@ import { CSSProperties } from "react"; | ||
borderRadius?: BorderRadius; | ||
count?: number; | ||
direction?: Direction; | ||
@@ -23,3 +24,3 @@ disabled?: boolean; | ||
} | ||
export interface StyledSkeletonProps extends Omit<SkeletonProps, "animation" | "background" | "borderRadius" | "direction" | "duration" | "margin" | "secondaryColor" | "variant"> { | ||
export interface StyledSkeletonProps extends Omit<SkeletonProps, "animation" | "background" | "borderRadius" | "count" | "direction" | "duration" | "margin" | "secondaryColor" | "variant"> { | ||
$animation?: Animation; | ||
@@ -26,0 +27,0 @@ $background?: Background; |
{ | ||
"name": "@sharper-ui/react-skeletons", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/types/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16301
332