@mbao01/common 0.9.4 → 0.9.6
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getSkeletonClasses: (props?: ({
|
|
2
|
-
animate?: "pulse" | null | undefined;
|
|
2
|
+
animate?: "none" | "pulse" | "wave" | "bounce" | null | undefined;
|
|
3
3
|
width?: 4 | 8 | "full" | 2 | 12 | 16 | 24 | 32 | 48 | 64 | null | undefined;
|
|
4
4
|
height?: 4 | 8 | "full" | 2 | 12 | 16 | 24 | 32 | 48 | 64 | null | undefined;
|
|
5
5
|
round?: boolean | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
import { createVariants } from "../../utilities";
|
|
3
3
|
|
|
4
|
-
export const getSkeletonClasses = cva("skeleton
|
|
4
|
+
export const getSkeletonClasses = cva("skeleton", {
|
|
5
5
|
variants: createVariants({
|
|
6
|
-
animate: {
|
|
6
|
+
animate: {
|
|
7
|
+
none: "animate-none",
|
|
8
|
+
wave: "",
|
|
9
|
+
bounce: "animate-bounce",
|
|
10
|
+
pulse: "animate-pulse",
|
|
11
|
+
},
|
|
7
12
|
width: {
|
|
8
13
|
2: "w-2",
|
|
9
14
|
4: "w-4",
|
|
@@ -37,5 +42,6 @@ export const getSkeletonClasses = cva("skeleton animate-pulse", {
|
|
|
37
42
|
width: "full",
|
|
38
43
|
height: 4,
|
|
39
44
|
round: false,
|
|
45
|
+
animate: "pulse",
|
|
40
46
|
},
|
|
41
47
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../utilities";
|
|
2
|
+
import { Flex } from "../Flex";
|
|
3
|
+
import { Skeleton } from "../Skeleton";
|
|
2
4
|
|
|
3
5
|
export type WidgetShellSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
6
|
/** Number of skeleton lines to show */
|
|
@@ -14,25 +16,20 @@ const WidgetShellSkeleton = ({
|
|
|
14
16
|
...props
|
|
15
17
|
}: WidgetShellSkeletonProps) => {
|
|
16
18
|
return (
|
|
17
|
-
<div
|
|
18
|
-
className={cn(
|
|
19
|
-
"rounded-lg border bg-base-100 shadow-sm",
|
|
20
|
-
className
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
>
|
|
19
|
+
<div className={cn("rounded-lg border bg-base-100 shadow-sm", className)} {...props}>
|
|
24
20
|
{header && (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
</
|
|
21
|
+
<Flex direction="col" gap={2} className="border-b px-4 py-3">
|
|
22
|
+
<Skeleton animate="wave" className="inline-block h-4 w-32 rounded" />
|
|
23
|
+
<Skeleton animate="wave" className="mt-0.5 inline-block h-3 w-48 rounded" />
|
|
24
|
+
</Flex>
|
|
29
25
|
)}
|
|
30
26
|
<div className="p-4">
|
|
31
27
|
<div className="flex flex-col gap-3" role="status" aria-label="Loading">
|
|
32
28
|
{Array.from({ length: lines }, (_, i) => (
|
|
33
|
-
<
|
|
29
|
+
<Skeleton
|
|
30
|
+
animate="wave"
|
|
34
31
|
key={i}
|
|
35
|
-
className="
|
|
32
|
+
className="h-4 rounded"
|
|
36
33
|
style={{ width: `${100 - i * 15}%` }}
|
|
37
34
|
/>
|
|
38
35
|
))}
|
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
themes: light --default, dark --prefersdark, cupcake;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
@variant dark {
|
|
9
|
+
&:where([data-theme='dark'], [data-theme='dark'] *) {
|
|
10
|
+
@slot;
|
|
11
|
+
}
|
|
12
|
+
@media (prefers-color-scheme: dark) {
|
|
13
|
+
&:where(:not([data-theme] *)) {
|
|
14
|
+
@slot;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
/*
|
|
9
20
|
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
|
10
21
|
so we've added these compatibility styles to make sure everything still
|