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