@alquimia-ai/ui 1.2.0 → 1.2.1
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/components/hooks/index.js +1 -1
- package/dist/components/hooks/index.js.map +1 -1
- package/dist/components/hooks/index.mjs +1 -1
- package/dist/components/hooks/index.mjs.map +1 -1
- package/dist/components/molecules/index.d.mts +15 -2
- package/dist/components/molecules/index.d.ts +15 -2
- package/dist/components/molecules/index.js +837 -725
- package/dist/components/molecules/index.js.map +1 -1
- package/dist/components/molecules/index.mjs +819 -707
- package/dist/components/molecules/index.mjs.map +1 -1
- package/dist/components/organisms/index.js +260 -149
- package/dist/components/organisms/index.js.map +1 -1
- package/dist/components/organisms/index.mjs +258 -147
- package/dist/components/organisms/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +265 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +263 -151
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -32
- package/src/components/atoms/index.ts +32 -0
- package/src/components/atoms/ui/alert.tsx +59 -0
- package/src/components/atoms/ui/aspect-ratio.tsx +7 -0
- package/src/components/atoms/ui/avatar.tsx +50 -0
- package/src/components/atoms/ui/badge.tsx +36 -0
- package/src/components/atoms/ui/breadcrumb.tsx +120 -0
- package/src/components/atoms/ui/button.tsx +56 -0
- package/src/components/atoms/ui/card.tsx +87 -0
- package/src/components/atoms/ui/checkbox.tsx +31 -0
- package/src/components/atoms/ui/command.tsx +155 -0
- package/src/components/atoms/ui/dialog.tsx +125 -0
- package/src/components/atoms/ui/drawer.tsx +119 -0
- package/src/components/atoms/ui/input.tsx +26 -0
- package/src/components/atoms/ui/label.tsx +26 -0
- package/src/components/atoms/ui/loader.tsx +52 -0
- package/src/components/atoms/ui/popover.tsx +31 -0
- package/src/components/atoms/ui/rich-text.tsx +19 -0
- package/src/components/atoms/ui/scroll-area.tsx +48 -0
- package/src/components/atoms/ui/select.tsx +160 -0
- package/src/components/atoms/ui/skeleton.tsx +15 -0
- package/src/components/atoms/ui/slider.tsx +29 -0
- package/src/components/atoms/ui/switch.tsx +30 -0
- package/src/components/atoms/ui/table.tsx +118 -0
- package/src/components/atoms/ui/tabs.tsx +56 -0
- package/src/components/atoms/ui/text-area/index.tsx +24 -0
- package/src/components/atoms/ui/textarea.tsx +25 -0
- package/src/components/atoms/ui/think-indicator.tsx +103 -0
- package/src/components/atoms/ui/toast.tsx +129 -0
- package/src/components/atoms/ui/toaster.tsx +38 -0
- package/src/components/atoms/ui/toggle.tsx +45 -0
- package/src/components/atoms/ui/typography/index.tsx +30 -0
- package/src/components/hooks/index.ts +4 -0
- package/src/components/hooks/use-document.tsx +44 -0
- package/src/components/hooks/use-resize-observer.ts +28 -0
- package/src/components/hooks/use-text-streaming.ts +63 -0
- package/src/components/hooks/use-toast.ts +194 -0
- package/src/components/index.ts +1 -0
- package/src/components/molecules/alert-dialog.tsx +141 -0
- package/src/components/molecules/assistant-button.tsx +148 -0
- package/src/components/molecules/call-out.tsx +163 -0
- package/src/components/molecules/carousel.tsx +262 -0
- package/src/components/molecules/documents/document-selector.tsx +79 -0
- package/src/components/molecules/documents/document-viewer.tsx +85 -0
- package/src/components/molecules/documents/index.ts +2 -0
- package/src/components/molecules/index.ts +11 -0
- package/src/components/molecules/navigation-menu.tsx +128 -0
- package/src/components/molecules/page-container.tsx +17 -0
- package/src/components/molecules/rating-comment.tsx +93 -0
- package/src/components/molecules/rating-stars.tsx +136 -0
- package/src/components/molecules/rating-thumbs.tsx +90 -0
- package/src/components/molecules/sidebar.tsx +107 -0
- package/src/components/molecules/sonner.tsx +30 -0
- package/src/components/molecules/viewers/index.ts +2 -0
- package/src/components/molecules/viewers/pdf-viewer.tsx +138 -0
- package/src/components/molecules/viewers/plain-text-viewer.tsx +40 -0
- package/src/components/organisms/assistant.tsx +271 -0
- package/src/components/organisms/index.ts +6 -0
- package/src/components/organisms/rating-dialog.tsx +104 -0
- package/src/components/organisms/speechToText.tsx +92 -0
- package/src/components/organisms/whisper.tsx +106 -0
- package/src/components/templates/cards/index.ts +2 -0
- package/src/components/templates/cards/with-image-heading-description-avatar.tsx +94 -0
- package/src/components/templates/cards/with-image-heading-description.tsx +63 -0
- package/src/components/templates/hero/index.tsx +39 -0
- package/src/components/templates/index.ts +4 -0
- package/src/components/templates/messages-window.tsx +15 -0
- package/src/components/templates/query-box.tsx +13 -0
- package/src/components/ui/input.tsx +25 -0
- package/src/components/ui/select.tsx +163 -0
- package/src/index.ts +7 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/utils.ts +34 -0
- package/src/styles/call-out.css +153 -0
- package/src/styles/drawer.css +28 -0
- package/src/styles/globals.css +69 -0
- package/src/styles/prose.css +51 -0
- package/src/styles/ratings.css +27 -0
- package/src/styles/themes/base-alquimia.css +95 -0
- package/src/styles/themes/base-nordic.css +83 -0
- package/src/styles/themes/base-primary.css +85 -0
- package/src/styles/themes/base.css +8 -0
- package/src/types/index.ts +1 -0
- package/src/types/type.ts +76 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
5
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
|
|
8
|
+
const Select = SelectPrimitive.Root;
|
|
9
|
+
|
|
10
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
11
|
+
|
|
12
|
+
const SelectValue = SelectPrimitive.Value;
|
|
13
|
+
|
|
14
|
+
const SelectTrigger = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
17
|
+
>(({ className, children, ...props }, ref) => (
|
|
18
|
+
<SelectPrimitive.Trigger
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
22
|
+
className,
|
|
23
|
+
"alq--select"
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
<SelectPrimitive.Icon asChild>
|
|
29
|
+
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
30
|
+
</SelectPrimitive.Icon>
|
|
31
|
+
</SelectPrimitive.Trigger>
|
|
32
|
+
));
|
|
33
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
34
|
+
|
|
35
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
38
|
+
>(({ className, ...props }, ref) => (
|
|
39
|
+
<SelectPrimitive.ScrollUpButton
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn(
|
|
42
|
+
"flex cursor-default items-center justify-center py-1",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<ChevronUp className="h-4 w-4" />
|
|
48
|
+
</SelectPrimitive.ScrollUpButton>
|
|
49
|
+
));
|
|
50
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
51
|
+
|
|
52
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
53
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
54
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
55
|
+
>(({ className, ...props }, ref) => (
|
|
56
|
+
<SelectPrimitive.ScrollDownButton
|
|
57
|
+
ref={ref}
|
|
58
|
+
className={cn(
|
|
59
|
+
"flex cursor-default items-center justify-center py-1",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
<ChevronDown className="h-4 w-4" />
|
|
65
|
+
</SelectPrimitive.ScrollDownButton>
|
|
66
|
+
));
|
|
67
|
+
SelectScrollDownButton.displayName =
|
|
68
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
69
|
+
|
|
70
|
+
const SelectContent = React.forwardRef<
|
|
71
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
72
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
73
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
74
|
+
<SelectPrimitive.Portal>
|
|
75
|
+
<SelectPrimitive.Content
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn(
|
|
78
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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",
|
|
79
|
+
position === "popper" &&
|
|
80
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
81
|
+
className
|
|
82
|
+
)}
|
|
83
|
+
position={position}
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<SelectScrollUpButton />
|
|
87
|
+
<SelectPrimitive.Viewport
|
|
88
|
+
className={cn(
|
|
89
|
+
"p-1",
|
|
90
|
+
position === "popper" &&
|
|
91
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</SelectPrimitive.Viewport>
|
|
96
|
+
<SelectScrollDownButton />
|
|
97
|
+
</SelectPrimitive.Content>
|
|
98
|
+
</SelectPrimitive.Portal>
|
|
99
|
+
));
|
|
100
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
101
|
+
|
|
102
|
+
const SelectLabel = React.forwardRef<
|
|
103
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
104
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
105
|
+
>(({ className, ...props }, ref) => (
|
|
106
|
+
<SelectPrimitive.Label
|
|
107
|
+
ref={ref}
|
|
108
|
+
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
));
|
|
112
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
113
|
+
|
|
114
|
+
const SelectItem = React.forwardRef<
|
|
115
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
116
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
117
|
+
>(({ className, children, ...props }, ref) => (
|
|
118
|
+
<SelectPrimitive.Item
|
|
119
|
+
ref={ref}
|
|
120
|
+
className={cn(
|
|
121
|
+
"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-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
122
|
+
className
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
>
|
|
126
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
127
|
+
<SelectPrimitive.ItemIndicator>
|
|
128
|
+
<Check className="h-4 w-4" />
|
|
129
|
+
</SelectPrimitive.ItemIndicator>
|
|
130
|
+
</span>
|
|
131
|
+
|
|
132
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
133
|
+
</SelectPrimitive.Item>
|
|
134
|
+
));
|
|
135
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
136
|
+
|
|
137
|
+
const SelectSeparator = React.forwardRef<
|
|
138
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
139
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
140
|
+
>(({ className, ...props }, ref) => (
|
|
141
|
+
<SelectPrimitive.Separator
|
|
142
|
+
ref={ref}
|
|
143
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
144
|
+
{...props}
|
|
145
|
+
/>
|
|
146
|
+
));
|
|
147
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
Select,
|
|
151
|
+
SelectGroup,
|
|
152
|
+
SelectValue,
|
|
153
|
+
SelectTrigger,
|
|
154
|
+
SelectContent,
|
|
155
|
+
SelectLabel,
|
|
156
|
+
SelectItem,
|
|
157
|
+
SelectSeparator,
|
|
158
|
+
SelectScrollUpButton,
|
|
159
|
+
SelectScrollDownButton,
|
|
160
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../lib/utils";
|
|
2
|
+
|
|
3
|
+
function Skeleton({
|
|
4
|
+
className,
|
|
5
|
+
...props
|
|
6
|
+
}: React.HTMLAttributes<HTMLDivElement>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className={cn("animate-pulse rounded-md bg-muted text-muted-foreground", className, "alq--skeleton")}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Skeleton };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
|
|
8
|
+
const Slider = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof SliderPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<SliderPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
"relative flex w-44 touch-none select-none items-center",
|
|
16
|
+
className,
|
|
17
|
+
"alq--slider"
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<SliderPrimitive.Track className="relative h-2 w-44 grow overflow-hidden rounded-full bg-primary">
|
|
22
|
+
<SliderPrimitive.Range className="absolute h-full bg-secondary" />
|
|
23
|
+
</SliderPrimitive.Track>
|
|
24
|
+
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
|
|
25
|
+
</SliderPrimitive.Root>
|
|
26
|
+
));
|
|
27
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
export { Slider };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
|
|
8
|
+
const Switch = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<SwitchPrimitives.Root
|
|
13
|
+
className={cn(
|
|
14
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
15
|
+
className,
|
|
16
|
+
"alq--switch"
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
ref={ref}
|
|
20
|
+
>
|
|
21
|
+
<SwitchPrimitives.Thumb
|
|
22
|
+
className={cn(
|
|
23
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
24
|
+
)}
|
|
25
|
+
/>
|
|
26
|
+
</SwitchPrimitives.Root>
|
|
27
|
+
));
|
|
28
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
29
|
+
|
|
30
|
+
export { Switch };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
const Table = React.forwardRef<
|
|
6
|
+
HTMLTableElement,
|
|
7
|
+
React.HTMLAttributes<HTMLTableElement>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<div className="relative w-full overflow-auto">
|
|
10
|
+
<table
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn("w-full caption-bottom text-sm text-foreground bg-background", className, "alq--table")}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
));
|
|
17
|
+
Table.displayName = "Table";
|
|
18
|
+
|
|
19
|
+
const TableHeader = React.forwardRef<
|
|
20
|
+
HTMLTableSectionElement,
|
|
21
|
+
React.HTMLAttributes<HTMLTableSectionElement>
|
|
22
|
+
>(({ className, ...props }, ref) => (
|
|
23
|
+
<thead ref={ref} className={cn("[&_tr]:border-b border-border bg-muted", className, "alq--table-header")} {...props} />
|
|
24
|
+
));
|
|
25
|
+
TableHeader.displayName = "TableHeader";
|
|
26
|
+
|
|
27
|
+
const TableBody = React.forwardRef<
|
|
28
|
+
HTMLTableSectionElement,
|
|
29
|
+
React.HTMLAttributes<HTMLTableSectionElement>
|
|
30
|
+
>(({ className, ...props }, ref) => (
|
|
31
|
+
<tbody
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={cn("[&_tr:last-child]:border-0 [&_tr]:border-b border-border", className, "alq--table-body")}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
));
|
|
37
|
+
TableBody.displayName = "TableBody";
|
|
38
|
+
|
|
39
|
+
const TableFooter = React.forwardRef<
|
|
40
|
+
HTMLTableSectionElement,
|
|
41
|
+
React.HTMLAttributes<HTMLTableSectionElement>
|
|
42
|
+
>(({ className, ...props }, ref) => (
|
|
43
|
+
<tfoot
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
47
|
+
className,
|
|
48
|
+
"alq--table-footer"
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
));
|
|
53
|
+
TableFooter.displayName = "TableFooter";
|
|
54
|
+
|
|
55
|
+
const TableRow = React.forwardRef<
|
|
56
|
+
HTMLTableRowElement,
|
|
57
|
+
React.HTMLAttributes<HTMLTableRowElement>
|
|
58
|
+
>(({ className, ...props }, ref) => (
|
|
59
|
+
<tr
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn(
|
|
62
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
));
|
|
68
|
+
TableRow.displayName = "TableRow";
|
|
69
|
+
|
|
70
|
+
const TableHead = React.forwardRef<
|
|
71
|
+
HTMLTableCellElement,
|
|
72
|
+
React.ThHTMLAttributes<HTMLTableCellElement>
|
|
73
|
+
>(({ className, ...props }, ref) => (
|
|
74
|
+
<th
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={cn(
|
|
77
|
+
"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
78
|
+
className
|
|
79
|
+
)}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
));
|
|
83
|
+
TableHead.displayName = "TableHead";
|
|
84
|
+
|
|
85
|
+
const TableCell = React.forwardRef<
|
|
86
|
+
HTMLTableCellElement,
|
|
87
|
+
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
88
|
+
>(({ className, ...props }, ref) => (
|
|
89
|
+
<td
|
|
90
|
+
ref={ref}
|
|
91
|
+
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
));
|
|
95
|
+
TableCell.displayName = "TableCell";
|
|
96
|
+
|
|
97
|
+
const TableCaption = React.forwardRef<
|
|
98
|
+
HTMLTableCaptionElement,
|
|
99
|
+
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
100
|
+
>(({ className, ...props }, ref) => (
|
|
101
|
+
<caption
|
|
102
|
+
ref={ref}
|
|
103
|
+
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
));
|
|
107
|
+
TableCaption.displayName = "TableCaption";
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
Table,
|
|
111
|
+
TableHeader,
|
|
112
|
+
TableBody,
|
|
113
|
+
TableFooter,
|
|
114
|
+
TableHead,
|
|
115
|
+
TableRow,
|
|
116
|
+
TableCell,
|
|
117
|
+
TableCaption,
|
|
118
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
|
|
8
|
+
const Tabs = TabsPrimitive.Root;
|
|
9
|
+
|
|
10
|
+
const TabsList = React.forwardRef<
|
|
11
|
+
React.ElementRef<typeof TabsPrimitive.List>,
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
13
|
+
>(({ className, ...props }, ref) => (
|
|
14
|
+
<TabsPrimitive.List
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground",
|
|
18
|
+
className,
|
|
19
|
+
"alq--tabs"
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
));
|
|
24
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
25
|
+
|
|
26
|
+
const TabsTrigger = React.forwardRef<
|
|
27
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
28
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
29
|
+
>(({ className, ...props }, ref) => (
|
|
30
|
+
<TabsPrimitive.Trigger
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn(
|
|
33
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
));
|
|
39
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
40
|
+
|
|
41
|
+
const TabsContent = React.forwardRef<
|
|
42
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
43
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
44
|
+
>(({ className, ...props }, ref) => (
|
|
45
|
+
<TabsPrimitive.Content
|
|
46
|
+
ref={ref}
|
|
47
|
+
className={cn(
|
|
48
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
));
|
|
54
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
55
|
+
|
|
56
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
export interface TextareaProps
|
|
6
|
+
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
7
|
+
|
|
8
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
9
|
+
({ className, ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<textarea
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
ref={ref}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
Textarea.displayName = "Textarea";
|
|
23
|
+
|
|
24
|
+
export { Textarea };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../lib/utils";
|
|
4
|
+
|
|
5
|
+
export interface TextareaProps
|
|
6
|
+
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
|
7
|
+
|
|
8
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
9
|
+
({ className, ...props }, ref) => {
|
|
10
|
+
return (
|
|
11
|
+
<textarea
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
className,
|
|
15
|
+
"alq--textarea"
|
|
16
|
+
)}
|
|
17
|
+
ref={ref}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
Textarea.displayName = "Textarea";
|
|
24
|
+
|
|
25
|
+
export { Textarea };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { Loader } from "..";
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
8
|
+
|
|
9
|
+
const thinkIndicatorVariants = cva(
|
|
10
|
+
"flex items-center gap-3",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
variant: {
|
|
14
|
+
default: "text-muted-foreground",
|
|
15
|
+
primary: "text-primary",
|
|
16
|
+
secondary: "text-secondary",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "gap-3",
|
|
20
|
+
sm: "gap-2",
|
|
21
|
+
lg: "gap-4",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export interface ThinkIndicatorProps
|
|
32
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
33
|
+
VariantProps<typeof thinkIndicatorVariants> {
|
|
34
|
+
thoughts?: string[];
|
|
35
|
+
interval?: number;
|
|
36
|
+
loader?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const ThinkIndicator = React.forwardRef<HTMLDivElement, ThinkIndicatorProps>(
|
|
40
|
+
({
|
|
41
|
+
className,
|
|
42
|
+
variant,
|
|
43
|
+
size,
|
|
44
|
+
thoughts = [
|
|
45
|
+
"Analyzing your request...",
|
|
46
|
+
"Processing information...",
|
|
47
|
+
"Formulating response...",
|
|
48
|
+
],
|
|
49
|
+
interval = 5000,
|
|
50
|
+
loader,
|
|
51
|
+
...props
|
|
52
|
+
}, ref) => {
|
|
53
|
+
const [currentThoughtIndex, setCurrentThoughtIndex] = useState<number>(0);
|
|
54
|
+
const [isAnimating, setIsAnimating] = useState<boolean>(false);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const timer = setInterval(() => {
|
|
58
|
+
setIsAnimating(true);
|
|
59
|
+
setTimeout(() => {
|
|
60
|
+
setCurrentThoughtIndex((prev) => {
|
|
61
|
+
return prev < thoughts.length - 1 ? prev + 1 : prev;
|
|
62
|
+
});
|
|
63
|
+
setIsAnimating(false);
|
|
64
|
+
}, 300);
|
|
65
|
+
}, interval);
|
|
66
|
+
|
|
67
|
+
if (currentThoughtIndex === thoughts.length - 1) {
|
|
68
|
+
clearInterval(timer);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return () => clearInterval(timer);
|
|
72
|
+
}, [thoughts, interval, currentThoughtIndex]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
ref={ref}
|
|
77
|
+
className={cn(thinkIndicatorVariants({ variant, size }), className, "alq--think-indicator")}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
80
|
+
{loader || (
|
|
81
|
+
<Loader
|
|
82
|
+
className={cn(
|
|
83
|
+
size === "sm" ? "h-3 w-3" : size === "lg" ? "h-5 w-5" : "h-4 w-4"
|
|
84
|
+
)}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
<div
|
|
88
|
+
className={cn(
|
|
89
|
+
"alq--think-indicator-text",
|
|
90
|
+
"transition-all duration-300",
|
|
91
|
+
isAnimating ? "opacity-0 -translate-y-2" : "opacity-100 translate-y-0"
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
{thoughts[currentThoughtIndex]}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
ThinkIndicator.displayName = "ThinkIndicator";
|
|
102
|
+
|
|
103
|
+
export { thinkIndicatorVariants };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
+
import { X } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
import { cn } from "../../../lib/utils";
|
|
9
|
+
|
|
10
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
11
|
+
|
|
12
|
+
const ToastViewport = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
15
|
+
>(({ className, ...props }, ref) => (
|
|
16
|
+
<ToastPrimitives.Viewport
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={cn(
|
|
19
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
));
|
|
25
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
26
|
+
|
|
27
|
+
const toastVariants = cva(
|
|
28
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
default: "border bg-background text-foreground",
|
|
33
|
+
destructive:
|
|
34
|
+
"destructive group border-destructive bg-destructive text-destructive-foreground",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
variant: "default",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const Toast = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
46
|
+
VariantProps<typeof toastVariants>
|
|
47
|
+
>(({ className, variant, ...props }, ref) => {
|
|
48
|
+
return (
|
|
49
|
+
<ToastPrimitives.Root
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={cn(toastVariants({ variant }), className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
57
|
+
|
|
58
|
+
const ToastAction = React.forwardRef<
|
|
59
|
+
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
60
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
61
|
+
>(({ className, ...props }, ref) => (
|
|
62
|
+
<ToastPrimitives.Action
|
|
63
|
+
ref={ref}
|
|
64
|
+
className={cn(
|
|
65
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
));
|
|
71
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
72
|
+
|
|
73
|
+
const ToastClose = React.forwardRef<
|
|
74
|
+
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
75
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
76
|
+
>(({ className, ...props }, ref) => (
|
|
77
|
+
<ToastPrimitives.Close
|
|
78
|
+
ref={ref}
|
|
79
|
+
className={cn(
|
|
80
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
81
|
+
className
|
|
82
|
+
)}
|
|
83
|
+
toast-close=""
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<X className="h-4 w-4" />
|
|
87
|
+
</ToastPrimitives.Close>
|
|
88
|
+
));
|
|
89
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
90
|
+
|
|
91
|
+
const ToastTitle = React.forwardRef<
|
|
92
|
+
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
93
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
94
|
+
>(({ className, ...props }, ref) => (
|
|
95
|
+
<ToastPrimitives.Title
|
|
96
|
+
ref={ref}
|
|
97
|
+
className={cn("text-sm font-semibold", className)}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
));
|
|
101
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
102
|
+
|
|
103
|
+
const ToastDescription = React.forwardRef<
|
|
104
|
+
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
105
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
106
|
+
>(({ className, ...props }, ref) => (
|
|
107
|
+
<ToastPrimitives.Description
|
|
108
|
+
ref={ref}
|
|
109
|
+
className={cn("text-sm opacity-90", className)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
));
|
|
113
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
114
|
+
|
|
115
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
116
|
+
|
|
117
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
type ToastProps,
|
|
121
|
+
type ToastActionElement,
|
|
122
|
+
ToastProvider,
|
|
123
|
+
ToastViewport,
|
|
124
|
+
Toast,
|
|
125
|
+
ToastTitle,
|
|
126
|
+
ToastDescription,
|
|
127
|
+
ToastClose,
|
|
128
|
+
ToastAction,
|
|
129
|
+
};
|