linkedunion-design-kit 1.9.6 → 1.9.8
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.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/src/components/Badge/Badge.stories.d.ts +1 -1
- package/dist/src/components/Badge/Badge.stories.js +1 -1
- package/dist/src/components/Button/Button/Button.js +3 -3
- package/dist/src/components/Pagination/pagination.js +3 -3
- package/dist/src/components/Skeleton/skeleton.d.ts +117 -0
- package/dist/src/components/Skeleton/skeleton.js +140 -0
- package/dist/src/components/Skeleton/skeleton.stories.d.ts +155 -0
- package/dist/src/components/Skeleton/skeleton.stories.js +414 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.d.ts +18 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.js +60 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.d.ts +11 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.stories.js +100 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.d.ts +1 -0
- package/dist/src/components/VerticalTabs/VerticalTabs.test.js +48 -0
- package/dist/styles/global.css +107 -17
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -29,3 +29,5 @@ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuIte
|
|
|
29
29
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
30
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
31
31
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
32
|
+
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
|
+
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
package/dist/index.js
CHANGED
|
@@ -29,3 +29,5 @@ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuIte
|
|
|
29
29
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
30
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
31
31
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
32
|
+
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
|
+
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
|
@@ -37,9 +37,9 @@ import LUIcon from "../../Icons/LUIcon";
|
|
|
37
37
|
import { buttonStyles } from "..";
|
|
38
38
|
export var variant = {
|
|
39
39
|
fill: "",
|
|
40
|
-
link: "bg-transparent hover:bg-transparent focus:bg-transparent active:bg-transparent !p-0 underline-offset-4 hover:underline border-none",
|
|
41
|
-
outline: "border bg-transparent",
|
|
42
|
-
ghost: "bg-transparent border-none",
|
|
40
|
+
link: "lu-bg-transparent hover:lu-bg-transparent focus:lu-bg-transparent active:lu-bg-transparent !p-0 underline-offset-4 hover:underline border-none",
|
|
41
|
+
outline: "border lu-bg-transparent",
|
|
42
|
+
ghost: "lu-bg-transparent border-none",
|
|
43
43
|
};
|
|
44
44
|
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-blue-200 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", {
|
|
45
45
|
variants: {
|
|
@@ -32,7 +32,7 @@ var Pagination = function (_a) {
|
|
|
32
32
|
Pagination.displayName = "Pagination";
|
|
33
33
|
var PaginationContent = React.forwardRef(function (_a, ref) {
|
|
34
34
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
-
return (_jsx("ul", __assign({ ref: ref, className: cn("flex flex-row items-center gap-1", className) }, props)));
|
|
35
|
+
return (_jsx("ul", __assign({ "data-slot": "reset-bs-ul", ref: ref, className: cn("flex flex-row items-center gap-1", className) }, props)));
|
|
36
36
|
});
|
|
37
37
|
PaginationContent.displayName = "PaginationContent";
|
|
38
38
|
var PaginationItem = React.forwardRef(function (_a, ref) {
|
|
@@ -42,7 +42,7 @@ var PaginationItem = React.forwardRef(function (_a, ref) {
|
|
|
42
42
|
PaginationItem.displayName = "PaginationItem";
|
|
43
43
|
var PaginationLink = function (_a) {
|
|
44
44
|
var className = _a.className, isActive = _a.isActive, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.color, color = _c === void 0 ? "gray" : _c, _d = _a.variant, variant = _d === void 0 ? "ghost" : _d, props = __rest(_a, ["className", "isActive", "size", "color", "variant"]);
|
|
45
|
-
return (_jsx("a", __assign({ "aria-current": isActive ? "page" : undefined, className: cn(buttonVariants({
|
|
45
|
+
return (_jsx("a", __assign({ "aria-current": isActive ? "page" : undefined, "data-slot": "reset-bs-link", className: cn(buttonVariants({
|
|
46
46
|
variant: isActive ? (variant === "link" ? variant : "fill") : variant,
|
|
47
47
|
size: size,
|
|
48
48
|
color: color,
|
|
@@ -51,7 +51,7 @@ var PaginationLink = function (_a) {
|
|
|
51
51
|
PaginationLink.displayName = "PaginationLink";
|
|
52
52
|
var PaginationPrevious = function (_a) {
|
|
53
53
|
var className = _a.className, props = __rest(_a, ["className"]);
|
|
54
|
-
return (_jsxs(PaginationLink, __assign({ "aria-label": "Go to previous page", size: "md", className: cn("gap-1 pl-2.5", className) }, props, { children: [_jsx(LUIcon, { icon: "arrow-left" }),
|
|
54
|
+
return (_jsxs(PaginationLink, __assign({ "aria-label": "Go to previous page", size: "md", className: cn("gap-1 pl-2.5", className) }, props, { children: [_jsx(LUIcon, { icon: "arrow-left" }), "Previous"] })));
|
|
55
55
|
};
|
|
56
56
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
57
57
|
var PaginationNext = function (_a) {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { avatarSize } from "../Avatar/Avatar";
|
|
2
|
+
import { buttonStyles } from "../Button";
|
|
3
|
+
import { badgeStyles } from "../Badge";
|
|
4
|
+
import { tableBodySize } from "../Table";
|
|
5
|
+
import { comboboxSizes } from "../Dropdown/Combobox";
|
|
6
|
+
import { iconSize as LUIconSizes } from "../Icons";
|
|
7
|
+
import { checkboxSize } from "../Checkbox/checkbox";
|
|
8
|
+
import { size as SwitchSizes } from "../Switch/switch";
|
|
9
|
+
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare namespace Skeleton {
|
|
11
|
+
var Button: typeof ButtonSkeleton;
|
|
12
|
+
var Input: typeof InputSkeleton;
|
|
13
|
+
var Avatar: typeof AvatarSkeleton;
|
|
14
|
+
var Badge: typeof BadgeSkeleton;
|
|
15
|
+
var Card: typeof CardSkeleton;
|
|
16
|
+
var TableRow: typeof TableRowSkeleton;
|
|
17
|
+
var Checkbox: typeof CheckboxSkeleton;
|
|
18
|
+
var Switch: typeof SwitchSkeleton;
|
|
19
|
+
var Select: typeof SelectSkeleton;
|
|
20
|
+
var Icon: typeof IconSkeleton;
|
|
21
|
+
var Text: typeof TextSkeleton;
|
|
22
|
+
var Heading: typeof HeadingSkeleton;
|
|
23
|
+
var Image: typeof ImageSkeleton;
|
|
24
|
+
}
|
|
25
|
+
type ButtonSkeletonProps = {
|
|
26
|
+
size?: keyof typeof buttonStyles.size;
|
|
27
|
+
className?: string;
|
|
28
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
29
|
+
declare function ButtonSkeleton({ size, className, ...props }: ButtonSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const InputSkeletonSize: {
|
|
31
|
+
sm: string;
|
|
32
|
+
md: string;
|
|
33
|
+
lg: string;
|
|
34
|
+
};
|
|
35
|
+
type InputSkeletonProps = {
|
|
36
|
+
size?: keyof typeof InputSkeletonSize;
|
|
37
|
+
className?: string;
|
|
38
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
39
|
+
declare function InputSkeleton({ size, className, ...props }: InputSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
type AvatarSkeletonProps = {
|
|
41
|
+
size?: keyof typeof avatarSize;
|
|
42
|
+
className?: string;
|
|
43
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
44
|
+
declare function AvatarSkeleton({ size, className, ...props }: AvatarSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
type BadgeSkeletonProps = {
|
|
46
|
+
size?: keyof typeof badgeStyles.size;
|
|
47
|
+
className?: string;
|
|
48
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
49
|
+
export declare const BadgeSkeletonSize: {
|
|
50
|
+
sm: string;
|
|
51
|
+
md: string;
|
|
52
|
+
lg: string;
|
|
53
|
+
};
|
|
54
|
+
declare function BadgeSkeleton({ size, className, ...props }: BadgeSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
type CardSkeletonProps = {
|
|
56
|
+
className?: string;
|
|
57
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
58
|
+
declare function CardSkeleton({ className, ...props }: CardSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
type TableRowSkeletonProps = {
|
|
60
|
+
columns?: number;
|
|
61
|
+
size?: keyof typeof tableBodySize;
|
|
62
|
+
className?: string;
|
|
63
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
64
|
+
declare function TableRowSkeleton({ columns, size, className, ...props }: TableRowSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
type CheckboxSkeletonProps = {
|
|
66
|
+
className?: string;
|
|
67
|
+
size?: keyof typeof checkboxSize;
|
|
68
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
69
|
+
declare function CheckboxSkeleton({ className, size, ...props }: CheckboxSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
type SwitchSkeletonProps = {
|
|
71
|
+
className?: string;
|
|
72
|
+
size?: keyof typeof SwitchSizes;
|
|
73
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
74
|
+
declare function SwitchSkeleton({ className, size, ...props }: SwitchSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
type SelectSkeletonProps = {
|
|
76
|
+
size?: keyof typeof comboboxSizes;
|
|
77
|
+
className?: string;
|
|
78
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
79
|
+
declare function SelectSkeleton({ size, className, ...props }: SelectSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
type IconSkeletonProps = {
|
|
81
|
+
size?: keyof typeof LUIconSizes;
|
|
82
|
+
className?: string;
|
|
83
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
84
|
+
declare function IconSkeleton({ size, className, ...props }: IconSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
export declare const TextSkeletonSize: {
|
|
86
|
+
xs: string;
|
|
87
|
+
sm: string;
|
|
88
|
+
md: string;
|
|
89
|
+
lg: string;
|
|
90
|
+
xl: string;
|
|
91
|
+
};
|
|
92
|
+
type TextSkeletonProps = {
|
|
93
|
+
lines?: number;
|
|
94
|
+
size?: keyof typeof TextSkeletonSize;
|
|
95
|
+
className?: string;
|
|
96
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
97
|
+
declare function TextSkeleton({ lines, size, className, ...props }: TextSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare const HeadingSkeletonSize: {
|
|
99
|
+
h1: string;
|
|
100
|
+
h2: string;
|
|
101
|
+
h3: string;
|
|
102
|
+
h4: string;
|
|
103
|
+
h5: string;
|
|
104
|
+
h6: string;
|
|
105
|
+
};
|
|
106
|
+
type HeadingSkeletonProps = {
|
|
107
|
+
size?: keyof typeof HeadingSkeletonSize;
|
|
108
|
+
className?: string;
|
|
109
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
110
|
+
declare function HeadingSkeleton({ size, className, ...props }: HeadingSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
111
|
+
type ImageSkeletonProps = {
|
|
112
|
+
aspectRatio?: "square" | "video" | "portrait";
|
|
113
|
+
className?: string;
|
|
114
|
+
isIcon?: boolean;
|
|
115
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
116
|
+
declare function ImageSkeleton({ aspectRatio, className, isIcon, ...props }: ImageSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
export { Skeleton };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { cn } from "../../lib/utils";
|
|
25
|
+
import { avatarSize } from "../Avatar/Avatar";
|
|
26
|
+
import { buttonStyles } from "../Button";
|
|
27
|
+
import { tableBodySize } from "../Table";
|
|
28
|
+
import { comboboxSizes } from "../Dropdown/Combobox";
|
|
29
|
+
import { iconSize as LUIconSizes } from "../Icons";
|
|
30
|
+
import { checkboxSize } from "../Checkbox/checkbox";
|
|
31
|
+
import { size as SwitchSizes } from "../Switch/switch";
|
|
32
|
+
import LUIcon from "../Icons/LUIcon";
|
|
33
|
+
// Base Skeleton Component
|
|
34
|
+
function Skeleton(_a) {
|
|
35
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
36
|
+
return (_jsx("div", __assign({ className: cn("animate-pulse rounded-md bg-gray-100", className) }, props)));
|
|
37
|
+
}
|
|
38
|
+
function ButtonSkeleton(_a) {
|
|
39
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
40
|
+
return (_jsx(Skeleton, __assign({ className: cn(buttonStyles.size[size], "inline-block min-w-32", className) }, props)));
|
|
41
|
+
}
|
|
42
|
+
export var InputSkeletonSize = {
|
|
43
|
+
sm: "h-9",
|
|
44
|
+
md: "h-11",
|
|
45
|
+
lg: "h-12",
|
|
46
|
+
};
|
|
47
|
+
function InputSkeleton(_a) {
|
|
48
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
49
|
+
return (_jsx(Skeleton, __assign({ className: cn(InputSkeletonSize[size], "w-full rounded-md", className) }, props)));
|
|
50
|
+
}
|
|
51
|
+
function AvatarSkeleton(_a) {
|
|
52
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
53
|
+
return (_jsx(Skeleton, __assign({ className: cn(avatarSize[size], "rounded-full", className) }, props)));
|
|
54
|
+
}
|
|
55
|
+
export var BadgeSkeletonSize = {
|
|
56
|
+
sm: "h-5 w-12",
|
|
57
|
+
md: "h-6 w-16",
|
|
58
|
+
lg: "h-7 w-28",
|
|
59
|
+
};
|
|
60
|
+
function BadgeSkeleton(_a) {
|
|
61
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
62
|
+
return (_jsx(Skeleton, __assign({ className: cn(BadgeSkeletonSize[size], "rounded-full", className) }, props)));
|
|
63
|
+
}
|
|
64
|
+
function CardSkeleton(_a) {
|
|
65
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
66
|
+
return (_jsx(Skeleton, __assign({ className: cn("h-48 w-full rounded-lg", className) }, props)));
|
|
67
|
+
}
|
|
68
|
+
function TableRowSkeleton(_a) {
|
|
69
|
+
var _b = _a.columns, columns = _b === void 0 ? 4 : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, props = __rest(_a, ["columns", "size", "className"]);
|
|
70
|
+
return (_jsx("div", __assign({ className: cn("flex gap-4", className) }, props, { children: Array.from({ length: columns }).map(function (_, i) { return (_jsx(Skeleton, { className: cn(tableBodySize[size], "flex-1") }, i)); }) })));
|
|
71
|
+
}
|
|
72
|
+
function CheckboxSkeleton(_a) {
|
|
73
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["className", "size"]);
|
|
74
|
+
return _jsx(Skeleton, __assign({ className: cn(checkboxSize[size], className) }, props));
|
|
75
|
+
}
|
|
76
|
+
function SwitchSkeleton(_a) {
|
|
77
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? "md" : _b, props = __rest(_a, ["className", "size"]);
|
|
78
|
+
return _jsx(Skeleton, __assign({ className: cn(SwitchSizes[size], className) }, props));
|
|
79
|
+
}
|
|
80
|
+
function SelectSkeleton(_a) {
|
|
81
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
82
|
+
return (_jsx(Skeleton, __assign({ className: cn(comboboxSizes[size], "w-full rounded-md", className) }, props)));
|
|
83
|
+
}
|
|
84
|
+
function IconSkeleton(_a) {
|
|
85
|
+
var _b = _a.size, size = _b === void 0 ? "md" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
86
|
+
return (_jsx(Skeleton, __assign({ className: cn(LUIconSizes[size], "rounded", className) }, props)));
|
|
87
|
+
}
|
|
88
|
+
// Text/Typography Skeleton
|
|
89
|
+
export var TextSkeletonSize = {
|
|
90
|
+
xs: "h-3",
|
|
91
|
+
sm: "h-3.5",
|
|
92
|
+
md: "h-4",
|
|
93
|
+
lg: "h-[1.125rem]",
|
|
94
|
+
xl: "h-5",
|
|
95
|
+
};
|
|
96
|
+
function TextSkeleton(_a) {
|
|
97
|
+
var _b = _a.lines, lines = _b === void 0 ? 1 : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, props = __rest(_a, ["lines", "size", "className"]);
|
|
98
|
+
if (lines === 1) {
|
|
99
|
+
return (_jsx(Skeleton, __assign({ className: cn(TextSkeletonSize[size], "w-full", className) }, props)));
|
|
100
|
+
}
|
|
101
|
+
return (_jsx("div", __assign({ className: cn("space-y-2", className) }, props, { children: Array.from({ length: lines }).map(function (_, i) { return (_jsx(Skeleton, { className: cn(TextSkeletonSize[size], i === lines - 1 ? "w-3/4" : "w-full") }, i)); }) })));
|
|
102
|
+
}
|
|
103
|
+
// Heading Skeleton
|
|
104
|
+
// Matches Heading component sizes: h1=text-5xl, h2=text-4xl, h3=text-3xl, h4=text-2xl, h5=text-xl, h6=text-lg
|
|
105
|
+
export var HeadingSkeletonSize = {
|
|
106
|
+
h1: "h-12", // text-5xl = 48px
|
|
107
|
+
h2: "h-10", // text-4xl = 36px
|
|
108
|
+
h3: "h-8", // text-3xl = 30px
|
|
109
|
+
h4: "h-7", // text-2xl = 24px
|
|
110
|
+
h5: "h-6", // text-xl = 20px
|
|
111
|
+
h6: "h-[1.125rem]", // text-lg = 18px
|
|
112
|
+
};
|
|
113
|
+
function HeadingSkeleton(_a) {
|
|
114
|
+
var _b = _a.size, size = _b === void 0 ? "h2" : _b, className = _a.className, props = __rest(_a, ["size", "className"]);
|
|
115
|
+
return (_jsx(Skeleton, __assign({ className: cn(HeadingSkeletonSize[size], "w-3/4", className) }, props)));
|
|
116
|
+
}
|
|
117
|
+
function ImageSkeleton(_a) {
|
|
118
|
+
var _b = _a.aspectRatio, aspectRatio = _b === void 0 ? "square" : _b, className = _a.className, _c = _a.isIcon, isIcon = _c === void 0 ? true : _c, props = __rest(_a, ["aspectRatio", "className", "isIcon"]);
|
|
119
|
+
var aspectClasses = {
|
|
120
|
+
square: "aspect-square",
|
|
121
|
+
video: "aspect-video",
|
|
122
|
+
portrait: "aspect-[3/4]",
|
|
123
|
+
};
|
|
124
|
+
return (_jsx(Skeleton, __assign({ className: cn("relative w-full overflow-hidden", aspectClasses[aspectRatio], className) }, props, { children: isIcon && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx(LUIcon, { icon: "image", className: cn("text-gray-400 opacity-60 w-1/3 h-1/3 ") }) })) })));
|
|
125
|
+
}
|
|
126
|
+
// Attach all variants as properties
|
|
127
|
+
Skeleton.Button = ButtonSkeleton;
|
|
128
|
+
Skeleton.Input = InputSkeleton;
|
|
129
|
+
Skeleton.Avatar = AvatarSkeleton;
|
|
130
|
+
Skeleton.Badge = BadgeSkeleton;
|
|
131
|
+
Skeleton.Card = CardSkeleton;
|
|
132
|
+
Skeleton.TableRow = TableRowSkeleton;
|
|
133
|
+
Skeleton.Checkbox = CheckboxSkeleton;
|
|
134
|
+
Skeleton.Switch = SwitchSkeleton;
|
|
135
|
+
Skeleton.Select = SelectSkeleton;
|
|
136
|
+
Skeleton.Icon = IconSkeleton;
|
|
137
|
+
Skeleton.Text = TextSkeleton;
|
|
138
|
+
Skeleton.Heading = HeadingSkeleton;
|
|
139
|
+
Skeleton.Image = ImageSkeleton;
|
|
140
|
+
export { Skeleton };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
declare const SKELETON_VARIANTS: string[];
|
|
3
|
+
type SkeletonVariant = (typeof SKELETON_VARIANTS)[number];
|
|
4
|
+
interface SkeletonStoryArgs {
|
|
5
|
+
className?: string;
|
|
6
|
+
variant?: SkeletonVariant;
|
|
7
|
+
size?: string;
|
|
8
|
+
columns?: number;
|
|
9
|
+
lines?: number;
|
|
10
|
+
aspectRatio?: "square" | "video" | "portrait";
|
|
11
|
+
isIcon?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const meta: Meta<SkeletonStoryArgs>;
|
|
14
|
+
export default meta;
|
|
15
|
+
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, SkeletonStoryArgs>;
|
|
16
|
+
export declare const ButtonSkeletons: {
|
|
17
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
story: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const InputSkeletons: {
|
|
27
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
parameters: {
|
|
29
|
+
docs: {
|
|
30
|
+
description: {
|
|
31
|
+
story: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const AvatarSkeletons: {
|
|
37
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
parameters: {
|
|
39
|
+
docs: {
|
|
40
|
+
description: {
|
|
41
|
+
story: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const BadgeSkeletons: {
|
|
47
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
description: {
|
|
51
|
+
story: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export declare const CardSkeleton: {
|
|
57
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
parameters: {
|
|
59
|
+
docs: {
|
|
60
|
+
description: {
|
|
61
|
+
story: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare const TableRowSkeletons: {
|
|
67
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
parameters: {
|
|
69
|
+
docs: {
|
|
70
|
+
description: {
|
|
71
|
+
story: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const FormElementsSkeletons: {
|
|
77
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
parameters: {
|
|
79
|
+
docs: {
|
|
80
|
+
description: {
|
|
81
|
+
story: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export declare const IconSkeletons: {
|
|
87
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
parameters: {
|
|
89
|
+
docs: {
|
|
90
|
+
description: {
|
|
91
|
+
story: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export declare const TextSkeletons: {
|
|
97
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
parameters: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: {
|
|
101
|
+
story: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export declare const HeadingSkeletons: {
|
|
107
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
parameters: {
|
|
109
|
+
docs: {
|
|
110
|
+
description: {
|
|
111
|
+
story: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
export declare const ImageSkeletons: {
|
|
117
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
parameters: {
|
|
119
|
+
docs: {
|
|
120
|
+
description: {
|
|
121
|
+
story: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export declare const CompleteCardExample: {
|
|
127
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
128
|
+
parameters: {
|
|
129
|
+
docs: {
|
|
130
|
+
description: {
|
|
131
|
+
story: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export declare const CompleteFormExample: {
|
|
137
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
138
|
+
parameters: {
|
|
139
|
+
docs: {
|
|
140
|
+
description: {
|
|
141
|
+
story: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export declare const AllVariants: {
|
|
147
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
148
|
+
parameters: {
|
|
149
|
+
docs: {
|
|
150
|
+
description: {
|
|
151
|
+
story: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|