@meshagent/meshagent-tailwind 0.5.7 → 0.5.8
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/CHANGELOG.md +3 -0
- package/dist/cjs/Chat.js +28 -5
- package/dist/cjs/ChatInput.d.ts +4 -1
- package/dist/cjs/ChatInput.js +15 -3
- package/dist/cjs/ChatThread.js +1 -0
- package/dist/cjs/ChatTypingIndicator.js +2 -2
- package/dist/cjs/components/pane-example.d.ts +1 -0
- package/dist/cjs/components/pane-example.js +43 -0
- package/dist/cjs/components/ui/dialog.d.ts +15 -0
- package/dist/cjs/components/ui/dialog.js +166 -0
- package/dist/cjs/components/ui/form.d.ts +24 -0
- package/dist/cjs/components/ui/form.js +146 -0
- package/dist/cjs/components/ui/input.d.ts +3 -0
- package/dist/cjs/components/ui/input.js +41 -0
- package/dist/cjs/components/ui/label.d.ts +4 -0
- package/dist/cjs/components/ui/label.js +53 -0
- package/dist/cjs/components/ui/radio-group.d.ts +5 -0
- package/dist/cjs/components/ui/radio-group.js +76 -0
- package/dist/cjs/components/ui/select.d.ts +15 -0
- package/dist/cjs/components/ui/select.js +199 -0
- package/dist/cjs/components/ui/sheet.d.ts +13 -0
- package/dist/cjs/components/ui/sheet.js +110 -0
- package/dist/cjs/components/ui/sonner.d.ts +3 -0
- package/dist/cjs/components/ui/sonner.js +42 -0
- package/dist/cjs/lib/pane-service.d.ts +16 -0
- package/dist/cjs/lib/pane-service.js +35 -0
- package/dist/cjs/lib/utils.d.ts +4 -0
- package/dist/cjs/tools/ask-user-for-file.d.ts +10 -0
- package/dist/cjs/tools/ask-user-for-file.js +68 -0
- package/dist/cjs/tools/ask-user.d.ts +10 -0
- package/dist/cjs/tools/ask-user.js +161 -0
- package/dist/cjs/tools/build-schema.d.ts +3 -0
- package/dist/cjs/tools/build-schema.js +55 -0
- package/dist/cjs/tools/display-document.d.ts +10 -0
- package/dist/cjs/tools/display-document.js +49 -0
- package/dist/cjs/tools/file-dialog.d.ts +11 -0
- package/dist/cjs/tools/file-dialog.js +113 -0
- package/dist/cjs/tools/form-dialog.d.ts +12 -0
- package/dist/cjs/tools/form-dialog.js +92 -0
- package/dist/cjs/tools/form-schema.d.ts +41 -0
- package/dist/cjs/tools/form-schema.js +51 -0
- package/dist/cjs/tools/form.d.ts +16 -0
- package/dist/cjs/tools/form.js +81 -0
- package/dist/cjs/tools/toast.d.ts +10 -0
- package/dist/cjs/tools/toast.js +52 -0
- package/dist/cjs/tools/ui-toolkit.d.ts +6 -0
- package/dist/cjs/tools/ui-toolkit.js +44 -0
- package/dist/esm/Chat.js +29 -6
- package/dist/esm/ChatInput.d.ts +4 -1
- package/dist/esm/ChatInput.js +15 -3
- package/dist/esm/ChatThread.js +1 -0
- package/dist/esm/ChatTypingIndicator.js +2 -2
- package/dist/esm/components/pane-example.d.ts +1 -0
- package/dist/esm/components/pane-example.js +30 -0
- package/dist/esm/components/ui/dialog.d.ts +15 -0
- package/dist/esm/components/ui/dialog.js +136 -0
- package/dist/esm/components/ui/form.d.ts +24 -0
- package/dist/esm/components/ui/form.js +121 -0
- package/dist/esm/components/ui/input.d.ts +3 -0
- package/dist/esm/components/ui/input.js +21 -0
- package/dist/esm/components/ui/label.d.ts +4 -0
- package/dist/esm/components/ui/label.js +23 -0
- package/dist/esm/components/ui/radio-group.d.ts +5 -0
- package/dist/esm/components/ui/radio-group.js +46 -0
- package/dist/esm/components/ui/select.d.ts +15 -0
- package/dist/esm/components/ui/select.js +169 -0
- package/dist/esm/components/ui/sheet.d.ts +13 -0
- package/dist/esm/components/ui/sheet.js +80 -0
- package/dist/esm/components/ui/sonner.d.ts +3 -0
- package/dist/esm/components/ui/sonner.js +22 -0
- package/dist/esm/lib/pane-service.d.ts +16 -0
- package/dist/esm/lib/pane-service.js +15 -0
- package/dist/esm/lib/utils.d.ts +4 -0
- package/dist/esm/tools/ask-user-for-file.d.ts +10 -0
- package/dist/esm/tools/ask-user-for-file.js +48 -0
- package/dist/esm/tools/ask-user.d.ts +10 -0
- package/dist/esm/tools/ask-user.js +141 -0
- package/dist/esm/tools/build-schema.d.ts +3 -0
- package/dist/esm/tools/build-schema.js +25 -0
- package/dist/esm/tools/display-document.d.ts +10 -0
- package/dist/esm/tools/display-document.js +29 -0
- package/dist/esm/tools/file-dialog.d.ts +11 -0
- package/dist/esm/tools/file-dialog.js +101 -0
- package/dist/esm/tools/form-dialog.d.ts +12 -0
- package/dist/esm/tools/form-dialog.js +79 -0
- package/dist/esm/tools/form-schema.d.ts +41 -0
- package/dist/esm/tools/form-schema.js +31 -0
- package/dist/esm/tools/form.d.ts +16 -0
- package/dist/esm/tools/form.js +64 -0
- package/dist/esm/tools/toast.d.ts +10 -0
- package/dist/esm/tools/toast.js +32 -0
- package/dist/esm/tools/ui-toolkit.d.ts +6 -0
- package/dist/esm/tools/ui-toolkit.js +24 -0
- package/dist/index.css +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
function Input({ className, type, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"input",
|
|
6
|
+
{
|
|
7
|
+
type,
|
|
8
|
+
"data-slot": "input",
|
|
9
|
+
className: cn(
|
|
10
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
11
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
12
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
13
|
+
className
|
|
14
|
+
),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
Input
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Label({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
LabelPrimitive.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "label",
|
|
13
|
+
className: cn(
|
|
14
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
Label
|
|
23
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
import { CircleIcon } from "lucide-react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
function RadioGroup({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
RadioGroupPrimitive.Root,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "radio-group",
|
|
14
|
+
className: cn("grid gap-3", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function RadioGroupItem({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
RadioGroupPrimitive.Item,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "radio-group-item",
|
|
27
|
+
className: cn(
|
|
28
|
+
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(
|
|
33
|
+
RadioGroupPrimitive.Indicator,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "radio-group-indicator",
|
|
36
|
+
className: "relative flex items-center justify-center",
|
|
37
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
RadioGroup,
|
|
45
|
+
RadioGroupItem
|
|
46
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Select({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
9
|
+
}
|
|
10
|
+
function SelectGroup({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
14
|
+
}
|
|
15
|
+
function SelectValue({
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
19
|
+
}
|
|
20
|
+
function SelectTrigger({
|
|
21
|
+
className,
|
|
22
|
+
size = "default",
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
SelectPrimitive.Trigger,
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "select-trigger",
|
|
30
|
+
"data-size": size,
|
|
31
|
+
className: cn(
|
|
32
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
...props,
|
|
36
|
+
children: [
|
|
37
|
+
children,
|
|
38
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function SelectContent({
|
|
44
|
+
className,
|
|
45
|
+
children,
|
|
46
|
+
position = "popper",
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
50
|
+
SelectPrimitive.Content,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "select-content",
|
|
53
|
+
className: cn(
|
|
54
|
+
"bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
55
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
position,
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
SelectPrimitive.Viewport,
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
"p-1",
|
|
67
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
68
|
+
),
|
|
69
|
+
children
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
}
|
|
77
|
+
function SelectLabel({
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
SelectPrimitive.Label,
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "select-label",
|
|
85
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function SelectItem({
|
|
91
|
+
className,
|
|
92
|
+
children,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ jsxs(
|
|
96
|
+
SelectPrimitive.Item,
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "select-item",
|
|
99
|
+
className: cn(
|
|
100
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
106
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function SelectSeparator({
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}) {
|
|
115
|
+
return /* @__PURE__ */ jsx(
|
|
116
|
+
SelectPrimitive.Separator,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "select-separator",
|
|
119
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
120
|
+
...props
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
function SelectScrollUpButton({
|
|
125
|
+
className,
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
SelectPrimitive.ScrollUpButton,
|
|
130
|
+
{
|
|
131
|
+
"data-slot": "select-scroll-up-button",
|
|
132
|
+
className: cn(
|
|
133
|
+
"flex cursor-default items-center justify-center py-1",
|
|
134
|
+
className
|
|
135
|
+
),
|
|
136
|
+
...props,
|
|
137
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function SelectScrollDownButton({
|
|
142
|
+
className,
|
|
143
|
+
...props
|
|
144
|
+
}) {
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
SelectPrimitive.ScrollDownButton,
|
|
147
|
+
{
|
|
148
|
+
"data-slot": "select-scroll-down-button",
|
|
149
|
+
className: cn(
|
|
150
|
+
"flex cursor-default items-center justify-center py-1",
|
|
151
|
+
className
|
|
152
|
+
),
|
|
153
|
+
...props,
|
|
154
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
Select,
|
|
160
|
+
SelectContent,
|
|
161
|
+
SelectGroup,
|
|
162
|
+
SelectItem,
|
|
163
|
+
SelectLabel,
|
|
164
|
+
SelectScrollDownButton,
|
|
165
|
+
SelectScrollUpButton,
|
|
166
|
+
SelectSeparator,
|
|
167
|
+
SelectTrigger,
|
|
168
|
+
SelectValue
|
|
169
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
function Sheet({ ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
7
|
+
}
|
|
8
|
+
function SheetTrigger({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function SheetClose({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
13
|
+
}
|
|
14
|
+
function SheetPortal({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
16
|
+
}
|
|
17
|
+
function SheetOverlay({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
SheetPrimitive.Overlay,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "sheet-overlay",
|
|
22
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
|
23
|
+
...props
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
function SheetContent({ className, children, side = "right", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
30
|
+
/* @__PURE__ */ jsxs(
|
|
31
|
+
SheetPrimitive.Content,
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "sheet-content",
|
|
34
|
+
className: cn(
|
|
35
|
+
"fixed z-50",
|
|
36
|
+
"flex flex-col gap-4",
|
|
37
|
+
"shadow-lg bg-background",
|
|
38
|
+
"transition ease-in-out",
|
|
39
|
+
"data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
40
|
+
"data-[state=closed]:animate-out data-[state=closed]:duration-300",
|
|
41
|
+
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full border-l sm:max-w-sm",
|
|
42
|
+
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full border-r sm:max-w-sm",
|
|
43
|
+
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
44
|
+
side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
...props,
|
|
48
|
+
children: [
|
|
49
|
+
children,
|
|
50
|
+
/* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
53
|
+
] })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
function SheetHeader({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5 p-4", className), ...props });
|
|
61
|
+
}
|
|
62
|
+
function SheetFooter({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
|
|
64
|
+
}
|
|
65
|
+
function SheetTitle({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: cn("text-foreground font-semibold", className), ...props });
|
|
67
|
+
}
|
|
68
|
+
function SheetDescription({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: cn("text-muted-foreground text-sm", className), ...props });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
Sheet,
|
|
73
|
+
SheetClose,
|
|
74
|
+
SheetContent,
|
|
75
|
+
SheetDescription,
|
|
76
|
+
SheetFooter,
|
|
77
|
+
SheetHeader,
|
|
78
|
+
SheetTitle,
|
|
79
|
+
SheetTrigger
|
|
80
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "next-themes";
|
|
3
|
+
import { Toaster as Sonner } from "sonner";
|
|
4
|
+
const Toaster = ({ ...props }) => {
|
|
5
|
+
const { theme = "system" } = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
Sonner,
|
|
8
|
+
{
|
|
9
|
+
theme,
|
|
10
|
+
className: "toaster group",
|
|
11
|
+
style: {
|
|
12
|
+
"--normal-bg": "var(--popover)",
|
|
13
|
+
"--normal-text": "var(--popover-foreground)",
|
|
14
|
+
"--normal-border": "var(--border)"
|
|
15
|
+
},
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
Toaster
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simple emitter service to control a Radix UI Sheet (pane) from anywhere
|
|
3
|
+
*/
|
|
4
|
+
export type PaneCallback = (open: boolean) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Register a listener (usually in a React root component)
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerPane(cb: PaneCallback): void;
|
|
9
|
+
/**
|
|
10
|
+
* Open the pane from anywhere—even outside React components
|
|
11
|
+
*/
|
|
12
|
+
export declare function openPane(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Close the pane
|
|
15
|
+
*/
|
|
16
|
+
export declare function closePane(): void;
|
package/dist/esm/lib/utils.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tool } from '@meshagent/meshagent';
|
|
2
|
+
import type { Response } from '@meshagent/meshagent';
|
|
3
|
+
export declare class AskUserForFile extends Tool {
|
|
4
|
+
constructor({ name, description, title }?: {
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
});
|
|
9
|
+
execute(arguments_: Record<string, any>): Promise<Response>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Tool, FileResponse } from "@meshagent/meshagent";
|
|
2
|
+
import { showFileDialog } from "./file-dialog";
|
|
3
|
+
const askUserForFileSchema = {
|
|
4
|
+
type: "object",
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
required: ["title", "description"],
|
|
7
|
+
properties: {
|
|
8
|
+
title: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "a very short description suitable for a dialog title"
|
|
11
|
+
},
|
|
12
|
+
description: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "helpful information that explains why this information is being collected and how it will be used"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
class AskUserForFile extends Tool {
|
|
19
|
+
constructor({ name, description, title } = {}) {
|
|
20
|
+
super({
|
|
21
|
+
name: name ?? "ask_user_for_file",
|
|
22
|
+
description: description ?? "ask the user for a file (will be accessible as a blob url to other tools)",
|
|
23
|
+
title: title ?? "ask user for file",
|
|
24
|
+
inputSchema: askUserForFileSchema
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async execute(arguments_) {
|
|
28
|
+
const file = await showFileDialog({
|
|
29
|
+
title: arguments_.title,
|
|
30
|
+
description: arguments_.description
|
|
31
|
+
});
|
|
32
|
+
if (file) {
|
|
33
|
+
const data = await file.arrayBuffer();
|
|
34
|
+
const name = file ? file.name : "unknown";
|
|
35
|
+
const mimeType = file ? file.type : "application/octet-stream";
|
|
36
|
+
return new FileResponse({
|
|
37
|
+
data: data ?? new Uint8Array(),
|
|
38
|
+
name,
|
|
39
|
+
mimeType
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
throw Error("The user cancelled the request");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
AskUserForFile
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tool } from '@meshagent/meshagent';
|
|
2
|
+
import type { Response } from '@meshagent/meshagent';
|
|
3
|
+
export declare class AskUser extends Tool {
|
|
4
|
+
constructor({ name, description, title }?: {
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
});
|
|
9
|
+
execute(arguments_: Record<string, any>): Promise<Response>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Tool, JsonResponse } from "@meshagent/meshagent";
|
|
2
|
+
import { showUserFormDialog } from "./form-dialog";
|
|
3
|
+
const askUserSchema = {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["subject", "form", "help"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"subject": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "a very short description suitable for a dialog title"
|
|
11
|
+
},
|
|
12
|
+
"help": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "helpful information that explains why this information is being collected and how it will be used"
|
|
15
|
+
},
|
|
16
|
+
"form": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": {
|
|
19
|
+
"anyOf": [
|
|
20
|
+
{
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["input"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"input": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["multiline", "name", "description", "default_value"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"name": { "type": "string" },
|
|
31
|
+
"description": { "type": "string" },
|
|
32
|
+
"multiline": { "type": "boolean" },
|
|
33
|
+
"default_value": { "type": "string" }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["checkbox"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"checkbox": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["name", "description", "default_value"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"name": { "type": "string" },
|
|
49
|
+
"description": { "type": "string" },
|
|
50
|
+
"default_value": { "type": "boolean" }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["radio_group"],
|
|
59
|
+
"description": "allows the user to select a single option from a list of options. best for multiple choice questions or surveys",
|
|
60
|
+
"properties": {
|
|
61
|
+
"radio_group": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["name", "default_value", "description", "options"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"name": { "type": "string" },
|
|
67
|
+
"description": { "type": "string" },
|
|
68
|
+
"default_value": { "type": "string" },
|
|
69
|
+
"options": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["name", "value"],
|
|
75
|
+
"properties": {
|
|
76
|
+
"name": { "type": "string" },
|
|
77
|
+
"value": { "type": "string" }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": ["select"],
|
|
89
|
+
"properties": {
|
|
90
|
+
"select": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": ["name", "options", "description", "default_value"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"name": { "type": "string" },
|
|
96
|
+
"description": { "type": "string" },
|
|
97
|
+
"default_value": { "type": "string" },
|
|
98
|
+
"options": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"required": ["name", "value"],
|
|
104
|
+
"properties": {
|
|
105
|
+
"name": { "type": "string" },
|
|
106
|
+
"value": { "type": "string" }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
class AskUser extends Tool {
|
|
120
|
+
constructor({ name, description, title } = {}) {
|
|
121
|
+
super({
|
|
122
|
+
name: name ?? "ask_user",
|
|
123
|
+
description: description ?? "ask the user a question",
|
|
124
|
+
title: title ?? "Ask User",
|
|
125
|
+
inputSchema: askUserSchema
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async execute(arguments_) {
|
|
129
|
+
const result = await showUserFormDialog({
|
|
130
|
+
formSchema: arguments_.form,
|
|
131
|
+
title: arguments_.subject
|
|
132
|
+
});
|
|
133
|
+
if (result === null) {
|
|
134
|
+
throw new Error("User cancelled the form dialog");
|
|
135
|
+
}
|
|
136
|
+
return new JsonResponse({ json: result });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export {
|
|
140
|
+
AskUser
|
|
141
|
+
};
|