@locusgraph/components 0.2.0 → 0.2.2
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/action/button-group.js +45 -17
- package/dist/action/button.js +44 -27
- package/dist/action/toggle-group.js +176 -12
- package/dist/action/toggle.js +70 -17
- package/dist/display/avatar.js +118 -7
- package/dist/display/badge.js +33 -20
- package/dist/display/chart/chart-container.js +205 -45
- package/dist/display/chart/chart-legend.js +79 -14
- package/dist/display/chart/chart-tooltip.js +211 -40
- package/dist/display/chat/attachment/attachment-parts.js +56 -13
- package/dist/display/chat/attachment/attachment.js +70 -28
- package/dist/display/chat/bubble.js +80 -37
- package/dist/display/chat/marker.js +44 -15
- package/dist/display/chat/message-scroller.js +276 -14
- package/dist/display/chat/message.js +58 -13
- package/dist/display/content/item.js +134 -47
- package/dist/display/content/kbd.js +19 -5
- package/dist/display/media/aspect-ratio.js +27 -3
- package/dist/display/media/carousel-controls.js +162 -11
- package/dist/display/media/carousel.js +325 -65
- package/dist/display/rule-grid/rule-grid.js +86 -29
- package/dist/display/separator.js +56 -3
- package/dist/display/skeletons/layouts/skeleton-rule-grid.js +30 -6
- package/dist/display/skeletons/layouts/skeleton-table.js +44 -6
- package/dist/display/skeletons/shapes/skeleton-avatar.js +31 -13
- package/dist/display/skeletons/shapes/skeleton-button.js +31 -13
- package/dist/display/skeletons/shapes/skeleton-text.js +25 -7
- package/dist/display/skeletons/skeleton-parts.js +22 -6
- package/dist/display/status/alert.js +44 -18
- package/dist/display/status/empty.js +69 -22
- package/dist/display/status/progress.js +116 -16
- package/dist/display/status/skeleton.js +10 -3
- package/dist/display/status/spinner.js +11 -3
- package/dist/display/table.js +77 -17
- package/dist/feedback/toaster.js +98 -21
- package/dist/form/advanced/calendar-day-button.js +89 -12
- package/dist/form/advanced/calendar.js +349 -56
- package/dist/form/advanced/combobox/combobox-chips.js +151 -8
- package/dist/form/advanced/combobox/combobox-items.js +239 -14
- package/dist/form/advanced/combobox/combobox.js +386 -13
- package/dist/form/advanced/input-otp.js +201 -11
- package/dist/form/choice/checkbox.js +58 -3
- package/dist/form/choice/radio-group.js +94 -5
- package/dist/form/choice/select.js +479 -25
- package/dist/form/choice/slider.js +118 -4
- package/dist/form/choice/switch.js +53 -3
- package/dist/form/field/field-error.js +34 -14
- package/dist/form/field/field-separator.js +19 -3
- package/dist/form/field/field-set.js +21 -5
- package/dist/form/field/field-text.js +28 -7
- package/dist/form/field/field.js +43 -25
- package/dist/form/hook-form/form.js +338 -40
- package/dist/form/input-group.js +297 -47
- package/dist/form/input.js +13 -3
- package/dist/form/label.js +42 -3
- package/dist/form/native-select.js +39 -7
- package/dist/form/textarea.js +11 -3
- package/dist/layout/accordion.js +165 -8
- package/dist/layout/collapsible.js +75 -7
- package/dist/layout/resizable.js +122 -7
- package/dist/layout/scroll/direction.js +25 -3
- package/dist/layout/scroll/scroll-area.js +138 -5
- package/dist/layout/sidebar/sidebar-context.js +184 -51
- package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
- package/dist/layout/sidebar/sidebar-menu.js +319 -38
- package/dist/layout/sidebar/sidebar-sections.js +369 -22
- package/dist/layout/sidebar/sidebar.js +384 -28
- package/dist/layout/tabs.js +183 -18
- package/dist/layout/use-mobile.js +11 -11
- package/dist/navigation/breadcrumb.js +82 -17
- package/dist/navigation/menubar/menubar-items.js +322 -16
- package/dist/navigation/menubar/menubar-sub.js +125 -7
- package/dist/navigation/menubar/menubar.js +213 -13
- package/dist/navigation/navigation-menu.js +90 -18
- package/dist/navigation/pagination.js +91 -20
- package/dist/overlay/alert-dialog.js +485 -26
- package/dist/overlay/context-menu/context-menu-items.js +322 -16
- package/dist/overlay/context-menu/context-menu-sub.js +125 -7
- package/dist/overlay/context-menu/context-menu.js +140 -11
- package/dist/overlay/dialog.js +405 -24
- package/dist/overlay/floating/command.js +423 -20
- package/dist/overlay/floating/drawer.js +354 -22
- package/dist/overlay/floating/hover-card.js +107 -7
- package/dist/overlay/menu/dropdown-menu-choice.js +149 -7
- package/dist/overlay/menu/dropdown-menu-item.js +174 -9
- package/dist/overlay/menu/dropdown-menu-sub.js +124 -7
- package/dist/overlay/menu/dropdown-menu.js +147 -12
- package/dist/overlay/popover.js +106 -7
- package/dist/overlay/sheet.js +379 -26
- package/dist/overlay/tooltip.js +145 -9
- package/dist/shell/app-header.js +29 -5
- package/dist/shell/app-shell.js +19 -3
- package/dist/shell/breadcrumbs.js +46 -14
- package/dist/shell/docs/docs-header.js +210 -10
- package/dist/shell/docs/docs-shell.js +36 -3
- package/dist/shell/docs/docs-sidebar.js +41 -7
- package/dist/shell/docs/on-this-page.js +78 -7
- package/dist/shell/docs/use-active-section.js +44 -42
- package/dist/shell/navigation/app-sidebar.js +66 -6
- package/dist/shell/navigation/nav-group.js +53 -11
- package/dist/shell/theme-toggle.js +51 -4
- package/package.json +2 -2
|
@@ -1,41 +1,98 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { cn } from "cn";
|
|
4
3
|
import * as Slot from "radix-ui/slot";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
6
|
const ruleGridVariants = cva("grid grid-cols-1 gap-px p-px", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
variants: {
|
|
8
|
+
columns: {
|
|
9
|
+
1: "",
|
|
10
|
+
2: "sm:grid-cols-2",
|
|
11
|
+
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
12
|
+
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
columns: 3
|
|
17
|
+
}
|
|
17
18
|
});
|
|
18
|
-
function RuleGrid({
|
|
19
|
-
|
|
19
|
+
function RuleGrid({
|
|
20
|
+
className,
|
|
21
|
+
columns = 3,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /*#__PURE__*/_jsx("div", {
|
|
25
|
+
"data-slot": "rule-grid",
|
|
26
|
+
"data-columns": columns,
|
|
27
|
+
className: cn(ruleGridVariants({
|
|
28
|
+
columns,
|
|
29
|
+
className
|
|
30
|
+
})),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
20
33
|
}
|
|
21
|
-
function RuleGridCell({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
function RuleGridCell({
|
|
35
|
+
className,
|
|
36
|
+
asChild = false,
|
|
37
|
+
interactive = false,
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
41
|
+
return /*#__PURE__*/_jsx(Comp, {
|
|
42
|
+
"data-slot": "rule-grid-cell",
|
|
43
|
+
"data-interactive": interactive || undefined,
|
|
44
|
+
className: cn("flex min-w-0 flex-col gap-2 bg-card p-6 text-card-foreground ring-1 ring-border", interactive && "transition-colors duration-150 ease-out outline-none hover:bg-accent/60 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring active:bg-accent", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
25
47
|
}
|
|
26
|
-
function RuleGridHeader({
|
|
27
|
-
|
|
48
|
+
function RuleGridHeader({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /*#__PURE__*/_jsx("div", {
|
|
53
|
+
"data-slot": "rule-grid-header",
|
|
54
|
+
className: cn("-mx-6 -mt-6 mb-2 flex min-h-11 items-center gap-2 border-b bg-muted/35 px-6 py-2.5", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
28
57
|
}
|
|
29
|
-
function RuleGridFooter({
|
|
30
|
-
|
|
58
|
+
function RuleGridFooter({
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
return /*#__PURE__*/_jsx("div", {
|
|
63
|
+
"data-slot": "rule-grid-footer",
|
|
64
|
+
className: cn("-mx-6 mt-auto -mb-6 flex min-h-12 flex-wrap items-center gap-2 border-t bg-muted/70 px-6 py-3", className),
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
31
67
|
}
|
|
32
|
-
function RuleGridLabel({
|
|
33
|
-
|
|
68
|
+
function RuleGridLabel({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}) {
|
|
72
|
+
return /*#__PURE__*/_jsx("span", {
|
|
73
|
+
"data-slot": "rule-grid-label",
|
|
74
|
+
className: cn("eyebrow", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
34
77
|
}
|
|
35
|
-
function RuleGridTitle({
|
|
36
|
-
|
|
78
|
+
function RuleGridTitle({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /*#__PURE__*/_jsx("div", {
|
|
83
|
+
"data-slot": "rule-grid-title",
|
|
84
|
+
className: cn("text-[15px] font-medium tracking-[-0.01em]", className),
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
37
87
|
}
|
|
38
|
-
function RuleGridDescription({
|
|
39
|
-
|
|
88
|
+
function RuleGridDescription({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}) {
|
|
92
|
+
return /*#__PURE__*/_jsx("p", {
|
|
93
|
+
"data-slot": "rule-grid-description",
|
|
94
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
40
97
|
}
|
|
41
|
-
export { RuleGrid, RuleGridCell, RuleGridDescription, RuleGridFooter, RuleGridHeader, RuleGridLabel, RuleGridTitle, ruleGridVariants
|
|
98
|
+
export { RuleGrid, RuleGridCell, RuleGridDescription, RuleGridFooter, RuleGridHeader, RuleGridLabel, RuleGridTitle, ruleGridVariants };
|
|
@@ -1,8 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { cn } from "cn";
|
|
4
5
|
import * as SeparatorPrimitive from "radix-ui/separator";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function Separator(t0) {
|
|
9
|
+
const $ = _c(12);
|
|
10
|
+
let className;
|
|
11
|
+
let props;
|
|
12
|
+
let t1;
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] !== t0) {
|
|
15
|
+
({
|
|
16
|
+
className,
|
|
17
|
+
orientation: t1,
|
|
18
|
+
decorative: t2,
|
|
19
|
+
...props
|
|
20
|
+
} = t0);
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
$[1] = className;
|
|
23
|
+
$[2] = props;
|
|
24
|
+
$[3] = t1;
|
|
25
|
+
$[4] = t2;
|
|
26
|
+
} else {
|
|
27
|
+
className = $[1];
|
|
28
|
+
props = $[2];
|
|
29
|
+
t1 = $[3];
|
|
30
|
+
t2 = $[4];
|
|
31
|
+
}
|
|
32
|
+
const orientation = t1 === undefined ? "horizontal" : t1;
|
|
33
|
+
const decorative = t2 === undefined ? true : t2;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[5] !== className) {
|
|
36
|
+
t3 = cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className);
|
|
37
|
+
$[5] = className;
|
|
38
|
+
$[6] = t3;
|
|
39
|
+
} else {
|
|
40
|
+
t3 = $[6];
|
|
41
|
+
}
|
|
42
|
+
let t4;
|
|
43
|
+
if ($[7] !== decorative || $[8] !== orientation || $[9] !== props || $[10] !== t3) {
|
|
44
|
+
t4 = /*#__PURE__*/_jsx(SeparatorPrimitive.Root, {
|
|
45
|
+
"data-slot": "separator",
|
|
46
|
+
decorative: decorative,
|
|
47
|
+
orientation: orientation,
|
|
48
|
+
className: t3,
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
$[7] = decorative;
|
|
52
|
+
$[8] = orientation;
|
|
53
|
+
$[9] = props;
|
|
54
|
+
$[10] = t3;
|
|
55
|
+
$[11] = t4;
|
|
56
|
+
} else {
|
|
57
|
+
t4 = $[11];
|
|
58
|
+
}
|
|
59
|
+
return t4;
|
|
7
60
|
}
|
|
8
61
|
export { Separator };
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { RuleGrid, RuleGridCell } from "../../rule-grid/rule-grid.js";
|
|
3
2
|
import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
function SkeletonRuleGrid({
|
|
5
|
+
cells = 3,
|
|
6
|
+
columns = 3,
|
|
7
|
+
label,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const count = Math.max(1, Math.floor(cells));
|
|
11
|
+
return /*#__PURE__*/_jsxs(RuleGrid, {
|
|
12
|
+
"data-slot": "skeleton-rule-grid",
|
|
13
|
+
columns: columns,
|
|
14
|
+
...skeletonRootProps,
|
|
15
|
+
...props,
|
|
16
|
+
children: [Array.from({
|
|
17
|
+
length: count
|
|
18
|
+
}, (_, index) => /*#__PURE__*/_jsxs(RuleGridCell
|
|
19
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder cells have no identity
|
|
20
|
+
, {
|
|
21
|
+
"data-slot": "skeleton-rule-grid-cell",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
className: "gap-3",
|
|
24
|
+
children: [/*#__PURE__*/_jsx(SkeletonBar, {
|
|
25
|
+
className: "h-3 w-20"
|
|
26
|
+
}), /*#__PURE__*/_jsx(SkeletonBar, {
|
|
27
|
+
className: "h-7 w-28"
|
|
28
|
+
})]
|
|
29
|
+
}, index)), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
|
|
30
|
+
children: label
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
9
33
|
}
|
|
10
34
|
export { SkeletonRuleGrid };
|
|
@@ -1,16 +1,54 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cn } from "cn";
|
|
3
2
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../table.js";
|
|
4
3
|
import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const cellWidths = ["w-24", "w-32", "w-20", "w-28", "w-16"];
|
|
6
6
|
function cellWidth(column) {
|
|
7
|
-
|
|
7
|
+
return cellWidths[column % cellWidths.length];
|
|
8
8
|
}
|
|
9
9
|
function indexes(count) {
|
|
10
|
-
|
|
10
|
+
return Array.from({
|
|
11
|
+
length: Math.max(1, Math.floor(count))
|
|
12
|
+
}, (_, index) => index);
|
|
11
13
|
}
|
|
12
|
-
function SkeletonTable({
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
function SkeletonTable({
|
|
15
|
+
rows = 5,
|
|
16
|
+
columns = 4,
|
|
17
|
+
label,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const columnIndexes = indexes(columns);
|
|
22
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
23
|
+
"data-slot": "skeleton-table",
|
|
24
|
+
...skeletonRootProps,
|
|
25
|
+
className: cn("w-full", className),
|
|
26
|
+
...props,
|
|
27
|
+
children: [/*#__PURE__*/_jsxs(Table, {
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: [/*#__PURE__*/_jsx(TableHeader, {
|
|
30
|
+
children: /*#__PURE__*/_jsx(TableRow, {
|
|
31
|
+
className: "hover:bg-transparent",
|
|
32
|
+
children: columnIndexes.map(column => /*#__PURE__*/_jsx(TableHead, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(SkeletonBar, {
|
|
34
|
+
className: "h-3 w-16"
|
|
35
|
+
})
|
|
36
|
+
}, column))
|
|
37
|
+
})
|
|
38
|
+
}), /*#__PURE__*/_jsx(TableBody, {
|
|
39
|
+
children: indexes(rows).map(row => /*#__PURE__*/_jsx(TableRow, {
|
|
40
|
+
"data-slot": "skeleton-table-row",
|
|
41
|
+
className: "hover:bg-transparent",
|
|
42
|
+
children: columnIndexes.map(column => /*#__PURE__*/_jsx(TableCell, {
|
|
43
|
+
children: /*#__PURE__*/_jsx(SkeletonBar, {
|
|
44
|
+
className: cn("h-4", cellWidth(column))
|
|
45
|
+
})
|
|
46
|
+
}, column))
|
|
47
|
+
}, row))
|
|
48
|
+
})]
|
|
49
|
+
}), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
|
|
50
|
+
children: label
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
15
53
|
}
|
|
16
54
|
export { SkeletonTable };
|
|
@@ -1,20 +1,38 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { cn } from "cn";
|
|
4
3
|
import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const skeletonAvatarVariants = cva("rounded-full", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "size-6",
|
|
9
|
+
md: "size-8",
|
|
10
|
+
lg: "size-10"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
size: "md"
|
|
15
|
+
}
|
|
16
16
|
});
|
|
17
|
-
function SkeletonAvatar({
|
|
18
|
-
|
|
17
|
+
function SkeletonAvatar({
|
|
18
|
+
size = "md",
|
|
19
|
+
label,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
24
|
+
"data-slot": "skeleton-avatar",
|
|
25
|
+
"data-size": size,
|
|
26
|
+
...skeletonRootProps,
|
|
27
|
+
className: cn("inline-flex shrink-0", className),
|
|
28
|
+
...props,
|
|
29
|
+
children: [/*#__PURE__*/_jsx(SkeletonBar, {
|
|
30
|
+
className: skeletonAvatarVariants({
|
|
31
|
+
size
|
|
32
|
+
})
|
|
33
|
+
}), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
|
|
34
|
+
children: label
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
19
37
|
}
|
|
20
38
|
export { SkeletonAvatar, skeletonAvatarVariants };
|
|
@@ -1,20 +1,38 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { cn } from "cn";
|
|
4
3
|
import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const skeletonButtonVariants = cva("rounded-full", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "h-8 w-20",
|
|
9
|
+
default: "h-9 w-24",
|
|
10
|
+
lg: "h-10 w-28"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
size: "default"
|
|
15
|
+
}
|
|
16
16
|
});
|
|
17
|
-
function SkeletonButton({
|
|
18
|
-
|
|
17
|
+
function SkeletonButton({
|
|
18
|
+
size = "default",
|
|
19
|
+
label,
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
24
|
+
"data-slot": "skeleton-button",
|
|
25
|
+
"data-size": size,
|
|
26
|
+
...skeletonRootProps,
|
|
27
|
+
className: cn("inline-flex shrink-0", className),
|
|
28
|
+
...props,
|
|
29
|
+
children: [/*#__PURE__*/_jsx(SkeletonBar, {
|
|
30
|
+
className: skeletonButtonVariants({
|
|
31
|
+
size
|
|
32
|
+
})
|
|
33
|
+
}), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
|
|
34
|
+
children: label
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
19
37
|
}
|
|
20
38
|
export { SkeletonButton, skeletonButtonVariants };
|
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { cn } from "cn";
|
|
3
2
|
import { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps } from "../skeleton-parts.js";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
function lineWidth(index, lines) {
|
|
5
|
-
|
|
5
|
+
return lines > 1 && index === lines - 1 ? "w-3/5" : "w-full";
|
|
6
6
|
}
|
|
7
|
-
function SkeletonText({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
function SkeletonText({
|
|
8
|
+
lines = 3,
|
|
9
|
+
label,
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const count = Math.max(1, Math.floor(lines));
|
|
14
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
15
|
+
"data-slot": "skeleton-text",
|
|
16
|
+
...skeletonRootProps,
|
|
17
|
+
className: cn("flex w-full flex-col gap-2", className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [Array.from({
|
|
20
|
+
length: count
|
|
21
|
+
}, (_, index) => /*#__PURE__*/_jsx(SkeletonBar
|
|
22
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder lines have no identity
|
|
23
|
+
, {
|
|
24
|
+
"data-slot": "skeleton-text-line",
|
|
25
|
+
className: cn("h-4", lineWidth(index, count))
|
|
26
|
+
}, index)), /*#__PURE__*/_jsx(SkeletonLoadingLabel, {
|
|
27
|
+
children: label
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
12
30
|
}
|
|
13
31
|
export { SkeletonText };
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cn } from "cn";
|
|
3
2
|
import { Skeleton } from "../status/skeleton.js";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
function SkeletonBar({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/_jsx(Skeleton, {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
className: cn("rounded-none bg-skeleton motion-reduce:animate-none", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
6
13
|
}
|
|
7
|
-
function SkeletonLoadingLabel({
|
|
8
|
-
|
|
14
|
+
function SkeletonLoadingLabel({
|
|
15
|
+
children = "Loading…"
|
|
16
|
+
}) {
|
|
17
|
+
return /*#__PURE__*/_jsx("span", {
|
|
18
|
+
"data-slot": "skeleton-loading-label",
|
|
19
|
+
className: "sr-only",
|
|
20
|
+
children: children
|
|
21
|
+
});
|
|
9
22
|
}
|
|
10
|
-
const skeletonRootProps = {
|
|
23
|
+
const skeletonRootProps = {
|
|
24
|
+
role: "status",
|
|
25
|
+
"aria-busy": true
|
|
26
|
+
};
|
|
11
27
|
export { SkeletonBar, SkeletonLoadingLabel, skeletonRootProps };
|
|
@@ -1,26 +1,52 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { cn } from "cn";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
const alertVariants = cva("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5", {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-card text-card-foreground",
|
|
9
|
+
success: "border-good/30 bg-good/5 text-card-foreground [&>svg]:text-good",
|
|
10
|
+
warning: "border-warn/30 bg-warn/5 text-card-foreground [&>svg]:text-warn",
|
|
11
|
+
destructive: "border-destructive/30 bg-destructive/5 text-card-foreground [&>svg]:text-destructive *:data-[slot=alert-title]:text-destructive"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "default"
|
|
16
|
+
}
|
|
16
17
|
});
|
|
17
|
-
function Alert({
|
|
18
|
-
|
|
18
|
+
function Alert({
|
|
19
|
+
className,
|
|
20
|
+
variant,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /*#__PURE__*/_jsx("div", {
|
|
24
|
+
"data-slot": "alert",
|
|
25
|
+
role: "alert",
|
|
26
|
+
className: cn(alertVariants({
|
|
27
|
+
variant
|
|
28
|
+
}), className),
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
19
31
|
}
|
|
20
|
-
function AlertTitle({
|
|
21
|
-
|
|
32
|
+
function AlertTitle({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return /*#__PURE__*/_jsx("div", {
|
|
37
|
+
"data-slot": "alert-title",
|
|
38
|
+
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
22
41
|
}
|
|
23
|
-
function AlertDescription({
|
|
24
|
-
|
|
42
|
+
function AlertDescription({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
return /*#__PURE__*/_jsx("div", {
|
|
47
|
+
"data-slot": "alert-description",
|
|
48
|
+
className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
25
51
|
}
|
|
26
52
|
export { Alert, AlertDescription, AlertTitle };
|
|
@@ -1,33 +1,80 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import { cva } from "class-variance-authority";
|
|
3
2
|
import { cn } from "cn";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
function Empty({
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/_jsx("div", {
|
|
9
|
+
"data-slot": "empty",
|
|
10
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 p-6 text-center text-balance md:p-12", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
6
13
|
}
|
|
7
|
-
function EmptyHeader({
|
|
8
|
-
|
|
14
|
+
function EmptyHeader({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /*#__PURE__*/_jsx("div", {
|
|
19
|
+
"data-slot": "empty-header",
|
|
20
|
+
className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
9
23
|
}
|
|
10
24
|
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
default: "bg-transparent",
|
|
28
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default"
|
|
33
|
+
}
|
|
20
34
|
});
|
|
21
|
-
function EmptyMedia({
|
|
22
|
-
|
|
35
|
+
function EmptyMedia({
|
|
36
|
+
className,
|
|
37
|
+
variant = "default",
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /*#__PURE__*/_jsx("div", {
|
|
41
|
+
"data-slot": "empty-icon",
|
|
42
|
+
"data-variant": variant,
|
|
43
|
+
className: cn(emptyMediaVariants({
|
|
44
|
+
variant,
|
|
45
|
+
className
|
|
46
|
+
})),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
23
49
|
}
|
|
24
|
-
function EmptyTitle({
|
|
25
|
-
|
|
50
|
+
function EmptyTitle({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}) {
|
|
54
|
+
return /*#__PURE__*/_jsx("div", {
|
|
55
|
+
"data-slot": "empty-title",
|
|
56
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
26
59
|
}
|
|
27
|
-
function EmptyDescription({
|
|
28
|
-
|
|
60
|
+
function EmptyDescription({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return /*#__PURE__*/_jsx("div", {
|
|
65
|
+
"data-slot": "empty-description",
|
|
66
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
29
69
|
}
|
|
30
|
-
function EmptyContent({
|
|
31
|
-
|
|
70
|
+
function EmptyContent({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}) {
|
|
74
|
+
return /*#__PURE__*/_jsx("div", {
|
|
75
|
+
"data-slot": "empty-content",
|
|
76
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
32
79
|
}
|
|
33
80
|
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|