@ui-annotate/react-vite 0.1.0
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/code-open.d.ts +17 -0
- package/dist/code-open.js +82 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -0
- package/dist/inspector-transform.d.ts +59 -0
- package/dist/inspector-transform.js +218 -0
- package/dist/protocol/constants.d.ts +7 -0
- package/dist/protocol/constants.js +31 -0
- package/dist/protocol/ids.d.ts +3 -0
- package/dist/protocol/ids.js +15 -0
- package/dist/protocol/index.d.ts +4 -0
- package/dist/protocol/index.js +4 -0
- package/dist/protocol/paths.d.ts +3 -0
- package/dist/protocol/paths.js +36 -0
- package/dist/protocol/task-model.d.ts +35 -0
- package/dist/protocol/task-model.js +68 -0
- package/dist/runtime/app/AnnotateToolbar.d.ts +9 -0
- package/dist/runtime/app/AnnotateToolbar.js +14 -0
- package/dist/runtime/app/AnnotateWindows.d.ts +28 -0
- package/dist/runtime/app/AnnotateWindows.js +8 -0
- package/dist/runtime/app/UiAnnotate.d.ts +5 -0
- package/dist/runtime/app/UiAnnotate.js +540 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/inspector/target-inspection.d.ts +10 -0
- package/dist/runtime/inspector/target-inspection.js +337 -0
- package/dist/runtime/layout/annotate-storage.d.ts +9 -0
- package/dist/runtime/layout/annotate-storage.js +134 -0
- package/dist/runtime/layout/use-annotate-layout.d.ts +17 -0
- package/dist/runtime/layout/use-annotate-layout.js +147 -0
- package/dist/runtime/overlay/SelectionOverlay.d.ts +7 -0
- package/dist/runtime/overlay/SelectionOverlay.js +95 -0
- package/dist/runtime/shared/annotate-constants.d.ts +13 -0
- package/dist/runtime/shared/annotate-constants.js +13 -0
- package/dist/runtime/shared/annotate-types.d.ts +36 -0
- package/dist/runtime/shared/annotate-types.js +1 -0
- package/dist/runtime/shared/clipboard.d.ts +1 -0
- package/dist/runtime/shared/clipboard.js +33 -0
- package/dist/runtime/style.css +206 -0
- package/dist/runtime/task/annotate-task.d.ts +16 -0
- package/dist/runtime/task/annotate-task.js +85 -0
- package/dist/runtime/task/use-annotate-task.d.ts +16 -0
- package/dist/runtime/task/use-annotate-task.js +115 -0
- package/dist/runtime/windows/AnnotateSettingsWindow.d.ts +6 -0
- package/dist/runtime/windows/AnnotateSettingsWindow.js +5 -0
- package/dist/runtime/windows/AnnotateWindow.d.ts +21 -0
- package/dist/runtime/windows/AnnotateWindow.js +83 -0
- package/dist/runtime/windows/AnnotateWindowFrame.d.ts +26 -0
- package/dist/runtime/windows/AnnotateWindowFrame.js +56 -0
- package/dist/runtime/windows/TargetTraceTree.d.ts +12 -0
- package/dist/runtime/windows/TargetTraceTree.js +163 -0
- package/dist/runtime/windows/window-shared.d.ts +14 -0
- package/dist/runtime/windows/window-shared.js +41 -0
- package/dist/task-api.d.ts +15 -0
- package/dist/task-api.js +239 -0
- package/dist/ui/components/accordion.d.ts +7 -0
- package/dist/ui/components/accordion.js +18 -0
- package/dist/ui/components/alert-dialog.d.ts +18 -0
- package/dist/ui/components/alert-dialog.js +41 -0
- package/dist/ui/components/alert.d.ts +9 -0
- package/dist/ui/components/alert.js +24 -0
- package/dist/ui/components/badge.d.ts +9 -0
- package/dist/ui/components/badge.js +24 -0
- package/dist/ui/components/breadcrumb.d.ts +11 -0
- package/dist/ui/components/breadcrumb.js +27 -0
- package/dist/ui/components/button.d.ts +10 -0
- package/dist/ui/components/button.js +31 -0
- package/dist/ui/components/card.d.ts +9 -0
- package/dist/ui/components/card.js +24 -0
- package/dist/ui/components/dropdown-menu.d.ts +11 -0
- package/dist/ui/components/dropdown-menu.js +21 -0
- package/dist/ui/components/input.d.ts +3 -0
- package/dist/ui/components/input.js +6 -0
- package/dist/ui/components/scroll-area.d.ts +5 -0
- package/dist/ui/components/scroll-area.js +12 -0
- package/dist/ui/components/separator.d.ts +4 -0
- package/dist/ui/components/separator.js +8 -0
- package/dist/ui/components/switch.d.ts +6 -0
- package/dist/ui/components/switch.js +7 -0
- package/dist/ui/components/table.d.ts +10 -0
- package/dist/ui/components/table.js +27 -0
- package/dist/ui/components/tabs.d.ts +11 -0
- package/dist/ui/components/tabs.js +28 -0
- package/dist/ui/components/textarea.d.ts +3 -0
- package/dist/ui/components/textarea.js +6 -0
- package/dist/ui/components/toggle-group.d.ts +9 -0
- package/dist/ui/components/toggle-group.js +22 -0
- package/dist/ui/components/toggle.d.ts +9 -0
- package/dist/ui/components/toggle.js +25 -0
- package/dist/ui/components/tooltip.d.ts +7 -0
- package/dist/ui/components/tooltip.js +18 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/lib/utils.d.ts +2 -0
- package/dist/ui/lib/utils.js +5 -0
- package/dist/ui/portal/portal-container.d.ts +13 -0
- package/dist/ui/portal/portal-container.js +12 -0
- package/dist/ui-annotate-plugin.d.ts +28 -0
- package/dist/ui-annotate-plugin.js +227 -0
- package/package.json +55 -0
package/dist/task-api.js
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { ANNOTATE_TASK_AGENT_INSTRUCTIONS, ANNOTATE_TASK_FILE_NAME, EMPTY_ANNOTATE_TASK_FILE } from "./protocol/index.js";
|
|
5
|
+
import { openCodeLocation } from "./code-open.js";
|
|
6
|
+
const ANNOTATE_TASK_ROUTE = "/__ui-annotate/annotate-task";
|
|
7
|
+
const CODE_OPEN_ROUTE = "/__ui-annotate/code/open";
|
|
8
|
+
const MAX_JSON_BODY_BYTES = 100 * 1024 * 1024;
|
|
9
|
+
export function resolveAnnotateTaskPath(root) {
|
|
10
|
+
const absoluteRoot = path.resolve(root);
|
|
11
|
+
const absoluteTaskPath = path.resolve(absoluteRoot, ANNOTATE_TASK_FILE_NAME);
|
|
12
|
+
const relativeFromRoot = path.relative(absoluteRoot, absoluteTaskPath);
|
|
13
|
+
if (relativeFromRoot.startsWith("..") || path.isAbsolute(relativeFromRoot)) {
|
|
14
|
+
throw new Error("Annotate task file must stay inside the project.");
|
|
15
|
+
}
|
|
16
|
+
return absoluteTaskPath;
|
|
17
|
+
}
|
|
18
|
+
export async function readAnnotateTask(root) {
|
|
19
|
+
const taskPath = resolveAnnotateTaskPath(root);
|
|
20
|
+
try {
|
|
21
|
+
const raw = await readFile(taskPath, "utf8");
|
|
22
|
+
const parsed = JSON.parse(raw);
|
|
23
|
+
return validateAnnotateTaskFile(parsed);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (isNodeError(error) && error.code === "ENOENT") {
|
|
27
|
+
return cloneEmptyAnnotateTaskFile();
|
|
28
|
+
}
|
|
29
|
+
if (error instanceof SyntaxError) {
|
|
30
|
+
throw new Error(`Invalid annotate task JSON: ${error.message}`);
|
|
31
|
+
}
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function writeAnnotateTask(root, task) {
|
|
36
|
+
const normalizedTask = validateAnnotateTaskFile(task);
|
|
37
|
+
const taskPath = resolveAnnotateTaskPath(root);
|
|
38
|
+
await writeFile(taskPath, `${JSON.stringify(normalizedTask, null, 2)}\n`, "utf8");
|
|
39
|
+
return normalizedTask;
|
|
40
|
+
}
|
|
41
|
+
export function validateAnnotateTaskFile(input) {
|
|
42
|
+
if (!isRecord(input)) {
|
|
43
|
+
throw new Error("Annotate task body must be a JSON object.");
|
|
44
|
+
}
|
|
45
|
+
if ("requests" in input) {
|
|
46
|
+
throw new Error("Annotate task body must not include a requests array.");
|
|
47
|
+
}
|
|
48
|
+
const targets = input.targets;
|
|
49
|
+
const agentInstructions = normalizeAgentInstructions(input.agentInstructions);
|
|
50
|
+
if (!Array.isArray(targets)) {
|
|
51
|
+
throw new Error("Annotate task body must include a targets array.");
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
agentInstructions,
|
|
55
|
+
targets: targets.map(validateAnnotateTarget)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function createAnnotateApiServer(options = {}) {
|
|
59
|
+
const root = path.resolve(options.root ?? process.cwd());
|
|
60
|
+
const server = createServer(async (request, response) => {
|
|
61
|
+
await handleUiAnnotateRequest(root, request, response);
|
|
62
|
+
});
|
|
63
|
+
return { server, root };
|
|
64
|
+
}
|
|
65
|
+
export async function handleUiAnnotateRequest(root, request, response) {
|
|
66
|
+
const result = await routeRequest(root, request);
|
|
67
|
+
sendJson(response, result.status, result.body);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
async function routeRequest(root, request) {
|
|
71
|
+
try {
|
|
72
|
+
const url = new URL(request.url ?? "/", "http://localhost");
|
|
73
|
+
if (url.pathname === ANNOTATE_TASK_ROUTE) {
|
|
74
|
+
if (request.method === "GET") {
|
|
75
|
+
return {
|
|
76
|
+
status: 200,
|
|
77
|
+
body: await readAnnotateTask(root)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (request.method === "POST") {
|
|
81
|
+
return {
|
|
82
|
+
status: 200,
|
|
83
|
+
body: await writeAnnotateTask(root, await readJsonBody(request))
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
status: 405,
|
|
88
|
+
body: { error: "Method not allowed" }
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (url.pathname === CODE_OPEN_ROUTE) {
|
|
92
|
+
if (request.method !== "POST") {
|
|
93
|
+
return {
|
|
94
|
+
status: 405,
|
|
95
|
+
body: { error: "Method not allowed" }
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
status: 200,
|
|
100
|
+
body: await openCodeLocation(root, await readJsonBody(request))
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
status: 404,
|
|
105
|
+
body: { error: "Not found" }
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return badRequest(error instanceof Error ? error.message : "Invalid request");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function readJsonBody(request) {
|
|
113
|
+
const chunks = [];
|
|
114
|
+
let receivedBytes = 0;
|
|
115
|
+
for await (const chunk of request) {
|
|
116
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
117
|
+
receivedBytes += buffer.byteLength;
|
|
118
|
+
if (receivedBytes > MAX_JSON_BODY_BYTES) {
|
|
119
|
+
throw new Error("JSON body is too large.");
|
|
120
|
+
}
|
|
121
|
+
chunks.push(buffer);
|
|
122
|
+
}
|
|
123
|
+
const raw = Buffer.concat(chunks).toString("utf8");
|
|
124
|
+
try {
|
|
125
|
+
return JSON.parse(raw);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (error instanceof SyntaxError) {
|
|
129
|
+
throw new Error(`Invalid JSON body: ${error.message}`);
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function validateAnnotateTarget(input) {
|
|
135
|
+
if (!isRecord(input)) {
|
|
136
|
+
throw new Error("Each annotate target must be a JSON object.");
|
|
137
|
+
}
|
|
138
|
+
assertAllowedKeys(input, ["id", "comments", "trace"], "annotate target");
|
|
139
|
+
const comments = input.comments;
|
|
140
|
+
const trace = input.trace;
|
|
141
|
+
if (!Array.isArray(comments)) {
|
|
142
|
+
throw new Error("target.comments must be an array.");
|
|
143
|
+
}
|
|
144
|
+
if (!Array.isArray(trace)) {
|
|
145
|
+
throw new Error("target.trace must be an array.");
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
id: requireString(input.id, "target.id"),
|
|
149
|
+
comments: comments.map((comment) => requireString(comment, "target.comments[]")),
|
|
150
|
+
trace: trace.map(validateTraceFrame)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function validateTraceFrame(input) {
|
|
154
|
+
if (!isRecord(input)) {
|
|
155
|
+
throw new Error("Each trace frame must be a JSON object.");
|
|
156
|
+
}
|
|
157
|
+
const calls = input.calls;
|
|
158
|
+
if (!Array.isArray(calls)) {
|
|
159
|
+
throw new Error("trace.calls must be an array.");
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
file: requireString(input.file, "trace.file"),
|
|
163
|
+
calls: calls.map(validateTraceCall)
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function validateTraceCall(input) {
|
|
167
|
+
if (!isRecord(input)) {
|
|
168
|
+
throw new Error("Each trace call must be a JSON object.");
|
|
169
|
+
}
|
|
170
|
+
const role = optionalString(input.role, "trace.calls.role");
|
|
171
|
+
if (role !== undefined && role !== "entry" && role !== "target") {
|
|
172
|
+
throw new Error('trace.calls.role must be "entry" or "target".');
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
line: requirePositiveInteger(input.line, "trace.calls.line"),
|
|
176
|
+
component: requireString(input.component, "trace.calls.component"),
|
|
177
|
+
...(role === undefined ? {} : { role })
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function normalizeAgentInstructions(input) {
|
|
181
|
+
if (input === undefined) {
|
|
182
|
+
return [...ANNOTATE_TASK_AGENT_INSTRUCTIONS];
|
|
183
|
+
}
|
|
184
|
+
if (!Array.isArray(input)) {
|
|
185
|
+
throw new Error("annotate task agentInstructions must be an array of strings.");
|
|
186
|
+
}
|
|
187
|
+
return input.map((instruction) => requireString(instruction, "agentInstructions[]"));
|
|
188
|
+
}
|
|
189
|
+
function assertAllowedKeys(input, allowedKeys, label) {
|
|
190
|
+
const allowed = new Set(allowedKeys);
|
|
191
|
+
const unsupportedKey = Object.keys(input).find((key) => !allowed.has(key));
|
|
192
|
+
if (unsupportedKey) {
|
|
193
|
+
throw new Error(`${label} includes unsupported field: ${unsupportedKey}.`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function cloneEmptyAnnotateTaskFile() {
|
|
197
|
+
return {
|
|
198
|
+
agentInstructions: [...EMPTY_ANNOTATE_TASK_FILE.agentInstructions],
|
|
199
|
+
targets: [...EMPTY_ANNOTATE_TASK_FILE.targets]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function requireString(input, label) {
|
|
203
|
+
if (typeof input !== "string") {
|
|
204
|
+
throw new Error(`${label} must be a string.`);
|
|
205
|
+
}
|
|
206
|
+
return input;
|
|
207
|
+
}
|
|
208
|
+
function optionalString(input, label) {
|
|
209
|
+
if (input === undefined) {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
if (typeof input !== "string") {
|
|
213
|
+
throw new Error(`${label} must be a string.`);
|
|
214
|
+
}
|
|
215
|
+
return input;
|
|
216
|
+
}
|
|
217
|
+
function requirePositiveInteger(input, label) {
|
|
218
|
+
if (!Number.isInteger(input) || typeof input !== "number" || input < 1) {
|
|
219
|
+
throw new Error(`${label} must be a positive integer.`);
|
|
220
|
+
}
|
|
221
|
+
return input;
|
|
222
|
+
}
|
|
223
|
+
function badRequest(message) {
|
|
224
|
+
return {
|
|
225
|
+
status: 400,
|
|
226
|
+
body: { error: message }
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function sendJson(response, status, body) {
|
|
230
|
+
response.statusCode = status;
|
|
231
|
+
response.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
232
|
+
response.end(`${JSON.stringify(body)}\n`);
|
|
233
|
+
}
|
|
234
|
+
function isRecord(input) {
|
|
235
|
+
return typeof input === "object" && input !== null && !Array.isArray(input);
|
|
236
|
+
}
|
|
237
|
+
function isNodeError(error) {
|
|
238
|
+
return error instanceof Error && "code" in error;
|
|
239
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "radix-ui";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { Accordion as AccordionPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
function Accordion({ ...props }) {
|
|
7
|
+
return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
|
|
8
|
+
}
|
|
9
|
+
function AccordionItem({ className, ...props }) {
|
|
10
|
+
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn("border-b last:border-b-0", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function AccordionTrigger({ className, children, ...props }) {
|
|
13
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn("flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" })] }) }));
|
|
14
|
+
}
|
|
15
|
+
function AccordionContent({ className, children, ...props }) {
|
|
16
|
+
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn("pt-0 pb-4 min-w-0", className), children: children }) }));
|
|
17
|
+
}
|
|
18
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDialogContent({ className, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
9
|
+
size?: "default" | "sm";
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function AlertDialogAction({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React.ComponentProps<typeof Button>, "variant" | "size">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
function AlertDialog({ ...props }) {
|
|
6
|
+
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
7
|
+
}
|
|
8
|
+
function AlertDialogTrigger({ ...props }) {
|
|
9
|
+
return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props }));
|
|
10
|
+
}
|
|
11
|
+
function AlertDialogPortal({ ...props }) {
|
|
12
|
+
return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props }));
|
|
13
|
+
}
|
|
14
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
15
|
+
return (_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", className: cn("fixed inset-0 z-[10000] bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
18
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", "data-size": size, className: cn("group/alert-dialog-content fixed top-[50%] left-[50%] z-[10001] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg", className), ...props })] }));
|
|
19
|
+
}
|
|
20
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
21
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
27
|
+
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
30
|
+
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
33
|
+
return (_jsx("div", { "data-slot": "alert-dialog-media", className: cn("mb-2 inline-flex size-16 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
|
|
36
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: cn(className), ...props }) }));
|
|
37
|
+
}
|
|
38
|
+
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
39
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Cancel, { "data-slot": "alert-dialog-cancel", className: cn(className), ...props }) }));
|
|
40
|
+
}
|
|
41
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
const alertVariants = cva("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "bg-card text-card-foreground",
|
|
8
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current",
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
defaultVariants: {
|
|
12
|
+
variant: "default",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
function Alert({ className, variant, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "alert", role: "alert", className: cn(alertVariants({ variant }), className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function AlertTitle({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "alert-title", className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function AlertDescription({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "alert-description", className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
9
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
10
|
+
destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
11
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
12
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
13
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
21
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
22
|
+
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant }), className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
function Breadcrumb({ ...props }) {
|
|
6
|
+
return _jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
7
|
+
}
|
|
8
|
+
function BreadcrumbList({ className, ...props }) {
|
|
9
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
12
|
+
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1.5", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
15
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
16
|
+
return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn("transition-colors hover:text-foreground", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
19
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", "aria-disabled": "true", "aria-current": "page", className: cn("font-normal text-foreground", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
22
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("[&>svg]:size-3.5", className), ...props, children: children ?? _jsx(ChevronRight, {}) }));
|
|
23
|
+
}
|
|
24
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
25
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn("flex size-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontal, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
26
|
+
}
|
|
27
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
9
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
10
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
12
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
17
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
18
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
19
|
+
icon: "size-9",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
size: "default",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
28
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
29
|
+
return (_jsx(Comp, { "data-slot": "button", "data-variant": variant, "data-size": size, className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
function Card({ className, ...props }) {
|
|
4
|
+
return (_jsx("div", { "data-slot": "card", className: cn("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function CardHeader({ className, ...props }) {
|
|
7
|
+
return (_jsx("div", { "data-slot": "card-header", className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function CardTitle({ className, ...props }) {
|
|
10
|
+
return (_jsx("div", { "data-slot": "card-title", className: cn("leading-none font-semibold", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
function CardDescription({ className, ...props }) {
|
|
13
|
+
return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
function CardAction({ className, ...props }) {
|
|
16
|
+
return (_jsx("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function CardContent({ className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "card-content", className: cn("px-6", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function CardFooter({ className, ...props }) {
|
|
22
|
+
return (_jsx("div", { "data-slot": "card-footer", className: cn("flex items-center px-6 [.border-t]:pt-6", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuContent({ className, sideOffset, style, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
8
|
+
inset?: boolean;
|
|
9
|
+
variant?: "default" | "destructive";
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { usePortalContainer } from "../portal/portal-container.js";
|
|
5
|
+
function DropdownMenu({ ...props }) {
|
|
6
|
+
return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
7
|
+
}
|
|
8
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
9
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
|
|
10
|
+
}
|
|
11
|
+
function DropdownMenuContent({ className, sideOffset = 4, style, ...props }) {
|
|
12
|
+
const { container, zIndex } = usePortalContainer();
|
|
13
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { container: container ?? undefined, children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, style: { ...style, ...(zIndex === undefined ? {} : { zIndex }) }, className: cn("pointer-events-auto z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className), ...props }) }));
|
|
14
|
+
}
|
|
15
|
+
function DropdownMenuGroup({ ...props }) {
|
|
16
|
+
return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
17
|
+
}
|
|
18
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
19
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
function Input({ className, type, ...props }) {
|
|
4
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
export { Input };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
function ScrollArea({ className, children, ...props }) {
|
|
5
|
+
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:block!", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
|
|
6
|
+
}
|
|
7
|
+
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
8
|
+
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" &&
|
|
9
|
+
"h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" &&
|
|
10
|
+
"h-2.5 flex-col border-t border-t-transparent", className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "relative flex-1 rounded-full bg-border" }) }));
|
|
11
|
+
}
|
|
12
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
6
|
+
return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
export { Separator };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3
|
+
declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
4
|
+
size?: "sm" | "default";
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Switch };
|