langwatch 0.1.7 → 0.3.0-prerelease.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/.editorconfig +16 -0
- package/LICENSE +7 -0
- package/README.md +268 -1
- package/copy-types.sh +19 -8
- package/examples/langchain/.env.example +2 -0
- package/examples/langchain/README.md +42 -0
- package/examples/langchain/package-lock.json +2930 -0
- package/examples/langchain/package.json +27 -0
- package/examples/langchain/src/cli-markdown.d.ts +137 -0
- package/examples/langchain/src/index.ts +109 -0
- package/examples/langchain/tsconfig.json +25 -0
- package/examples/langgraph/.env.example +2 -0
- package/examples/langgraph/README.md +42 -0
- package/examples/langgraph/package-lock.json +3031 -0
- package/examples/langgraph/package.json +28 -0
- package/examples/langgraph/src/cli-markdown.d.ts +137 -0
- package/examples/langgraph/src/index.ts +196 -0
- package/examples/langgraph/tsconfig.json +25 -0
- package/examples/mastra/.env.example +2 -0
- package/examples/mastra/README.md +57 -0
- package/examples/mastra/package-lock.json +5296 -0
- package/examples/mastra/package.json +32 -0
- package/examples/mastra/src/cli-markdown.d.ts +137 -0
- package/examples/mastra/src/index.ts +120 -0
- package/examples/mastra/src/mastra/agents/weather-agent.ts +30 -0
- package/examples/mastra/src/mastra/index.ts +21 -0
- package/examples/mastra/src/mastra/tools/weather-tool.ts +102 -0
- package/examples/mastra/tsconfig.json +25 -0
- package/examples/vercel-ai/.env.example +2 -0
- package/examples/vercel-ai/README.md +38 -0
- package/examples/vercel-ai/package-lock.json +2571 -0
- package/examples/vercel-ai/package.json +27 -0
- package/examples/vercel-ai/src/cli-markdown.d.ts +137 -0
- package/examples/vercel-ai/src/index.ts +110 -0
- package/examples/vercel-ai/src/instrumentation.ts +9 -0
- package/examples/vercel-ai/tsconfig.json +25 -0
- package/package.json +80 -33
- package/src/__tests__/client-browser.test.ts +92 -0
- package/src/__tests__/client-node.test.ts +76 -0
- package/src/__tests__/client.test.ts +71 -0
- package/src/__tests__/integration/client-browser.test.ts +46 -0
- package/src/__tests__/integration/client-node.test.ts +46 -0
- package/src/client-browser.ts +70 -0
- package/src/client-node.ts +82 -0
- package/src/client-shared.ts +72 -0
- package/src/client.ts +119 -0
- package/src/evaluation/__tests__/record-evaluation.test.ts +112 -0
- package/src/evaluation/__tests__/run-evaluation.test.ts +171 -0
- package/src/evaluation/index.ts +2 -0
- package/src/evaluation/record-evaluation.ts +101 -0
- package/src/evaluation/run-evaluation.ts +133 -0
- package/src/evaluation/tracer.ts +3 -0
- package/src/evaluation/types.ts +23 -0
- package/src/index.ts +10 -591
- package/src/internal/api/__tests__/errors.test.ts +98 -0
- package/src/internal/api/client.ts +30 -0
- package/src/internal/api/errors.ts +32 -0
- package/src/internal/generated/types/.gitkeep +0 -0
- package/src/observability/__tests__/integration/base.test.ts +74 -0
- package/src/observability/__tests__/integration/browser-setup-ordering.test.ts +60 -0
- package/src/observability/__tests__/integration/complex-nested-spans.test.ts +29 -0
- package/src/observability/__tests__/integration/error-handling.test.ts +24 -0
- package/src/observability/__tests__/integration/langwatch-disabled-otel.test.ts +24 -0
- package/src/observability/__tests__/integration/langwatch-first-then-vercel.test.ts +24 -0
- package/src/observability/__tests__/integration/multiple-setup-attempts.test.ts +27 -0
- package/src/observability/__tests__/integration/otel-ordering.test.ts +27 -0
- package/src/observability/__tests__/integration/vercel-configurations.test.ts +20 -0
- package/src/observability/__tests__/integration/vercel-first-then-langwatch.test.ts +27 -0
- package/src/observability/__tests__/span.test.ts +214 -0
- package/src/observability/__tests__/trace.test.ts +180 -0
- package/src/observability/exporters/index.ts +1 -0
- package/src/observability/exporters/langwatch-exporter.ts +53 -0
- package/src/observability/index.ts +4 -0
- package/src/observability/instrumentation/langchain/__tests__/integration/langchain-chatbot.test.ts +112 -0
- package/src/observability/instrumentation/langchain/__tests__/langchain.test.ts +284 -0
- package/src/observability/instrumentation/langchain/index.ts +624 -0
- package/src/observability/processors/__tests__/filterable-batch-span-exporter.test.ts +98 -0
- package/src/observability/processors/filterable-batch-span-processor.ts +99 -0
- package/src/observability/processors/index.ts +1 -0
- package/src/observability/semconv/attributes.ts +185 -0
- package/src/observability/semconv/events.ts +42 -0
- package/src/observability/semconv/index.ts +16 -0
- package/src/observability/semconv/values.ts +159 -0
- package/src/observability/span.ts +728 -0
- package/src/observability/trace.ts +301 -0
- package/src/prompt/__tests__/prompt.test.ts +139 -0
- package/src/prompt/get-prompt-version.ts +49 -0
- package/src/prompt/get-prompt.ts +44 -0
- package/src/prompt/index.ts +3 -0
- package/src/prompt/prompt.ts +133 -0
- package/src/prompt/service.ts +221 -0
- package/src/prompt/tracer.ts +3 -0
- package/src/prompt/types.ts +0 -0
- package/ts-to-zod.config.js +11 -0
- package/tsconfig.json +3 -9
- package/tsup.config.ts +11 -1
- package/vitest.config.ts +1 -0
- package/dist/chunk-FWBCQQYZ.mjs +0 -711
- package/dist/chunk-FWBCQQYZ.mjs.map +0 -1
- package/dist/index.d.mts +0 -1010
- package/dist/index.d.ts +0 -1010
- package/dist/index.js +0 -27294
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -959
- package/dist/index.mjs.map +0 -1
- package/dist/utils-B0pgWcps.d.mts +0 -303
- package/dist/utils-B0pgWcps.d.ts +0 -303
- package/dist/utils.d.mts +0 -2
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -703
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs +0 -11
- package/dist/utils.mjs.map +0 -1
- package/example/.env.example +0 -12
- package/example/.eslintrc.json +0 -26
- package/example/LICENSE +0 -13
- package/example/README.md +0 -12
- package/example/app/(chat)/chat/[id]/page.tsx +0 -60
- package/example/app/(chat)/layout.tsx +0 -14
- package/example/app/(chat)/page.tsx +0 -27
- package/example/app/actions.ts +0 -156
- package/example/app/globals.css +0 -76
- package/example/app/guardrails/page.tsx +0 -26
- package/example/app/langchain/page.tsx +0 -27
- package/example/app/langchain-rag/page.tsx +0 -28
- package/example/app/late-update/page.tsx +0 -27
- package/example/app/layout.tsx +0 -64
- package/example/app/login/actions.ts +0 -71
- package/example/app/login/page.tsx +0 -18
- package/example/app/manual/page.tsx +0 -27
- package/example/app/new/page.tsx +0 -5
- package/example/app/opengraph-image.png +0 -0
- package/example/app/share/[id]/page.tsx +0 -58
- package/example/app/signup/actions.ts +0 -111
- package/example/app/signup/page.tsx +0 -18
- package/example/app/twitter-image.png +0 -0
- package/example/auth.config.ts +0 -42
- package/example/auth.ts +0 -45
- package/example/components/button-scroll-to-bottom.tsx +0 -36
- package/example/components/chat-history.tsx +0 -49
- package/example/components/chat-list.tsx +0 -52
- package/example/components/chat-message-actions.tsx +0 -40
- package/example/components/chat-message.tsx +0 -80
- package/example/components/chat-panel.tsx +0 -139
- package/example/components/chat-share-dialog.tsx +0 -95
- package/example/components/chat.tsx +0 -84
- package/example/components/clear-history.tsx +0 -75
- package/example/components/empty-screen.tsx +0 -38
- package/example/components/external-link.tsx +0 -29
- package/example/components/footer.tsx +0 -19
- package/example/components/header.tsx +0 -114
- package/example/components/login-button.tsx +0 -42
- package/example/components/login-form.tsx +0 -97
- package/example/components/markdown.tsx +0 -9
- package/example/components/prompt-form.tsx +0 -115
- package/example/components/providers.tsx +0 -17
- package/example/components/sidebar-actions.tsx +0 -125
- package/example/components/sidebar-desktop.tsx +0 -19
- package/example/components/sidebar-footer.tsx +0 -16
- package/example/components/sidebar-item.tsx +0 -124
- package/example/components/sidebar-items.tsx +0 -42
- package/example/components/sidebar-list.tsx +0 -38
- package/example/components/sidebar-mobile.tsx +0 -31
- package/example/components/sidebar-toggle.tsx +0 -24
- package/example/components/sidebar.tsx +0 -21
- package/example/components/signup-form.tsx +0 -95
- package/example/components/stocks/events-skeleton.tsx +0 -31
- package/example/components/stocks/events.tsx +0 -30
- package/example/components/stocks/index.tsx +0 -36
- package/example/components/stocks/message.tsx +0 -134
- package/example/components/stocks/spinner.tsx +0 -16
- package/example/components/stocks/stock-purchase.tsx +0 -146
- package/example/components/stocks/stock-skeleton.tsx +0 -22
- package/example/components/stocks/stock.tsx +0 -210
- package/example/components/stocks/stocks-skeleton.tsx +0 -9
- package/example/components/stocks/stocks.tsx +0 -67
- package/example/components/tailwind-indicator.tsx +0 -14
- package/example/components/theme-toggle.tsx +0 -31
- package/example/components/ui/alert-dialog.tsx +0 -141
- package/example/components/ui/badge.tsx +0 -36
- package/example/components/ui/button.tsx +0 -57
- package/example/components/ui/codeblock.tsx +0 -148
- package/example/components/ui/dialog.tsx +0 -122
- package/example/components/ui/dropdown-menu.tsx +0 -205
- package/example/components/ui/icons.tsx +0 -507
- package/example/components/ui/input.tsx +0 -25
- package/example/components/ui/label.tsx +0 -26
- package/example/components/ui/select.tsx +0 -164
- package/example/components/ui/separator.tsx +0 -31
- package/example/components/ui/sheet.tsx +0 -140
- package/example/components/ui/sonner.tsx +0 -31
- package/example/components/ui/switch.tsx +0 -29
- package/example/components/ui/textarea.tsx +0 -24
- package/example/components/ui/tooltip.tsx +0 -30
- package/example/components/user-menu.tsx +0 -53
- package/example/components.json +0 -17
- package/example/instrumentation.ts +0 -11
- package/example/lib/chat/guardrails.tsx +0 -181
- package/example/lib/chat/langchain-rag.tsx +0 -191
- package/example/lib/chat/langchain.tsx +0 -112
- package/example/lib/chat/late-update.tsx +0 -208
- package/example/lib/chat/manual.tsx +0 -605
- package/example/lib/chat/vercel-ai.tsx +0 -576
- package/example/lib/hooks/use-copy-to-clipboard.tsx +0 -33
- package/example/lib/hooks/use-enter-submit.tsx +0 -23
- package/example/lib/hooks/use-local-storage.ts +0 -24
- package/example/lib/hooks/use-scroll-anchor.tsx +0 -86
- package/example/lib/hooks/use-sidebar.tsx +0 -60
- package/example/lib/hooks/use-streamable-text.ts +0 -25
- package/example/lib/types.ts +0 -41
- package/example/lib/utils.ts +0 -89
- package/example/middleware.ts +0 -8
- package/example/next-env.d.ts +0 -5
- package/example/next.config.js +0 -16
- package/example/package-lock.json +0 -9990
- package/example/package.json +0 -84
- package/example/pnpm-lock.yaml +0 -5712
- package/example/postcss.config.js +0 -6
- package/example/prettier.config.cjs +0 -34
- package/example/public/apple-touch-icon.png +0 -0
- package/example/public/favicon-16x16.png +0 -0
- package/example/public/favicon.ico +0 -0
- package/example/public/next.svg +0 -1
- package/example/public/thirteen.svg +0 -1
- package/example/public/vercel.svg +0 -1
- package/example/tailwind.config.ts +0 -81
- package/example/tsconfig.json +0 -35
- package/src/LangWatchExporter.ts +0 -91
- package/src/evaluations.ts +0 -219
- package/src/index.test.ts +0 -402
- package/src/langchain.ts +0 -557
- package/src/typeUtils.ts +0 -89
- package/src/types.ts +0 -79
- package/src/utils.ts +0 -205
- /package/src/{server/types → internal/generated/openapi}/.gitkeep +0 -0
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import {
|
|
5
|
-
CaretSortIcon,
|
|
6
|
-
CheckIcon,
|
|
7
|
-
ChevronDownIcon,
|
|
8
|
-
ChevronUpIcon,
|
|
9
|
-
} from "@radix-ui/react-icons"
|
|
10
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
11
|
-
|
|
12
|
-
import { cn } from "@/lib/utils"
|
|
13
|
-
|
|
14
|
-
const Select = SelectPrimitive.Root
|
|
15
|
-
|
|
16
|
-
const SelectGroup = SelectPrimitive.Group
|
|
17
|
-
|
|
18
|
-
const SelectValue = SelectPrimitive.Value
|
|
19
|
-
|
|
20
|
-
const SelectTrigger = React.forwardRef<
|
|
21
|
-
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
22
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
23
|
-
>(({ className, children, ...props }, ref) => (
|
|
24
|
-
<SelectPrimitive.Trigger
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn(
|
|
27
|
-
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
28
|
-
className
|
|
29
|
-
)}
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
{children}
|
|
33
|
-
<SelectPrimitive.Icon asChild>
|
|
34
|
-
<CaretSortIcon className="size-4 opacity-50" />
|
|
35
|
-
</SelectPrimitive.Icon>
|
|
36
|
-
</SelectPrimitive.Trigger>
|
|
37
|
-
))
|
|
38
|
-
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName
|
|
39
|
-
|
|
40
|
-
const SelectScrollUpButton = React.forwardRef<
|
|
41
|
-
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
42
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
43
|
-
>(({ className, ...props }, ref) => (
|
|
44
|
-
<SelectPrimitive.ScrollUpButton
|
|
45
|
-
ref={ref}
|
|
46
|
-
className={cn(
|
|
47
|
-
"flex cursor-default items-center justify-center py-1",
|
|
48
|
-
className
|
|
49
|
-
)}
|
|
50
|
-
{...props}
|
|
51
|
-
>
|
|
52
|
-
<ChevronUpIcon />
|
|
53
|
-
</SelectPrimitive.ScrollUpButton>
|
|
54
|
-
))
|
|
55
|
-
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName
|
|
56
|
-
|
|
57
|
-
const SelectScrollDownButton = React.forwardRef<
|
|
58
|
-
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
59
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
60
|
-
>(({ className, ...props }, ref) => (
|
|
61
|
-
<SelectPrimitive.ScrollDownButton
|
|
62
|
-
ref={ref}
|
|
63
|
-
className={cn(
|
|
64
|
-
"flex cursor-default items-center justify-center py-1",
|
|
65
|
-
className
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
<ChevronDownIcon />
|
|
70
|
-
</SelectPrimitive.ScrollDownButton>
|
|
71
|
-
))
|
|
72
|
-
SelectScrollDownButton.displayName =
|
|
73
|
-
SelectPrimitive.ScrollDownButton.displayName
|
|
74
|
-
|
|
75
|
-
const SelectContent = React.forwardRef<
|
|
76
|
-
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
77
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
78
|
-
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
79
|
-
<SelectPrimitive.Portal>
|
|
80
|
-
<SelectPrimitive.Content
|
|
81
|
-
ref={ref}
|
|
82
|
-
className={cn(
|
|
83
|
-
"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",
|
|
84
|
-
position === "popper" &&
|
|
85
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
86
|
-
className
|
|
87
|
-
)}
|
|
88
|
-
position={position}
|
|
89
|
-
{...props}
|
|
90
|
-
>
|
|
91
|
-
<SelectScrollUpButton />
|
|
92
|
-
<SelectPrimitive.Viewport
|
|
93
|
-
className={cn(
|
|
94
|
-
"p-1",
|
|
95
|
-
position === "popper" &&
|
|
96
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
97
|
-
)}
|
|
98
|
-
>
|
|
99
|
-
{children}
|
|
100
|
-
</SelectPrimitive.Viewport>
|
|
101
|
-
<SelectScrollDownButton />
|
|
102
|
-
</SelectPrimitive.Content>
|
|
103
|
-
</SelectPrimitive.Portal>
|
|
104
|
-
))
|
|
105
|
-
SelectContent.displayName = SelectPrimitive.Content.displayName
|
|
106
|
-
|
|
107
|
-
const SelectLabel = React.forwardRef<
|
|
108
|
-
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
109
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
110
|
-
>(({ className, ...props }, ref) => (
|
|
111
|
-
<SelectPrimitive.Label
|
|
112
|
-
ref={ref}
|
|
113
|
-
className={cn("px-2 py-1.5 text-sm font-semibold", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
))
|
|
117
|
-
SelectLabel.displayName = SelectPrimitive.Label.displayName
|
|
118
|
-
|
|
119
|
-
const SelectItem = React.forwardRef<
|
|
120
|
-
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
121
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
122
|
-
>(({ className, children, ...props }, ref) => (
|
|
123
|
-
<SelectPrimitive.Item
|
|
124
|
-
ref={ref}
|
|
125
|
-
className={cn(
|
|
126
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
127
|
-
className
|
|
128
|
-
)}
|
|
129
|
-
{...props}
|
|
130
|
-
>
|
|
131
|
-
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
132
|
-
<SelectPrimitive.ItemIndicator>
|
|
133
|
-
<CheckIcon className="size-4" />
|
|
134
|
-
</SelectPrimitive.ItemIndicator>
|
|
135
|
-
</span>
|
|
136
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
137
|
-
</SelectPrimitive.Item>
|
|
138
|
-
))
|
|
139
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName
|
|
140
|
-
|
|
141
|
-
const SelectSeparator = React.forwardRef<
|
|
142
|
-
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
143
|
-
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
144
|
-
>(({ className, ...props }, ref) => (
|
|
145
|
-
<SelectPrimitive.Separator
|
|
146
|
-
ref={ref}
|
|
147
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
148
|
-
{...props}
|
|
149
|
-
/>
|
|
150
|
-
))
|
|
151
|
-
SelectSeparator.displayName = SelectPrimitive.Separator.displayName
|
|
152
|
-
|
|
153
|
-
export {
|
|
154
|
-
Select,
|
|
155
|
-
SelectGroup,
|
|
156
|
-
SelectValue,
|
|
157
|
-
SelectTrigger,
|
|
158
|
-
SelectContent,
|
|
159
|
-
SelectLabel,
|
|
160
|
-
SelectItem,
|
|
161
|
-
SelectSeparator,
|
|
162
|
-
SelectScrollUpButton,
|
|
163
|
-
SelectScrollDownButton,
|
|
164
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
const Separator = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
11
|
-
>(
|
|
12
|
-
(
|
|
13
|
-
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
14
|
-
ref
|
|
15
|
-
) => (
|
|
16
|
-
<SeparatorPrimitive.Root
|
|
17
|
-
ref={ref}
|
|
18
|
-
decorative={decorative}
|
|
19
|
-
orientation={orientation}
|
|
20
|
-
className={cn(
|
|
21
|
-
"shrink-0 bg-border",
|
|
22
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
)
|
|
29
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
30
|
-
|
|
31
|
-
export { Separator }
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { Cross2Icon } from "@radix-ui/react-icons"
|
|
6
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
7
|
-
|
|
8
|
-
import { cn } from "@/lib/utils"
|
|
9
|
-
|
|
10
|
-
const Sheet = SheetPrimitive.Root
|
|
11
|
-
|
|
12
|
-
const SheetTrigger = SheetPrimitive.Trigger
|
|
13
|
-
|
|
14
|
-
const SheetClose = SheetPrimitive.Close
|
|
15
|
-
|
|
16
|
-
const SheetPortal = SheetPrimitive.Portal
|
|
17
|
-
|
|
18
|
-
const SheetOverlay = React.forwardRef<
|
|
19
|
-
React.ElementRef<typeof SheetPrimitive.Overlay>,
|
|
20
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
|
|
21
|
-
>(({ className, ...props }, ref) => (
|
|
22
|
-
<SheetPrimitive.Overlay
|
|
23
|
-
className={cn(
|
|
24
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
{...props}
|
|
28
|
-
ref={ref}
|
|
29
|
-
/>
|
|
30
|
-
))
|
|
31
|
-
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
|
|
32
|
-
|
|
33
|
-
const sheetVariants = cva(
|
|
34
|
-
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
35
|
-
{
|
|
36
|
-
variants: {
|
|
37
|
-
side: {
|
|
38
|
-
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
39
|
-
bottom:
|
|
40
|
-
"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
41
|
-
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
42
|
-
right:
|
|
43
|
-
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
defaultVariants: {
|
|
47
|
-
side: "right",
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
interface SheetContentProps
|
|
53
|
-
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
|
54
|
-
VariantProps<typeof sheetVariants> {}
|
|
55
|
-
|
|
56
|
-
const SheetContent = React.forwardRef<
|
|
57
|
-
React.ElementRef<typeof SheetPrimitive.Content>,
|
|
58
|
-
SheetContentProps
|
|
59
|
-
>(({ side = "right", className, children, ...props }, ref) => (
|
|
60
|
-
<SheetPortal>
|
|
61
|
-
<SheetOverlay />
|
|
62
|
-
<SheetPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
className={cn(sheetVariants({ side }), className)}
|
|
65
|
-
{...props}
|
|
66
|
-
>
|
|
67
|
-
{children}
|
|
68
|
-
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
69
|
-
<Cross2Icon className="size-4" />
|
|
70
|
-
<span className="sr-only">Close</span>
|
|
71
|
-
</SheetPrimitive.Close>
|
|
72
|
-
</SheetPrimitive.Content>
|
|
73
|
-
</SheetPortal>
|
|
74
|
-
))
|
|
75
|
-
SheetContent.displayName = SheetPrimitive.Content.displayName
|
|
76
|
-
|
|
77
|
-
const SheetHeader = ({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
81
|
-
<div
|
|
82
|
-
className={cn(
|
|
83
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
84
|
-
className
|
|
85
|
-
)}
|
|
86
|
-
{...props}
|
|
87
|
-
/>
|
|
88
|
-
)
|
|
89
|
-
SheetHeader.displayName = "SheetHeader"
|
|
90
|
-
|
|
91
|
-
const SheetFooter = ({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
95
|
-
<div
|
|
96
|
-
className={cn(
|
|
97
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
SheetFooter.displayName = "SheetFooter"
|
|
104
|
-
|
|
105
|
-
const SheetTitle = React.forwardRef<
|
|
106
|
-
React.ElementRef<typeof SheetPrimitive.Title>,
|
|
107
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
|
|
108
|
-
>(({ className, ...props }, ref) => (
|
|
109
|
-
<SheetPrimitive.Title
|
|
110
|
-
ref={ref}
|
|
111
|
-
className={cn("text-lg font-semibold text-foreground", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
))
|
|
115
|
-
SheetTitle.displayName = SheetPrimitive.Title.displayName
|
|
116
|
-
|
|
117
|
-
const SheetDescription = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof SheetPrimitive.Description>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
|
|
120
|
-
>(({ className, ...props }, ref) => (
|
|
121
|
-
<SheetPrimitive.Description
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
))
|
|
127
|
-
SheetDescription.displayName = SheetPrimitive.Description.displayName
|
|
128
|
-
|
|
129
|
-
export {
|
|
130
|
-
Sheet,
|
|
131
|
-
SheetPortal,
|
|
132
|
-
SheetOverlay,
|
|
133
|
-
SheetTrigger,
|
|
134
|
-
SheetClose,
|
|
135
|
-
SheetContent,
|
|
136
|
-
SheetHeader,
|
|
137
|
-
SheetFooter,
|
|
138
|
-
SheetTitle,
|
|
139
|
-
SheetDescription,
|
|
140
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { useTheme } from "next-themes"
|
|
4
|
-
import { Toaster as Sonner } from "sonner"
|
|
5
|
-
|
|
6
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
7
|
-
|
|
8
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
9
|
-
const { theme = "system" } = useTheme()
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<Sonner
|
|
13
|
-
theme={theme as ToasterProps["theme"]}
|
|
14
|
-
className="toaster group"
|
|
15
|
-
toastOptions={{
|
|
16
|
-
classNames: {
|
|
17
|
-
toast:
|
|
18
|
-
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
19
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
20
|
-
actionButton:
|
|
21
|
-
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
22
|
-
cancelButton:
|
|
23
|
-
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
24
|
-
},
|
|
25
|
-
}}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Toaster }
|
|
@@ -1,29 +0,0 @@
|
|
|
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-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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
|
-
)}
|
|
17
|
-
{...props}
|
|
18
|
-
ref={ref}
|
|
19
|
-
>
|
|
20
|
-
<SwitchPrimitives.Thumb
|
|
21
|
-
className={cn(
|
|
22
|
-
"pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
23
|
-
)}
|
|
24
|
-
/>
|
|
25
|
-
</SwitchPrimitives.Root>
|
|
26
|
-
))
|
|
27
|
-
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
28
|
-
|
|
29
|
-
export { Switch }
|
|
@@ -1,24 +0,0 @@
|
|
|
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 }
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
9
|
-
|
|
10
|
-
const Tooltip = TooltipPrimitive.Root
|
|
11
|
-
|
|
12
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
13
|
-
|
|
14
|
-
const TooltipContent = React.forwardRef<
|
|
15
|
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
17
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
18
|
-
<TooltipPrimitive.Content
|
|
19
|
-
ref={ref}
|
|
20
|
-
sideOffset={sideOffset}
|
|
21
|
-
className={cn(
|
|
22
|
-
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
29
|
-
|
|
30
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { type Session } from '@/lib/types'
|
|
2
|
-
|
|
3
|
-
import { Button } from '@/components/ui/button'
|
|
4
|
-
import {
|
|
5
|
-
DropdownMenu,
|
|
6
|
-
DropdownMenuContent,
|
|
7
|
-
DropdownMenuItem,
|
|
8
|
-
DropdownMenuSeparator,
|
|
9
|
-
DropdownMenuTrigger
|
|
10
|
-
} from '@/components/ui/dropdown-menu'
|
|
11
|
-
import { signOut } from '@/auth'
|
|
12
|
-
|
|
13
|
-
export interface UserMenuProps {
|
|
14
|
-
user: Session['user']
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function getUserInitials(name: string) {
|
|
18
|
-
const [firstName, lastName] = name.split(' ')
|
|
19
|
-
return lastName ? `${firstName[0]}${lastName[0]}` : firstName.slice(0, 2)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function UserMenu({ user }: UserMenuProps) {
|
|
23
|
-
return (
|
|
24
|
-
<div className="flex items-center justify-between">
|
|
25
|
-
<DropdownMenu>
|
|
26
|
-
<DropdownMenuTrigger asChild>
|
|
27
|
-
<Button variant="ghost" className="pl-0">
|
|
28
|
-
<div className="flex size-7 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground">
|
|
29
|
-
{getUserInitials(user.email)}
|
|
30
|
-
</div>
|
|
31
|
-
<span className="ml-2 hidden md:block">{user.email}</span>
|
|
32
|
-
</Button>
|
|
33
|
-
</DropdownMenuTrigger>
|
|
34
|
-
<DropdownMenuContent sideOffset={8} align="start" className="w-fit">
|
|
35
|
-
<DropdownMenuItem className="flex-col items-start">
|
|
36
|
-
<div className="text-xs text-zinc-500">{user.email}</div>
|
|
37
|
-
</DropdownMenuItem>
|
|
38
|
-
<DropdownMenuSeparator />
|
|
39
|
-
<form
|
|
40
|
-
action={async () => {
|
|
41
|
-
'use server'
|
|
42
|
-
await signOut()
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
<button className=" relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-xs outline-none transition-colors hover:bg-red-500 hover:text-white focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
|
|
46
|
-
Sign Out
|
|
47
|
-
</button>
|
|
48
|
-
</form>
|
|
49
|
-
</DropdownMenuContent>
|
|
50
|
-
</DropdownMenu>
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
53
|
-
}
|
package/example/components.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "tailwind.config.ts",
|
|
8
|
-
"css": "app/globals.css",
|
|
9
|
-
"baseColor": "zinc",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { registerOTel } from '@vercel/otel'
|
|
2
|
-
import { LangWatchExporter } from 'langwatch'
|
|
3
|
-
|
|
4
|
-
export function register() {
|
|
5
|
-
registerOTel({
|
|
6
|
-
serviceName: 'next-app',
|
|
7
|
-
traceExporter: new LangWatchExporter({
|
|
8
|
-
apiKey: process.env.LANGWATCH_API_KEY,
|
|
9
|
-
})
|
|
10
|
-
})
|
|
11
|
-
}
|