@cognite/aura 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/components/index.d.ts +53 -0
- package/dist/components/ui/core/alert/alert.d.ts +19 -0
- package/dist/components/ui/core/alert/alert.js +180 -0
- package/dist/components/ui/core/alert/alert.metadata.d.ts +2 -0
- package/dist/components/ui/core/alert/alert.metadata.js +9 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -0
- package/dist/components/ui/core/avatar/avatar.js +94 -0
- package/dist/components/ui/core/avatar/avatar.metadata.d.ts +8 -0
- package/dist/components/ui/core/avatar/avatar.metadata.js +9 -0
- package/dist/components/ui/core/badge/badge.d.ts +14 -0
- package/dist/components/ui/core/badge/badge.js +116 -0
- package/dist/components/ui/core/badge/badge.metadata.d.ts +2 -0
- package/dist/components/ui/core/badge/badge.metadata.js +8 -0
- package/dist/components/ui/core/button/button.d.ts +9 -0
- package/dist/components/ui/core/button/button.js +50 -0
- package/dist/components/ui/core/button/button.metadata.d.ts +2 -0
- package/dist/components/ui/core/button/button.metadata.js +9 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +11 -0
- package/dist/components/ui/core/button-group/button-group.js +83 -0
- package/dist/components/ui/core/button-group/button-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/button-group/button-group.metadata.js +8 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +21 -0
- package/dist/components/ui/core/code-block/code-block.js +146 -0
- package/dist/components/ui/core/code-block/code-block.metadata.d.ts +2 -0
- package/dist/components/ui/core/code-block/code-block.metadata.js +8 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +4 -0
- package/dist/components/ui/core/collapsible/collapsible.js +44 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.d.ts +2 -0
- package/dist/components/ui/core/collapsible/collapsible.metadata.js +9 -0
- package/dist/components/ui/core/command/command.d.ts +86 -0
- package/dist/components/ui/core/command/command.js +150 -0
- package/dist/components/ui/core/command/command.metadata.d.ts +2 -0
- package/dist/components/ui/core/command/command.metadata.js +9 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +18 -0
- package/dist/components/ui/core/dialog/dialog.js +155 -0
- package/dist/components/ui/core/dialog/dialog.metadata.d.ts +2 -0
- package/dist/components/ui/core/dialog/dialog.metadata.js +9 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +53 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +250 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.d.ts +2 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.metadata.js +9 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +12 -0
- package/dist/components/ui/core/helper-text/helper-text.js +65 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.d.ts +2 -0
- package/dist/components/ui/core/helper-text/helper-text.metadata.js +9 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +12 -0
- package/dist/components/ui/core/hover-card/hover-card.js +76 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.d.ts +2 -0
- package/dist/components/ui/core/hover-card/hover-card.metadata.js +8 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +33 -0
- package/dist/components/ui/core/inline-citation/inline-citation.js +170 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.d.ts +2 -0
- package/dist/components/ui/core/inline-citation/inline-citation.metadata.js +8 -0
- package/dist/components/ui/core/input/input.d.ts +6 -0
- package/dist/components/ui/core/input/input.js +34 -0
- package/dist/components/ui/core/input/input.metadata.d.ts +2 -0
- package/dist/components/ui/core/input/input.metadata.js +9 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +15 -0
- package/dist/components/ui/core/input-group/input-group.js +144 -0
- package/dist/components/ui/core/input-group/input-group.metadata.d.ts +2 -0
- package/dist/components/ui/core/input-group/input-group.metadata.js +9 -0
- package/dist/components/ui/core/label/label.d.ts +2 -0
- package/dist/components/ui/core/label/label.js +20 -0
- package/dist/components/ui/core/label/label.metadata.d.ts +2 -0
- package/dist/components/ui/core/label/label.metadata.js +9 -0
- package/dist/components/ui/core/loader/loader.d.ts +7 -0
- package/dist/components/ui/core/loader/loader.js +119 -0
- package/dist/components/ui/core/loader/loader.metadata.d.ts +2 -0
- package/dist/components/ui/core/loader/loader.metadata.js +9 -0
- package/dist/components/ui/core/message/message.d.ts +55 -0
- package/dist/components/ui/core/message/message.js +169 -0
- package/dist/components/ui/core/message/message.metadata.d.ts +2 -0
- package/dist/components/ui/core/popover/popover.d.ts +8 -0
- package/dist/components/ui/core/popover/popover.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +161 -0
- package/dist/components/ui/core/prompt-input/prompt-input.js +402 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.d.ts +2 -0
- package/dist/components/ui/core/prompt-input/prompt-input.metadata.js +9 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +9 -0
- package/dist/components/ui/core/reasoning/reasoning.js +85 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.d.ts +2 -0
- package/dist/components/ui/core/reasoning/reasoning.metadata.js +8 -0
- package/dist/components/ui/core/select/select.d.ts +44 -0
- package/dist/components/ui/core/select/select.js +279 -0
- package/dist/components/ui/core/select/select.metadata.d.ts +2 -0
- package/dist/components/ui/core/select/select.metadata.js +9 -0
- package/dist/components/ui/core/separator/separator.d.ts +6 -0
- package/dist/components/ui/core/separator/separator.js +25 -0
- package/dist/components/ui/core/separator/separator.metadata.d.ts +2 -0
- package/dist/components/ui/core/separator/separator.metadata.js +8 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +14 -0
- package/dist/components/ui/core/shimmer/shimmer.js +69 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.d.ts +2 -0
- package/dist/components/ui/core/shimmer/shimmer.metadata.js +9 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.js +18 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.d.ts +2 -0
- package/dist/components/ui/core/skeleton/skeleton.metadata.js +9 -0
- package/dist/components/ui/core/sources/sources.d.ts +16 -0
- package/dist/components/ui/core/sources/sources.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +9 -0
- package/dist/components/ui/core/textarea/textarea.js +49 -0
- package/dist/components/ui/core/textarea/textarea.metadata.d.ts +2 -0
- package/dist/components/ui/core/textarea/textarea.metadata.js +9 -0
- package/dist/components/ui/core/tool/tool.d.ts +21 -0
- package/dist/components/ui/core/tool/tool.js +151 -0
- package/dist/components/ui/core/tool/tool.metadata.d.ts +2 -0
- package/dist/components/ui/core/tool/tool.metadata.js +8 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +10 -0
- package/dist/components/ui/core/tooltip/tooltip.js +82 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.d.ts +8 -0
- package/dist/components/ui/core/tooltip/tooltip.metadata.js +9 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.d.ts +134 -0
- package/dist/components/ui/lab/breadcrumb/breadcrumb.metadata.d.ts +2 -0
- package/dist/components/ui/lab/topbar/topbar.d.ts +10 -0
- package/dist/components/ui/lab/topbar/topbar.metadata.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +229 -0
- package/dist/lib/ai/types.d.ts +53 -0
- package/dist/lib/component-status-config.d.ts +12 -0
- package/dist/lib/style-scope.d.ts +5 -0
- package/dist/lib/style-scope.js +7 -0
- package/dist/lib/types.d.ts +50 -0
- package/dist/lib/use-controllable-state.d.ts +11 -0
- package/dist/lib/use-controllable-state.js +32 -0
- package/dist/lib/utils.d.ts +45 -0
- package/dist/lib/utils.js +92 -0
- package/package.json +51 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as H, forwardRef as p, useContext as b, useState as N, useCallback as A, useMemo as E } from "react";
|
|
3
|
+
import { IconSend as D, IconLoader2 as z, IconSquare as B, IconX as L, IconPlus as k, IconInfoCircle as G } from "@tabler/icons-react";
|
|
4
|
+
import { cn as r } from "../../../../lib/utils.js";
|
|
5
|
+
import { Command as F, CommandInput as j, CommandList as K, CommandEmpty as V, CommandGroup as q, CommandItem as R, CommandSeparator as O } from "../command/command.js";
|
|
6
|
+
import { DropdownMenu as W, DropdownMenuTrigger as X, DropdownMenuContent as J, DropdownMenuItem as Q } from "../dropdown-menu/dropdown-menu.js";
|
|
7
|
+
import { HelperText as C } from "../helper-text/helper-text.js";
|
|
8
|
+
import { HoverCard as U, HoverCardTrigger as Y, HoverCardContent as Z } from "../hover-card/hover-card.js";
|
|
9
|
+
import { InputGroupTextarea as _, InputGroupAddon as x, InputGroupButton as h, InputGroup as $ } from "../input-group/input-group.js";
|
|
10
|
+
import { Select as tt, SelectTrigger as et, SelectContent as ot, SelectItem as nt, SelectValue as rt } from "../select/select.js";
|
|
11
|
+
const g = H(
|
|
12
|
+
null
|
|
13
|
+
), Jt = () => {
|
|
14
|
+
const t = b(g);
|
|
15
|
+
if (!t)
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Wrap your component inside <PromptInputProvider> to use usePromptInputController()."
|
|
18
|
+
);
|
|
19
|
+
return t;
|
|
20
|
+
}, v = () => b(g);
|
|
21
|
+
function at({
|
|
22
|
+
initialInput: t = "",
|
|
23
|
+
children: e
|
|
24
|
+
}) {
|
|
25
|
+
const [n, a] = N(t), l = A(() => a(""), []), s = E(
|
|
26
|
+
() => ({
|
|
27
|
+
textInput: {
|
|
28
|
+
value: n,
|
|
29
|
+
setInput: a,
|
|
30
|
+
clear: l
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
[n, l]
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ o(g.Provider, { value: s, children: e });
|
|
36
|
+
}
|
|
37
|
+
at.displayName = "PromptInputProvider";
|
|
38
|
+
const pt = ({
|
|
39
|
+
className: t,
|
|
40
|
+
onSubmit: e,
|
|
41
|
+
helperText: n,
|
|
42
|
+
errorMessage: a,
|
|
43
|
+
children: l,
|
|
44
|
+
...s
|
|
45
|
+
}) => {
|
|
46
|
+
const m = v(), [u, d] = N(null), P = (y) => {
|
|
47
|
+
y.preventDefault();
|
|
48
|
+
const f = y.currentTarget, M = m ? m.textInput.value : (() => {
|
|
49
|
+
const I = new FormData(f).get("message");
|
|
50
|
+
return typeof I == "string" ? I : "";
|
|
51
|
+
})();
|
|
52
|
+
m || f.reset();
|
|
53
|
+
try {
|
|
54
|
+
const c = e({ text: M }, y);
|
|
55
|
+
c instanceof Promise ? c.then(() => {
|
|
56
|
+
d(null), m?.textInput.clear();
|
|
57
|
+
}).catch((I) => {
|
|
58
|
+
console.error("PromptInput: Submission error:", I), d(
|
|
59
|
+
I instanceof Error ? I.message : "Failed to submit. Please try again."
|
|
60
|
+
);
|
|
61
|
+
}) : (d(null), m?.textInput.clear());
|
|
62
|
+
} catch (c) {
|
|
63
|
+
console.error("PromptInput: Submission error:", c), d(
|
|
64
|
+
c instanceof Error ? c.message : "Failed to submit. Please try again."
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}, S = n === !1 ? null : n ?? /* @__PURE__ */ o(C, { size: "xs", icon: /* @__PURE__ */ o(G, {}), children: "AI doesn't always get it right. Be sure to check results" });
|
|
68
|
+
return /* @__PURE__ */ w("div", { className: "w-full flex flex-col gap-2", children: [
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
"form",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "prompt-input",
|
|
73
|
+
className: r("w-full", t),
|
|
74
|
+
onSubmit: P,
|
|
75
|
+
...s,
|
|
76
|
+
children: /* @__PURE__ */ o($, { className: "shadow-none rounded-xl has-[[data-slot=input-group-control]:read-only]:border-input hover:has-[[data-slot=input-group-control]:read-only]:border-input hover:has-[[data-slot=input-group-control]:read-only]:bg-background hover:has-[[data-slot=input-group-control]:read-only]:text-current", children: l })
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
a || u ? /* @__PURE__ */ o(C, { size: "xs", isError: !0, children: a || u }) : S
|
|
80
|
+
] });
|
|
81
|
+
};
|
|
82
|
+
pt.displayName = "PromptInput";
|
|
83
|
+
const st = p(
|
|
84
|
+
({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
ref: n,
|
|
88
|
+
"data-slot": "prompt-input-body",
|
|
89
|
+
className: r("contents", t),
|
|
90
|
+
...e
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
st.displayName = "PromptInputBody";
|
|
95
|
+
const mt = p(
|
|
96
|
+
({ onChange: t, className: e, placeholder: n = "Type your message...", ...a }, l) => {
|
|
97
|
+
const s = v(), [m, u] = N(!1), d = (i) => {
|
|
98
|
+
if (i.key === "Enter") {
|
|
99
|
+
if (m || i.nativeEvent.isComposing || i.shiftKey)
|
|
100
|
+
return;
|
|
101
|
+
i.preventDefault(), i.currentTarget.form?.requestSubmit();
|
|
102
|
+
}
|
|
103
|
+
}, P = s ? {
|
|
104
|
+
value: s.textInput.value,
|
|
105
|
+
onChange: (i) => {
|
|
106
|
+
s.textInput.setInput(i.currentTarget.value), t?.(i);
|
|
107
|
+
}
|
|
108
|
+
} : {
|
|
109
|
+
onChange: t
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ o(
|
|
112
|
+
_,
|
|
113
|
+
{
|
|
114
|
+
ref: l,
|
|
115
|
+
className: r(
|
|
116
|
+
"field-sizing-content max-h-48 min-h-18 rounded-t-xl md:text-base tracking-tightest p-2.75 leading-5",
|
|
117
|
+
e
|
|
118
|
+
),
|
|
119
|
+
name: "message",
|
|
120
|
+
onCompositionEnd: () => u(!1),
|
|
121
|
+
onCompositionStart: () => u(!0),
|
|
122
|
+
onKeyDown: d,
|
|
123
|
+
placeholder: n,
|
|
124
|
+
...a,
|
|
125
|
+
...P
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
mt.displayName = "PromptInputTextarea";
|
|
131
|
+
const lt = p(({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
132
|
+
x,
|
|
133
|
+
{
|
|
134
|
+
ref: n,
|
|
135
|
+
align: "block-end",
|
|
136
|
+
className: r("order-first flex-wrap gap-1", t),
|
|
137
|
+
...e
|
|
138
|
+
}
|
|
139
|
+
));
|
|
140
|
+
lt.displayName = "PromptInputHeader";
|
|
141
|
+
const ut = p(({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
142
|
+
x,
|
|
143
|
+
{
|
|
144
|
+
ref: n,
|
|
145
|
+
align: "block-end",
|
|
146
|
+
className: r("justify-between gap-1 p-2.75", t),
|
|
147
|
+
...e
|
|
148
|
+
}
|
|
149
|
+
));
|
|
150
|
+
ut.displayName = "PromptInputFooter";
|
|
151
|
+
const it = p(
|
|
152
|
+
({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
ref: n,
|
|
156
|
+
"data-slot": "prompt-input-tools",
|
|
157
|
+
className: r("flex items-center gap-2", t),
|
|
158
|
+
...e
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
it.displayName = "PromptInputTools";
|
|
163
|
+
const T = p(({ variant: t = "ghost", className: e, size: n, ...a }, l) => {
|
|
164
|
+
const s = a.children === void 0 || a.children === null ? 0 : Array.isArray(a.children) ? a.children.length : 1, m = n ?? (s > 1 ? "sm" : "icon-sm");
|
|
165
|
+
return /* @__PURE__ */ o(
|
|
166
|
+
h,
|
|
167
|
+
{
|
|
168
|
+
ref: l,
|
|
169
|
+
className: r(e),
|
|
170
|
+
size: m,
|
|
171
|
+
type: "button",
|
|
172
|
+
variant: t,
|
|
173
|
+
...a
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
});
|
|
177
|
+
T.displayName = "PromptInputButton";
|
|
178
|
+
const ct = (t) => /* @__PURE__ */ o(W, { ...t });
|
|
179
|
+
ct.displayName = "PromptInputActionMenu";
|
|
180
|
+
const dt = ({
|
|
181
|
+
className: t,
|
|
182
|
+
children: e,
|
|
183
|
+
...n
|
|
184
|
+
}) => /* @__PURE__ */ o(
|
|
185
|
+
X,
|
|
186
|
+
{
|
|
187
|
+
render: /* @__PURE__ */ o(T, { className: t, ...n, children: e ?? /* @__PURE__ */ o(k, { className: "size-4" }) })
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
dt.displayName = "PromptInputActionMenuTrigger";
|
|
191
|
+
const It = ({
|
|
192
|
+
className: t,
|
|
193
|
+
...e
|
|
194
|
+
}) => /* @__PURE__ */ o(J, { align: "start", className: r(t), ...e });
|
|
195
|
+
It.displayName = "PromptInputActionMenuContent";
|
|
196
|
+
const Pt = ({
|
|
197
|
+
className: t,
|
|
198
|
+
...e
|
|
199
|
+
}) => /* @__PURE__ */ o(Q, { className: r(t), ...e });
|
|
200
|
+
Pt.displayName = "PromptInputActionMenuItem";
|
|
201
|
+
const yt = p(
|
|
202
|
+
({
|
|
203
|
+
className: t,
|
|
204
|
+
variant: e = "default",
|
|
205
|
+
size: n = "icon-sm",
|
|
206
|
+
status: a,
|
|
207
|
+
children: l,
|
|
208
|
+
...s
|
|
209
|
+
}, m) => {
|
|
210
|
+
let u = /* @__PURE__ */ o(D, { className: "size-4" });
|
|
211
|
+
return a === "submitted" ? u = /* @__PURE__ */ o(z, { className: "size-4 animate-spin" }) : a === "streaming" ? u = /* @__PURE__ */ o(B, { className: "size-4" }) : a === "error" && (u = /* @__PURE__ */ o(L, { className: "size-4" })), /* @__PURE__ */ o(
|
|
212
|
+
h,
|
|
213
|
+
{
|
|
214
|
+
ref: m,
|
|
215
|
+
"aria-label": "Submit",
|
|
216
|
+
className: r(t),
|
|
217
|
+
"data-status": a,
|
|
218
|
+
size: n,
|
|
219
|
+
type: "submit",
|
|
220
|
+
variant: e,
|
|
221
|
+
...s,
|
|
222
|
+
children: l ?? u
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
yt.displayName = "PromptInputSubmit";
|
|
228
|
+
const Nt = (t) => /* @__PURE__ */ o(tt, { ...t });
|
|
229
|
+
Nt.displayName = "PromptInputModelSelect";
|
|
230
|
+
const gt = ({
|
|
231
|
+
className: t,
|
|
232
|
+
...e
|
|
233
|
+
}) => /* @__PURE__ */ o(
|
|
234
|
+
et,
|
|
235
|
+
{
|
|
236
|
+
className: r(
|
|
237
|
+
"border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors",
|
|
238
|
+
"hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground",
|
|
239
|
+
t
|
|
240
|
+
),
|
|
241
|
+
...e
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
gt.displayName = "PromptInputModelSelectTrigger";
|
|
245
|
+
const ft = ({
|
|
246
|
+
className: t,
|
|
247
|
+
...e
|
|
248
|
+
}) => /* @__PURE__ */ o(ot, { className: r(t), ...e });
|
|
249
|
+
ft.displayName = "PromptInputModelSelectContent";
|
|
250
|
+
const Ct = ({
|
|
251
|
+
className: t,
|
|
252
|
+
...e
|
|
253
|
+
}) => /* @__PURE__ */ o(nt, { className: r(t), ...e });
|
|
254
|
+
Ct.displayName = "PromptInputModelSelectItem";
|
|
255
|
+
const bt = ({
|
|
256
|
+
className: t,
|
|
257
|
+
...e
|
|
258
|
+
}) => /* @__PURE__ */ o(rt, { className: r(t), ...e });
|
|
259
|
+
bt.displayName = "PromptInputModelSelectValue";
|
|
260
|
+
const xt = ({
|
|
261
|
+
openDelay: t = 0,
|
|
262
|
+
closeDelay: e = 0,
|
|
263
|
+
...n
|
|
264
|
+
}) => /* @__PURE__ */ o(U, { closeDelay: e, openDelay: t, ...n });
|
|
265
|
+
xt.displayName = "PromptInputHoverCard";
|
|
266
|
+
const ht = (t) => /* @__PURE__ */ o(Y, { ...t });
|
|
267
|
+
ht.displayName = "PromptInputHoverCardTrigger";
|
|
268
|
+
const vt = ({
|
|
269
|
+
align: t = "start",
|
|
270
|
+
...e
|
|
271
|
+
}) => /* @__PURE__ */ o(Z, { align: t, ...e });
|
|
272
|
+
vt.displayName = "PromptInputHoverCardContent";
|
|
273
|
+
const Tt = p(({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
ref: n,
|
|
277
|
+
"data-slot": "prompt-input-tabs-list",
|
|
278
|
+
className: r(t),
|
|
279
|
+
...e
|
|
280
|
+
}
|
|
281
|
+
));
|
|
282
|
+
Tt.displayName = "PromptInputTabsList";
|
|
283
|
+
const St = p(
|
|
284
|
+
({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
ref: n,
|
|
288
|
+
"data-slot": "prompt-input-tab",
|
|
289
|
+
className: r(t),
|
|
290
|
+
...e
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
);
|
|
294
|
+
St.displayName = "PromptInputTab";
|
|
295
|
+
const Mt = p(({ className: t, children: e, ...n }, a) => /* @__PURE__ */ o(
|
|
296
|
+
"h3",
|
|
297
|
+
{
|
|
298
|
+
ref: a,
|
|
299
|
+
"data-slot": "prompt-input-tab-label",
|
|
300
|
+
className: r(
|
|
301
|
+
"mb-2 px-3 font-medium text-muted-foreground text-xs",
|
|
302
|
+
t
|
|
303
|
+
),
|
|
304
|
+
...n,
|
|
305
|
+
children: e
|
|
306
|
+
}
|
|
307
|
+
));
|
|
308
|
+
Mt.displayName = "PromptInputTabLabel";
|
|
309
|
+
const wt = p(({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
ref: n,
|
|
313
|
+
"data-slot": "prompt-input-tab-body",
|
|
314
|
+
className: r("space-y-1", t),
|
|
315
|
+
...e
|
|
316
|
+
}
|
|
317
|
+
));
|
|
318
|
+
wt.displayName = "PromptInputTabBody";
|
|
319
|
+
const Ht = p(({ className: t, ...e }, n) => /* @__PURE__ */ o(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
ref: n,
|
|
323
|
+
"data-slot": "prompt-input-tab-item",
|
|
324
|
+
className: r(
|
|
325
|
+
"flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent",
|
|
326
|
+
t
|
|
327
|
+
),
|
|
328
|
+
...e
|
|
329
|
+
}
|
|
330
|
+
));
|
|
331
|
+
Ht.displayName = "PromptInputTabItem";
|
|
332
|
+
const At = ({
|
|
333
|
+
className: t,
|
|
334
|
+
...e
|
|
335
|
+
}) => /* @__PURE__ */ o(F, { className: r(t), ...e });
|
|
336
|
+
At.displayName = "PromptInputCommand";
|
|
337
|
+
const Et = ({
|
|
338
|
+
className: t,
|
|
339
|
+
...e
|
|
340
|
+
}) => /* @__PURE__ */ o(j, { className: r(t), ...e });
|
|
341
|
+
Et.displayName = "PromptInputCommandInput";
|
|
342
|
+
const Dt = ({
|
|
343
|
+
className: t,
|
|
344
|
+
...e
|
|
345
|
+
}) => /* @__PURE__ */ o(K, { className: r(t), ...e });
|
|
346
|
+
Dt.displayName = "PromptInputCommandList";
|
|
347
|
+
const zt = ({
|
|
348
|
+
className: t,
|
|
349
|
+
...e
|
|
350
|
+
}) => /* @__PURE__ */ o(V, { className: r(t), ...e });
|
|
351
|
+
zt.displayName = "PromptInputCommandEmpty";
|
|
352
|
+
const Bt = ({
|
|
353
|
+
className: t,
|
|
354
|
+
...e
|
|
355
|
+
}) => /* @__PURE__ */ o(q, { className: r(t), ...e });
|
|
356
|
+
Bt.displayName = "PromptInputCommandGroup";
|
|
357
|
+
const Lt = ({
|
|
358
|
+
className: t,
|
|
359
|
+
...e
|
|
360
|
+
}) => /* @__PURE__ */ o(R, { className: r(t), ...e });
|
|
361
|
+
Lt.displayName = "PromptInputCommandItem";
|
|
362
|
+
const kt = ({
|
|
363
|
+
className: t,
|
|
364
|
+
...e
|
|
365
|
+
}) => /* @__PURE__ */ o(O, { className: r(t), ...e });
|
|
366
|
+
kt.displayName = "PromptInputCommandSeparator";
|
|
367
|
+
export {
|
|
368
|
+
pt as PromptInput,
|
|
369
|
+
ct as PromptInputActionMenu,
|
|
370
|
+
It as PromptInputActionMenuContent,
|
|
371
|
+
Pt as PromptInputActionMenuItem,
|
|
372
|
+
dt as PromptInputActionMenuTrigger,
|
|
373
|
+
st as PromptInputBody,
|
|
374
|
+
T as PromptInputButton,
|
|
375
|
+
At as PromptInputCommand,
|
|
376
|
+
zt as PromptInputCommandEmpty,
|
|
377
|
+
Bt as PromptInputCommandGroup,
|
|
378
|
+
Et as PromptInputCommandInput,
|
|
379
|
+
Lt as PromptInputCommandItem,
|
|
380
|
+
Dt as PromptInputCommandList,
|
|
381
|
+
kt as PromptInputCommandSeparator,
|
|
382
|
+
ut as PromptInputFooter,
|
|
383
|
+
lt as PromptInputHeader,
|
|
384
|
+
xt as PromptInputHoverCard,
|
|
385
|
+
vt as PromptInputHoverCardContent,
|
|
386
|
+
ht as PromptInputHoverCardTrigger,
|
|
387
|
+
Nt as PromptInputModelSelect,
|
|
388
|
+
ft as PromptInputModelSelectContent,
|
|
389
|
+
Ct as PromptInputModelSelectItem,
|
|
390
|
+
gt as PromptInputModelSelectTrigger,
|
|
391
|
+
bt as PromptInputModelSelectValue,
|
|
392
|
+
at as PromptInputProvider,
|
|
393
|
+
yt as PromptInputSubmit,
|
|
394
|
+
St as PromptInputTab,
|
|
395
|
+
wt as PromptInputTabBody,
|
|
396
|
+
Ht as PromptInputTabItem,
|
|
397
|
+
Mt as PromptInputTabLabel,
|
|
398
|
+
Tt as PromptInputTabsList,
|
|
399
|
+
mt as PromptInputTextarea,
|
|
400
|
+
it as PromptInputTools,
|
|
401
|
+
Jt as usePromptInputController
|
|
402
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
name: "PromptInput",
|
|
3
|
+
status: "in-progress-code-review",
|
|
4
|
+
description: "A comprehensive AI chat input component with support for model selection, command palettes, and rich formatting.",
|
|
5
|
+
llmUsage: "Use `<PromptInputProvider>` to wrap the input, then compose with `<PromptInput>`, `<PromptInputTextarea>`, `<PromptInputSubmit>`, and other sub-components."
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
t as PromptInputMetadata
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
declare const Reasoning: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
type ReasoningHeaderProps = ComponentProps<'div'> & {
|
|
4
|
+
title?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const ReasoningHeader: import('react').ForwardRefExoticComponent<Omit<ReasoningHeaderProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const ReasoningContent: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const ReasoningItem: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { Reasoning, ReasoningContent, ReasoningHeader, ReasoningItem };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as g, forwardRef as s, useContext as c } from "react";
|
|
3
|
+
import { IconBrain as m } from "@tabler/icons-react";
|
|
4
|
+
import { cn as i } from "../../../../lib/utils.js";
|
|
5
|
+
const l = g(!0), p = () => c(l), b = s(
|
|
6
|
+
({ className: t, children: e, ...o }, a) => /* @__PURE__ */ n(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
ref: a,
|
|
10
|
+
"data-slot": "reasoning",
|
|
11
|
+
className: i("relative flex w-full flex-col gap-2 not-prose", t),
|
|
12
|
+
...o,
|
|
13
|
+
children: e
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
b.displayName = "Reasoning";
|
|
18
|
+
const u = s(
|
|
19
|
+
({ className: t, title: e = "Reasoning", children: o, ...a }, r) => /* @__PURE__ */ d(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref: r,
|
|
23
|
+
"data-slot": "reasoning-header",
|
|
24
|
+
className: i(
|
|
25
|
+
"flex items-center gap-2 text-base leading-5 tracking-tighter text-muted-foreground",
|
|
26
|
+
t
|
|
27
|
+
),
|
|
28
|
+
...a,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ n(m, { className: "size-4 shrink-0" }),
|
|
31
|
+
o ?? /* @__PURE__ */ n("span", { children: e })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
u.displayName = "ReasoningHeader";
|
|
37
|
+
const x = s(
|
|
38
|
+
({ className: t, children: e, ...o }, a) => {
|
|
39
|
+
const r = Array.isArray(e) && e.filter(Boolean).length > 1;
|
|
40
|
+
return /* @__PURE__ */ n(l.Provider, { value: r, children: /* @__PURE__ */ n(f, { ref: a, className: t, ...o, children: e }) });
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
x.displayName = "ReasoningContent";
|
|
44
|
+
const f = s(({ className: t, children: e, ...o }, a) => /* @__PURE__ */ n(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
ref: a,
|
|
48
|
+
"data-slot": "reasoning-content-inner",
|
|
49
|
+
className: i("relative flex flex-col gap-0 pl-4", t),
|
|
50
|
+
...o,
|
|
51
|
+
children: e
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
f.displayName = "ReasoningContentInner";
|
|
55
|
+
const R = s(
|
|
56
|
+
({ className: t, children: e, ...o }, a) => {
|
|
57
|
+
const r = p();
|
|
58
|
+
return /* @__PURE__ */ n(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref: a,
|
|
62
|
+
"data-slot": "reasoning-item",
|
|
63
|
+
className: i(
|
|
64
|
+
"relative",
|
|
65
|
+
r && [
|
|
66
|
+
"before:absolute before:-left-2.75 before:top-4 before:z-10 before:size-1.75 before:rounded-full before:bg-border",
|
|
67
|
+
"after:absolute after:-left-2 after:top-0 after:bottom-0 after:w-px after:bg-border",
|
|
68
|
+
"first:after:top-4",
|
|
69
|
+
"last:after:bottom-auto last:after:h-4"
|
|
70
|
+
],
|
|
71
|
+
t
|
|
72
|
+
),
|
|
73
|
+
...o,
|
|
74
|
+
children: e
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
R.displayName = "ReasoningItem";
|
|
80
|
+
export {
|
|
81
|
+
b as Reasoning,
|
|
82
|
+
x as ReasoningContent,
|
|
83
|
+
u as ReasoningHeader,
|
|
84
|
+
R as ReasoningItem
|
|
85
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
3
|
+
type SelectPropsBase = Omit<SelectPrimitive.Root.Props<string>, 'open' | 'defaultOpen' | 'onOpenChange' | 'value' | 'defaultValue' | 'onValueChange' | 'multiple'> & {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
type SelectPropsSingle = SelectPropsBase & {
|
|
9
|
+
multiple?: false;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
};
|
|
14
|
+
type SelectPropsMultiple = SelectPropsBase & {
|
|
15
|
+
multiple: true;
|
|
16
|
+
value?: string[];
|
|
17
|
+
defaultValue?: string[];
|
|
18
|
+
onValueChange?: (value: string[]) => void;
|
|
19
|
+
};
|
|
20
|
+
declare function Select(props: SelectPropsSingle): ReactNode;
|
|
21
|
+
declare function Select(props: SelectPropsMultiple): ReactNode;
|
|
22
|
+
declare function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function SelectValue({ icon, ...props }: SelectPrimitive.Value.Props & {
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function SelectTrigger({ className, size, children, errorMessage, ...props }: SelectPrimitive.Trigger.Props & {
|
|
27
|
+
size?: 'sm' | 'default';
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function SelectContent({ className, children, position: _position, align, alignOffset, side, sideOffset, ...props }: SelectPrimitive.Popup.Props & {
|
|
31
|
+
position?: 'popper' | 'item-aligned';
|
|
32
|
+
align?: SelectPrimitive.Positioner.Props['align'];
|
|
33
|
+
alignOffset?: SelectPrimitive.Positioner.Props['alignOffset'];
|
|
34
|
+
side?: SelectPrimitive.Positioner.Props['side'];
|
|
35
|
+
sideOffset?: SelectPrimitive.Positioner.Props['sideOffset'];
|
|
36
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function SelectLabel({ className, ...props }: SelectPrimitive.GroupLabel.Props): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function SelectItem({ className, children, icon, ...props }: SelectPrimitive.Item.Props & {
|
|
39
|
+
icon?: ReactNode;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function SelectSeparator({ className, ...props }: SelectPrimitive.Separator.Props): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function SelectScrollUpButton({ className, ...props }: SelectPrimitive.ScrollUpArrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function SelectScrollDownButton({ className, ...props }: SelectPrimitive.ScrollDownArrow.Props): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|