@elizaos/ui 2.0.0-alpha.73 → 2.0.0-alpha.76
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/components/ui/badge.d.ts +10 -0
- package/components/ui/badge.d.ts.map +1 -0
- package/components/ui/badge.js +20 -0
- package/components/ui/banner.d.ts +18 -0
- package/components/ui/banner.d.ts.map +1 -0
- package/components/ui/banner.js +27 -0
- package/components/ui/button.d.ts +12 -0
- package/components/ui/button.d.ts.map +1 -0
- package/components/ui/button.js +37 -0
- package/components/ui/card.d.ts +9 -0
- package/components/ui/card.d.ts.map +1 -0
- package/components/ui/card.js +16 -0
- package/components/ui/chat-atoms.d.ts +26 -0
- package/components/ui/chat-atoms.d.ts.map +1 -0
- package/components/ui/chat-atoms.js +17 -0
- package/components/ui/checkbox.d.ts +5 -0
- package/components/ui/checkbox.d.ts.map +1 -0
- package/components/ui/checkbox.js +8 -0
- package/components/ui/confirm-delete.d.ts +12 -0
- package/components/ui/confirm-delete.d.ts.map +1 -0
- package/components/ui/confirm-delete.js +13 -0
- package/components/ui/confirm-dialog.d.ts +24 -0
- package/components/ui/confirm-dialog.d.ts.map +1 -0
- package/components/ui/confirm-dialog.js +55 -0
- package/components/ui/connection-status.d.ts +9 -0
- package/components/ui/connection-status.d.ts.map +1 -0
- package/components/ui/connection-status.js +25 -0
- package/components/ui/copy-button.d.ts +13 -0
- package/components/ui/copy-button.d.ts.map +1 -0
- package/components/ui/copy-button.js +14 -0
- package/components/ui/dialog.d.ts +20 -0
- package/components/ui/dialog.d.ts.map +1 -0
- package/components/ui/dialog.js +22 -0
- package/components/ui/dropdown-menu.d.ts +28 -0
- package/components/ui/dropdown-menu.d.ts.map +1 -0
- package/components/ui/dropdown-menu.js +35 -0
- package/components/ui/empty-state.d.ts +13 -0
- package/components/ui/empty-state.d.ts.map +1 -0
- package/components/ui/empty-state.js +5 -0
- package/components/ui/error-boundary.d.ts +18 -0
- package/components/ui/error-boundary.d.ts.map +1 -0
- package/components/ui/error-boundary.js +27 -0
- package/components/ui/grid.d.ts +11 -0
- package/components/ui/grid.d.ts.map +1 -0
- package/components/ui/grid.js +30 -0
- package/components/ui/input.d.ts +6 -0
- package/components/ui/input.d.ts.map +1 -0
- package/components/ui/input.js +8 -0
- package/components/ui/label.d.ts +6 -0
- package/components/ui/label.d.ts.map +1 -0
- package/components/ui/label.js +9 -0
- package/components/ui/popover.d.ts +7 -0
- package/components/ui/popover.d.ts.map +1 -0
- package/components/ui/popover.js +9 -0
- package/components/ui/save-footer.d.ts +13 -0
- package/components/ui/save-footer.d.ts.map +1 -0
- package/components/ui/save-footer.js +9 -0
- package/components/ui/search-bar.d.ts +17 -0
- package/components/ui/search-bar.d.ts.map +1 -0
- package/components/ui/search-bar.js +19 -0
- package/components/ui/search-input.d.ts +11 -0
- package/components/ui/search-input.d.ts.map +1 -0
- package/components/ui/search-input.js +9 -0
- package/components/ui/section-card.d.ts +15 -0
- package/components/ui/section-card.d.ts.map +1 -0
- package/components/ui/section-card.js +9 -0
- package/components/ui/select.d.ts +14 -0
- package/components/ui/select.d.ts.map +1 -0
- package/components/ui/select.js +26 -0
- package/components/ui/separator.d.ts +5 -0
- package/components/ui/separator.d.ts.map +1 -0
- package/components/ui/separator.js +7 -0
- package/components/ui/skeleton.d.ts +17 -0
- package/components/ui/skeleton.d.ts.map +1 -0
- package/components/ui/skeleton.js +25 -0
- package/components/ui/slider.d.ts +5 -0
- package/components/ui/slider.d.ts.map +1 -0
- package/components/ui/slider.js +7 -0
- package/components/ui/sonner.d.ts +5 -0
- package/components/ui/sonner.d.ts.map +1 -0
- package/components/ui/sonner.js +15 -0
- package/components/ui/spinner.d.ts +6 -0
- package/components/ui/spinner.d.ts.map +1 -0
- package/components/ui/spinner.js +8 -0
- package/components/ui/stack.d.ts +13 -0
- package/components/ui/stack.d.ts.map +1 -0
- package/components/ui/stack.js +39 -0
- package/components/ui/status-badge.d.ts +20 -0
- package/components/ui/status-badge.d.ts.map +1 -0
- package/components/ui/status-badge.js +41 -0
- package/components/ui/switch.d.ts +5 -0
- package/components/ui/switch.d.ts.map +1 -0
- package/components/ui/switch.js +7 -0
- package/components/ui/tabs.d.ts +8 -0
- package/components/ui/tabs.d.ts.map +1 -0
- package/components/ui/tabs.js +12 -0
- package/components/ui/tag-editor.d.ts +24 -0
- package/components/ui/tag-editor.d.ts.map +1 -0
- package/components/ui/tag-editor.js +32 -0
- package/components/ui/tag-input.d.ts +19 -0
- package/components/ui/tag-input.d.ts.map +1 -0
- package/components/ui/tag-input.js +28 -0
- package/components/ui/textarea.d.ts +6 -0
- package/components/ui/textarea.d.ts.map +1 -0
- package/components/ui/textarea.js +8 -0
- package/components/ui/themed-select.d.ts +27 -0
- package/components/ui/themed-select.d.ts.map +1 -0
- package/components/ui/themed-select.js +57 -0
- package/components/ui/tooltip-extended.d.ts +76 -0
- package/components/ui/tooltip-extended.d.ts.map +1 -0
- package/components/ui/tooltip-extended.js +128 -0
- package/components/ui/tooltip.d.ts +8 -0
- package/components/ui/tooltip.d.ts.map +1 -0
- package/components/ui/tooltip.js +10 -0
- package/components/ui/typography.d.ts +17 -0
- package/components/ui/typography.d.ts.map +1 -0
- package/components/ui/typography.js +44 -0
- package/index.d.ts +42 -0
- package/index.d.ts.map +1 -0
- package/{src/index.ts → index.js} +0 -1
- package/lib/button-styles.d.ts +12 -0
- package/lib/button-styles.d.ts.map +1 -0
- package/lib/button-styles.js +11 -0
- package/lib/utils.d.ts +6 -0
- package/lib/utils.d.ts.map +1 -0
- package/{src/lib/utils.ts → lib/utils.js} +3 -4
- package/package.json +16 -18
- package/README.md +0 -6
- package/src/components/ui/badge.tsx +0 -35
- package/src/components/ui/banner.tsx +0 -81
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/chat-atoms.tsx +0 -129
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/confirm-delete.tsx +0 -67
- package/src/components/ui/confirm-dialog.tsx +0 -142
- package/src/components/ui/connection-status.tsx +0 -54
- package/src/components/ui/copy-button.tsx +0 -60
- package/src/components/ui/dialog.tsx +0 -120
- package/src/components/ui/dropdown-menu.tsx +0 -198
- package/src/components/ui/empty-state.tsx +0 -42
- package/src/components/ui/error-boundary.tsx +0 -63
- package/src/components/ui/grid.tsx +0 -43
- package/src/components/ui/input.tsx +0 -25
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/save-footer.tsx +0 -58
- package/src/components/ui/search-bar.tsx +0 -61
- package/src/components/ui/search-input.tsx +0 -56
- package/src/components/ui/section-card.tsx +0 -85
- package/src/components/ui/select.tsx +0 -158
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/skeleton.tsx +0 -115
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -28
- package/src/components/ui/spinner.tsx +0 -21
- package/src/components/ui/stack.tsx +0 -55
- package/src/components/ui/status-badge.tsx +0 -128
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/tag-editor.tsx +0 -111
- package/src/components/ui/tag-input.tsx +0 -108
- package/src/components/ui/textarea.tsx +0 -24
- package/src/components/ui/themed-select.tsx +0 -141
- package/src/components/ui/tooltip-extended.tsx +0 -340
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/components/ui/typography.tsx +0 -74
- package/src/lib/button-styles.ts +0 -19
- package/tsconfig.build.json +0 -18
- package/tsconfig.json +0 -32
- /package/{src/styles → styles}/theme.css +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const gridVariants = cva("grid", {
|
|
6
|
-
variants: {
|
|
7
|
-
columns: {
|
|
8
|
-
1: "grid-cols-1",
|
|
9
|
-
2: "grid-cols-2",
|
|
10
|
-
3: "grid-cols-3",
|
|
11
|
-
4: "grid-cols-4",
|
|
12
|
-
6: "grid-cols-6",
|
|
13
|
-
12: "grid-cols-12",
|
|
14
|
-
},
|
|
15
|
-
spacing: {
|
|
16
|
-
none: "gap-0",
|
|
17
|
-
sm: "gap-2",
|
|
18
|
-
md: "gap-4",
|
|
19
|
-
lg: "gap-6",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
columns: 1,
|
|
24
|
-
spacing: "md",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export interface GridProps
|
|
29
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
30
|
-
VariantProps<typeof gridVariants> {}
|
|
31
|
-
|
|
32
|
-
export const Grid = React.forwardRef<HTMLDivElement, GridProps>(
|
|
33
|
-
({ className, columns, spacing, ...props }, ref) => {
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
ref={ref}
|
|
37
|
-
className={cn(gridVariants({ columns, spacing }), className)}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
);
|
|
43
|
-
Grid.displayName = "Grid";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
export interface InputProps
|
|
6
|
-
extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
7
|
-
|
|
8
|
-
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
9
|
-
({ className, type, ...props }, ref) => {
|
|
10
|
-
return (
|
|
11
|
-
<input
|
|
12
|
-
type={type}
|
|
13
|
-
className={cn(
|
|
14
|
-
"flex h-10 w-full rounded-md border border-input bg-bg px-3 py-2 text-sm ring-offset-bg file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
ref={ref}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
},
|
|
22
|
-
);
|
|
23
|
-
Input.displayName = "Input";
|
|
24
|
-
|
|
25
|
-
export { Input };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const labelVariants = cva(
|
|
8
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
const Label = React.forwardRef<
|
|
12
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
13
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
14
|
-
VariantProps<typeof labelVariants>
|
|
15
|
-
>(({ className, ...props }, ref) => (
|
|
16
|
-
<LabelPrimitive.Root
|
|
17
|
-
ref={ref}
|
|
18
|
-
className={cn(labelVariants(), className)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
));
|
|
22
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
23
|
-
|
|
24
|
-
export { Label };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Popover = PopoverPrimitive.Root;
|
|
7
|
-
|
|
8
|
-
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9
|
-
|
|
10
|
-
const PopoverContent = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
13
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
14
|
-
<PopoverPrimitive.Portal>
|
|
15
|
-
<PopoverPrimitive.Content
|
|
16
|
-
ref={ref}
|
|
17
|
-
align={align}
|
|
18
|
-
sideOffset={sideOffset}
|
|
19
|
-
className={cn(
|
|
20
|
-
"z-50 w-72 rounded-md border border-border bg-card p-4 text-txt shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
</PopoverPrimitive.Portal>
|
|
26
|
-
));
|
|
27
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
28
|
-
|
|
29
|
-
export { Popover, PopoverContent, PopoverTrigger };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
3
|
-
|
|
4
|
-
export interface SaveFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
dirty: boolean;
|
|
6
|
-
saving: boolean;
|
|
7
|
-
saveError: string | null;
|
|
8
|
-
saveSuccess: boolean;
|
|
9
|
-
onSave: () => void;
|
|
10
|
-
saveLabel?: string;
|
|
11
|
-
savingLabel?: string;
|
|
12
|
-
savedLabel?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const SaveFooter = React.forwardRef<HTMLDivElement, SaveFooterProps>(
|
|
16
|
-
(
|
|
17
|
-
{
|
|
18
|
-
dirty,
|
|
19
|
-
saving,
|
|
20
|
-
saveError,
|
|
21
|
-
saveSuccess,
|
|
22
|
-
onSave,
|
|
23
|
-
saveLabel = "Save Changes",
|
|
24
|
-
savingLabel = "Saving…",
|
|
25
|
-
savedLabel = "Saved",
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
},
|
|
29
|
-
ref,
|
|
30
|
-
) => {
|
|
31
|
-
if (!dirty) return null;
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(
|
|
37
|
-
"flex items-center justify-end gap-3 border-t border-border pt-2",
|
|
38
|
-
className,
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
{saveError && (
|
|
43
|
-
<span className="text-xs text-destructive">{saveError}</span>
|
|
44
|
-
)}
|
|
45
|
-
{saveSuccess && <span className="text-xs text-ok">{savedLabel}</span>}
|
|
46
|
-
<button
|
|
47
|
-
type="button"
|
|
48
|
-
className="rounded-md bg-primary px-4 py-1.5 text-xs font-semibold text-primary-fg transition-opacity hover:opacity-90 disabled:opacity-50"
|
|
49
|
-
disabled={saving}
|
|
50
|
-
onClick={onSave}
|
|
51
|
-
>
|
|
52
|
-
{saving ? savingLabel : saveLabel}
|
|
53
|
-
</button>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
SaveFooter.displayName = "SaveFooter";
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SearchBar — a self-contained search input with submit button.
|
|
3
|
-
*
|
|
4
|
-
* Fully generic; no app-context dependency. Callers pass the placeholder
|
|
5
|
-
* and loading state directly.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { useCallback, useState } from "react";
|
|
9
|
-
import { Button } from "./button";
|
|
10
|
-
import { Input } from "./input";
|
|
11
|
-
|
|
12
|
-
export interface SearchBarProps {
|
|
13
|
-
onSearch: (query: string) => void;
|
|
14
|
-
searching?: boolean;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
/** Label for the submit button when idle. Defaults to "Search". */
|
|
17
|
-
searchLabel?: string;
|
|
18
|
-
/** Label for the submit button when busy. Defaults to "Searching...". */
|
|
19
|
-
searchingLabel?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function SearchBar({
|
|
23
|
-
onSearch,
|
|
24
|
-
searching,
|
|
25
|
-
placeholder = "Search...",
|
|
26
|
-
searchLabel = "Search",
|
|
27
|
-
searchingLabel = "Searching...",
|
|
28
|
-
}: SearchBarProps) {
|
|
29
|
-
const [query, setQuery] = useState("");
|
|
30
|
-
|
|
31
|
-
const handleSubmit = useCallback(() => {
|
|
32
|
-
if (query.trim()) {
|
|
33
|
-
onSearch(query.trim());
|
|
34
|
-
}
|
|
35
|
-
}, [query, onSearch]);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className="mb-6">
|
|
39
|
-
<div className="flex gap-2">
|
|
40
|
-
<Input
|
|
41
|
-
type="text"
|
|
42
|
-
placeholder={placeholder}
|
|
43
|
-
value={query}
|
|
44
|
-
onChange={(e) => setQuery(e.target.value)}
|
|
45
|
-
onKeyDown={(e) => e.key === "Enter" && handleSubmit()}
|
|
46
|
-
className="h-9 bg-bg border-border text-sm shadow-sm focus-visible:ring-1 focus-visible:ring-accent"
|
|
47
|
-
disabled={searching}
|
|
48
|
-
/>
|
|
49
|
-
<Button
|
|
50
|
-
variant="default"
|
|
51
|
-
size="sm"
|
|
52
|
-
className="h-9 px-4 shadow-sm"
|
|
53
|
-
onClick={handleSubmit}
|
|
54
|
-
disabled={!query.trim() || searching}
|
|
55
|
-
>
|
|
56
|
-
{searching ? searchingLabel : searchLabel}
|
|
57
|
-
</Button>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Search, X } from "lucide-react";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
export interface SearchInputProps
|
|
6
|
-
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
7
|
-
/** Called when the clear button is clicked */
|
|
8
|
-
onClear?: () => void;
|
|
9
|
-
/** Show a loading indicator */
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
/** Aria-label for the clear button */
|
|
12
|
-
clearLabel?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
|
|
16
|
-
(
|
|
17
|
-
{
|
|
18
|
-
className,
|
|
19
|
-
value,
|
|
20
|
-
onClear,
|
|
21
|
-
loading,
|
|
22
|
-
clearLabel = "Clear search",
|
|
23
|
-
...props
|
|
24
|
-
},
|
|
25
|
-
ref,
|
|
26
|
-
) => {
|
|
27
|
-
const hasValue = typeof value === "string" ? value.length > 0 : !!value;
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div className={cn("relative flex items-center", className)}>
|
|
31
|
-
<Search className="pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-muted" />
|
|
32
|
-
<input
|
|
33
|
-
ref={ref}
|
|
34
|
-
type="text"
|
|
35
|
-
value={value}
|
|
36
|
-
className="h-8 w-full rounded-md border border-input bg-bg pl-8 pr-8 text-xs placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
{hasValue && onClear && (
|
|
40
|
-
<button
|
|
41
|
-
type="button"
|
|
42
|
-
onClick={onClear}
|
|
43
|
-
className="absolute right-2 rounded-sm p-0.5 text-muted hover:text-txt transition-colors"
|
|
44
|
-
aria-label={clearLabel}
|
|
45
|
-
>
|
|
46
|
-
<X className="h-3 w-3" />
|
|
47
|
-
</button>
|
|
48
|
-
)}
|
|
49
|
-
{loading && (
|
|
50
|
-
<div className="absolute right-2 h-3 w-3 animate-spin rounded-full border-2 border-muted border-t-accent" />
|
|
51
|
-
)}
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
},
|
|
55
|
-
);
|
|
56
|
-
SearchInput.displayName = "SearchInput";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "../../lib/utils";
|
|
3
|
-
|
|
4
|
-
/* ── SectionCard ─────────────────────────────────────────────────────── */
|
|
5
|
-
|
|
6
|
-
export interface SectionCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
/** Section title shown in the header */
|
|
8
|
-
title?: string;
|
|
9
|
-
/** Optional description below the title */
|
|
10
|
-
description?: string;
|
|
11
|
-
/** Optional actions (buttons, badges) aligned to the right of the header */
|
|
12
|
-
actions?: React.ReactNode;
|
|
13
|
-
/** Whether the section is collapsible */
|
|
14
|
-
collapsible?: boolean;
|
|
15
|
-
/** Default collapsed state (only when collapsible) */
|
|
16
|
-
defaultCollapsed?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const SectionCard = React.forwardRef<HTMLDivElement, SectionCardProps>(
|
|
20
|
-
(
|
|
21
|
-
{
|
|
22
|
-
title,
|
|
23
|
-
description,
|
|
24
|
-
actions,
|
|
25
|
-
collapsible = false,
|
|
26
|
-
defaultCollapsed = false,
|
|
27
|
-
className,
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
},
|
|
31
|
-
ref,
|
|
32
|
-
) => {
|
|
33
|
-
const [collapsed, setCollapsed] = React.useState(defaultCollapsed);
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<div
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn("border border-border bg-card text-card-fg", className)}
|
|
39
|
-
{...props}
|
|
40
|
-
>
|
|
41
|
-
{(title || actions) && (
|
|
42
|
-
<div className="flex items-center justify-between border-b border-border px-4 py-4">
|
|
43
|
-
<div className="flex flex-col gap-1.5">
|
|
44
|
-
{title && (
|
|
45
|
-
<button
|
|
46
|
-
type="button"
|
|
47
|
-
className={cn(
|
|
48
|
-
"text-sm font-semibold text-left",
|
|
49
|
-
collapsible &&
|
|
50
|
-
"cursor-pointer hover:text-accent transition-colors",
|
|
51
|
-
!collapsible && "cursor-default",
|
|
52
|
-
)}
|
|
53
|
-
onClick={
|
|
54
|
-
collapsible ? () => setCollapsed((c) => !c) : undefined
|
|
55
|
-
}
|
|
56
|
-
tabIndex={collapsible ? 0 : -1}
|
|
57
|
-
>
|
|
58
|
-
{collapsible && (
|
|
59
|
-
<span
|
|
60
|
-
className={cn(
|
|
61
|
-
"mr-1.5 inline-block text-[10px] text-muted transition-transform",
|
|
62
|
-
!collapsed && "rotate-90",
|
|
63
|
-
)}
|
|
64
|
-
>
|
|
65
|
-
▶
|
|
66
|
-
</span>
|
|
67
|
-
)}
|
|
68
|
-
{title}
|
|
69
|
-
</button>
|
|
70
|
-
)}
|
|
71
|
-
{description && (
|
|
72
|
-
<span className="text-[11px] text-muted">{description}</span>
|
|
73
|
-
)}
|
|
74
|
-
</div>
|
|
75
|
-
{actions && (
|
|
76
|
-
<div className="flex items-center gap-2">{actions}</div>
|
|
77
|
-
)}
|
|
78
|
-
</div>
|
|
79
|
-
)}
|
|
80
|
-
{(!collapsible || !collapsed) && <div className="p-4">{children}</div>}
|
|
81
|
-
</div>
|
|
82
|
-
);
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
SectionCard.displayName = "SectionCard";
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const Select = SelectPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const SelectGroup = SelectPrimitive.Group;
|
|
10
|
-
|
|
11
|
-
const SelectValue = SelectPrimitive.Value;
|
|
12
|
-
|
|
13
|
-
const SelectTrigger = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
16
|
-
>(({ className, children, ...props }, ref) => (
|
|
17
|
-
<SelectPrimitive.Trigger
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-bg px-3 py-2 text-sm ring-offset-bg placeholder:text-muted focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
<SelectPrimitive.Icon asChild>
|
|
27
|
-
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
28
|
-
</SelectPrimitive.Icon>
|
|
29
|
-
</SelectPrimitive.Trigger>
|
|
30
|
-
));
|
|
31
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
32
|
-
|
|
33
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
34
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
36
|
-
>(({ className, ...props }, ref) => (
|
|
37
|
-
<SelectPrimitive.ScrollUpButton
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn(
|
|
40
|
-
"flex cursor-default items-center justify-center py-1",
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
<ChevronUp className="h-4 w-4" />
|
|
46
|
-
</SelectPrimitive.ScrollUpButton>
|
|
47
|
-
));
|
|
48
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
49
|
-
|
|
50
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
51
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
52
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
53
|
-
>(({ className, ...props }, ref) => (
|
|
54
|
-
<SelectPrimitive.ScrollDownButton
|
|
55
|
-
ref={ref}
|
|
56
|
-
className={cn(
|
|
57
|
-
"flex cursor-default items-center justify-center py-1",
|
|
58
|
-
className,
|
|
59
|
-
)}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
<ChevronDown className="h-4 w-4" />
|
|
63
|
-
</SelectPrimitive.ScrollDownButton>
|
|
64
|
-
));
|
|
65
|
-
SelectScrollDownButton.displayName =
|
|
66
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
67
|
-
|
|
68
|
-
const SelectContent = React.forwardRef<
|
|
69
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
70
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
71
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
72
|
-
<SelectPrimitive.Portal>
|
|
73
|
-
<SelectPrimitive.Content
|
|
74
|
-
ref={ref}
|
|
75
|
-
className={cn(
|
|
76
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-border bg-card text-txt shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
77
|
-
position === "popper" &&
|
|
78
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
position={position}
|
|
82
|
-
{...props}
|
|
83
|
-
>
|
|
84
|
-
<SelectScrollUpButton />
|
|
85
|
-
<SelectPrimitive.Viewport
|
|
86
|
-
className={cn(
|
|
87
|
-
"p-1",
|
|
88
|
-
position === "popper" &&
|
|
89
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
90
|
-
)}
|
|
91
|
-
>
|
|
92
|
-
{children}
|
|
93
|
-
</SelectPrimitive.Viewport>
|
|
94
|
-
<SelectScrollDownButton />
|
|
95
|
-
</SelectPrimitive.Content>
|
|
96
|
-
</SelectPrimitive.Portal>
|
|
97
|
-
));
|
|
98
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
99
|
-
|
|
100
|
-
const SelectLabel = React.forwardRef<
|
|
101
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
102
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
104
|
-
<SelectPrimitive.Label
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
107
|
-
{...props}
|
|
108
|
-
/>
|
|
109
|
-
));
|
|
110
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
111
|
-
|
|
112
|
-
const SelectItem = React.forwardRef<
|
|
113
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
114
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
115
|
-
>(({ className, children, ...props }, ref) => (
|
|
116
|
-
<SelectPrimitive.Item
|
|
117
|
-
ref={ref}
|
|
118
|
-
className={cn(
|
|
119
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-fg data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
120
|
-
className,
|
|
121
|
-
)}
|
|
122
|
-
{...props}
|
|
123
|
-
>
|
|
124
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
125
|
-
<SelectPrimitive.ItemIndicator>
|
|
126
|
-
<Check className="h-4 w-4" />
|
|
127
|
-
</SelectPrimitive.ItemIndicator>
|
|
128
|
-
</span>
|
|
129
|
-
|
|
130
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
131
|
-
</SelectPrimitive.Item>
|
|
132
|
-
));
|
|
133
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
134
|
-
|
|
135
|
-
const SelectSeparator = React.forwardRef<
|
|
136
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
137
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
138
|
-
>(({ className, ...props }, ref) => (
|
|
139
|
-
<SelectPrimitive.Separator
|
|
140
|
-
ref={ref}
|
|
141
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
142
|
-
{...props}
|
|
143
|
-
/>
|
|
144
|
-
));
|
|
145
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
146
|
-
|
|
147
|
-
export {
|
|
148
|
-
Select,
|
|
149
|
-
SelectContent,
|
|
150
|
-
SelectGroup,
|
|
151
|
-
SelectItem,
|
|
152
|
-
SelectLabel,
|
|
153
|
-
SelectScrollDownButton,
|
|
154
|
-
SelectScrollUpButton,
|
|
155
|
-
SelectSeparator,
|
|
156
|
-
SelectTrigger,
|
|
157
|
-
SelectValue,
|
|
158
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Separator = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
9
|
-
>(
|
|
10
|
-
(
|
|
11
|
-
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
12
|
-
ref,
|
|
13
|
-
) => (
|
|
14
|
-
<SeparatorPrimitive.Root
|
|
15
|
-
ref={ref}
|
|
16
|
-
decorative={decorative}
|
|
17
|
-
orientation={orientation}
|
|
18
|
-
className={cn(
|
|
19
|
-
"shrink-0 bg-border",
|
|
20
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
),
|
|
26
|
-
);
|
|
27
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
28
|
-
|
|
29
|
-
export { Separator };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const Skeleton = React.forwardRef<
|
|
6
|
-
HTMLDivElement,
|
|
7
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<div
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn("animate-pulse rounded-md bg-secondary", className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
));
|
|
15
|
-
Skeleton.displayName = "Skeleton";
|
|
16
|
-
|
|
17
|
-
/* ── Skeleton Variants ───────────────────────────────────────────────── */
|
|
18
|
-
|
|
19
|
-
function SkeletonLine({
|
|
20
|
-
width = "100%",
|
|
21
|
-
className = "",
|
|
22
|
-
}: {
|
|
23
|
-
width?: string;
|
|
24
|
-
className?: string;
|
|
25
|
-
}) {
|
|
26
|
-
return (
|
|
27
|
-
<div
|
|
28
|
-
className={cn("h-4 animate-pulse rounded bg-bg-accent", className)}
|
|
29
|
-
style={{ width }}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function SkeletonText({ lines = 3 }: { lines?: number }) {
|
|
35
|
-
return (
|
|
36
|
-
<div className="space-y-2">
|
|
37
|
-
{Array.from({ length: lines }, (_, i) => i).map((lineIndex) => (
|
|
38
|
-
<SkeletonLine
|
|
39
|
-
key={lineIndex}
|
|
40
|
-
width={lineIndex === lines - 1 ? "60%" : "100%"}
|
|
41
|
-
/>
|
|
42
|
-
))}
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function SkeletonMessage({ isUser = false }: { isUser?: boolean }) {
|
|
48
|
-
return (
|
|
49
|
-
<div
|
|
50
|
-
className={cn(
|
|
51
|
-
"flex items-start gap-3 mt-4",
|
|
52
|
-
isUser ? "justify-end" : "justify-start",
|
|
53
|
-
)}
|
|
54
|
-
>
|
|
55
|
-
{!isUser && (
|
|
56
|
-
<div className="h-8 w-8 shrink-0 animate-pulse rounded-full bg-bg-accent" />
|
|
57
|
-
)}
|
|
58
|
-
<div className={cn("max-w-[80%] space-y-2", isUser && "items-end")}>
|
|
59
|
-
<div className="h-3 w-20 animate-pulse rounded bg-bg-accent" />
|
|
60
|
-
<div className="min-w-[200px] animate-pulse rounded-2xl bg-bg-accent px-4 py-3">
|
|
61
|
-
<SkeletonText lines={2} />
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function SkeletonCard() {
|
|
69
|
-
return (
|
|
70
|
-
<div className="space-y-4 rounded-lg border border-border bg-card p-4">
|
|
71
|
-
<div className="flex items-center gap-3">
|
|
72
|
-
<div className="h-10 w-10 animate-pulse rounded-lg bg-bg-accent" />
|
|
73
|
-
<div className="flex-1 space-y-2">
|
|
74
|
-
<SkeletonLine width="40%" />
|
|
75
|
-
<SkeletonLine width="60%" />
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
<SkeletonText lines={3} />
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function SkeletonSidebar() {
|
|
84
|
-
return (
|
|
85
|
-
<div className="w-64 space-y-2 p-4">
|
|
86
|
-
<div className="mb-6 h-8 w-32 animate-pulse rounded bg-bg-accent" />
|
|
87
|
-
{Array.from({ length: 6 }, (_, idx) => idx).map((i) => (
|
|
88
|
-
<div key={i} className="flex items-center gap-3 p-2">
|
|
89
|
-
<div className="h-5 w-5 animate-pulse rounded bg-bg-accent" />
|
|
90
|
-
<div className="h-4 flex-1 animate-pulse rounded bg-bg-accent" />
|
|
91
|
-
</div>
|
|
92
|
-
))}
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function SkeletonChat() {
|
|
98
|
-
return (
|
|
99
|
-
<div className="space-y-2 p-4">
|
|
100
|
-
<SkeletonMessage />
|
|
101
|
-
<SkeletonMessage isUser />
|
|
102
|
-
<SkeletonMessage />
|
|
103
|
-
</div>
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
Skeleton,
|
|
109
|
-
SkeletonCard,
|
|
110
|
-
SkeletonChat,
|
|
111
|
-
SkeletonLine,
|
|
112
|
-
SkeletonMessage,
|
|
113
|
-
SkeletonSidebar,
|
|
114
|
-
SkeletonText,
|
|
115
|
-
};
|