@cognite/aura 0.1.5 → 0.1.6
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/colors.css +824 -0
- package/dist/components/index.d.ts +9 -2
- package/dist/components/index.js +279 -249
- package/dist/components/ui/core/accordion/accordion.d.ts +24 -0
- package/dist/components/ui/core/accordion/accordion.js +113 -0
- package/dist/components/ui/core/accordion/accordion.metadata.d.ts +2 -0
- package/dist/components/ui/core/accordion/accordion.metadata.js +9 -0
- package/dist/components/ui/core/alert/alert.js +65 -65
- package/dist/components/ui/core/avatar/avatar.js +29 -32
- package/dist/components/ui/core/badge/badge.d.ts +1 -1
- package/dist/components/ui/core/badge/badge.js +44 -52
- package/dist/components/ui/core/banner/banner.d.ts +40 -0
- package/dist/components/ui/core/banner/banner.js +218 -0
- package/dist/components/ui/core/banner/banner.metadata.d.ts +2 -0
- package/dist/components/ui/core/banner/banner.metadata.js +9 -0
- package/dist/components/ui/core/button/button.d.ts +2 -2
- package/dist/components/ui/core/button/button.js +19 -20
- package/dist/components/ui/core/button-group/button-group.js +10 -10
- package/dist/components/ui/core/card/card.js +1 -1
- package/dist/components/ui/core/code-block/code-block.d.ts +10 -3
- package/dist/components/ui/core/code-block/code-block.js +147 -94
- package/dist/components/ui/core/code-block/code-block.metadata.js +1 -1
- package/dist/components/ui/core/collapsible/collapsible.js +30 -24
- package/dist/components/ui/core/command/command.d.ts +2 -2
- package/dist/components/ui/core/command/command.js +30 -30
- package/dist/components/ui/core/dialog/dialog.js +8 -8
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +35 -35
- package/dist/components/ui/core/helper-text/helper-text.js +8 -8
- package/dist/components/ui/core/hover-card/hover-card.js +5 -5
- package/dist/components/ui/core/inline-citation/inline-citation.js +19 -16
- package/dist/components/ui/core/input/input.d.ts +1 -5
- package/dist/components/ui/core/input/input.js +24 -30
- package/dist/components/ui/core/input-group/input-group.d.ts +2 -2
- package/dist/components/ui/core/input-group/input-group.js +104 -74
- package/dist/components/ui/core/label/label.d.ts +3 -1
- package/dist/components/ui/core/label/label.js +39 -16
- package/dist/components/ui/core/label/label.metadata.js +2 -2
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +11 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +13 -0
- package/dist/components/ui/core/message/message.d.ts +1 -1
- package/dist/components/ui/core/message/message.js +62 -44
- package/dist/components/ui/core/popover/popover.d.ts +10 -1
- package/dist/components/ui/core/popover/popover.js +137 -34
- package/dist/components/ui/core/popover/popover.metadata.js +9 -0
- package/dist/components/ui/core/progress/progress.d.ts +10 -0
- package/dist/components/ui/core/progress/progress.js +61 -0
- package/dist/components/ui/core/progress/progress.metadata.d.ts +2 -0
- package/dist/components/ui/core/progress/progress.metadata.js +9 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +2 -2
- package/dist/components/ui/core/prompt-input/prompt-input.js +100 -100
- package/dist/components/ui/core/select/select.d.ts +3 -3
- package/dist/components/ui/core/select/select.js +69 -73
- package/dist/components/ui/core/skeleton/skeleton.js +6 -6
- package/dist/components/ui/core/sources/sources.js +8 -1
- package/dist/components/ui/core/textarea/textarea.d.ts +1 -8
- package/dist/components/ui/core/textarea/textarea.js +21 -45
- package/dist/components/ui/core/tool/tool.js +38 -34
- package/dist/components/ui/core/tooltip/tooltip.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +276 -249
- package/dist/lib/utils.d.ts +6 -6
- package/dist/lib/utils.js +26 -26
- package/dist/styles.css +1 -1
- package/dist/styles.source.css +3 -812
- package/package.json +21 -7
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as N,
|
|
1
|
+
import { jsxs as u, Fragment as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as N, forwardRef as y, useId as z, useContext as I, useMemo as V } from "react";
|
|
3
3
|
import { Select as o } from "@base-ui/react/select";
|
|
4
|
-
import {
|
|
4
|
+
import { IconChevronDown as h, IconExclamationCircle as k, IconCheck as _, IconChevronUp as O } from "@tabler/icons-react";
|
|
5
5
|
import { usePortalContainer as P } from "../../../../lib/portal-container-context.js";
|
|
6
6
|
import { useControllableState as j } from "../../../../lib/use-controllable-state.js";
|
|
7
|
-
import { cn as
|
|
8
|
-
const g = N(null),
|
|
7
|
+
import { cn as r, disabledState as T, invalidState as D, focusState as B, filledState as E, hoverState as G, formElementBase as L } from "../../../../lib/utils.js";
|
|
8
|
+
const g = N(null), R = () => {
|
|
9
9
|
const e = I(g);
|
|
10
10
|
if (!e)
|
|
11
11
|
throw new Error("Select components must be used within Select");
|
|
12
12
|
return e;
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function Y(e) {
|
|
15
15
|
const [a, l] = j({
|
|
16
16
|
prop: e.open,
|
|
17
17
|
defaultProp: e.defaultOpen ?? !1,
|
|
18
18
|
onChange: e.onOpenChange
|
|
19
|
-
}), n =
|
|
19
|
+
}), n = V(() => ({ isOpen: a ?? !1 }), [a]);
|
|
20
20
|
if (e.multiple) {
|
|
21
21
|
const {
|
|
22
|
-
multiple:
|
|
22
|
+
multiple: p,
|
|
23
23
|
value: v,
|
|
24
24
|
defaultValue: b,
|
|
25
25
|
onValueChange: S,
|
|
@@ -33,7 +33,7 @@ function Q(e) {
|
|
|
33
33
|
onOpenChange: (f) => l(f),
|
|
34
34
|
value: v,
|
|
35
35
|
defaultValue: b,
|
|
36
|
-
onValueChange: (f,
|
|
36
|
+
onValueChange: (f, W) => {
|
|
37
37
|
S?.(f ?? []);
|
|
38
38
|
},
|
|
39
39
|
multiple: !0,
|
|
@@ -41,33 +41,33 @@ function Q(e) {
|
|
|
41
41
|
}
|
|
42
42
|
) });
|
|
43
43
|
}
|
|
44
|
-
const { value:
|
|
44
|
+
const { value: s, defaultValue: i, onValueChange: m, ...c } = e, d = s === void 0 ? void 0 : s === "" ? null : s, x = i === void 0 ? void 0 : i === "" ? null : i;
|
|
45
45
|
return /* @__PURE__ */ t(g.Provider, { value: n, children: /* @__PURE__ */ t(
|
|
46
46
|
o.Root,
|
|
47
47
|
{
|
|
48
48
|
"data-slot": "select",
|
|
49
49
|
open: a,
|
|
50
|
-
onOpenChange: (
|
|
51
|
-
value:
|
|
50
|
+
onOpenChange: (p) => l(p),
|
|
51
|
+
value: d,
|
|
52
52
|
defaultValue: x,
|
|
53
|
-
onValueChange: (
|
|
54
|
-
|
|
53
|
+
onValueChange: (p, v) => {
|
|
54
|
+
m?.(typeof p == "string" ? p : "");
|
|
55
55
|
},
|
|
56
|
-
...
|
|
56
|
+
...c
|
|
57
57
|
}
|
|
58
58
|
) });
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Z({ className: e, ...a }) {
|
|
61
61
|
return /* @__PURE__ */ t(
|
|
62
62
|
o.Group,
|
|
63
63
|
{
|
|
64
64
|
"data-slot": "select-group",
|
|
65
|
-
className:
|
|
65
|
+
className: r("scroll-my-1 p-1", e),
|
|
66
66
|
...a
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function M({
|
|
71
71
|
icon: e,
|
|
72
72
|
...a
|
|
73
73
|
}) {
|
|
@@ -76,36 +76,31 @@ function Y({
|
|
|
76
76
|
/* @__PURE__ */ t(o.Value, { "data-slot": "select-value", ...a })
|
|
77
77
|
] }) : /* @__PURE__ */ t(o.Value, { "data-slot": "select-value", ...a });
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
size: a = "default",
|
|
82
|
-
children: l,
|
|
83
|
-
errorMessage: n,
|
|
84
|
-
...r
|
|
85
|
-
}) {
|
|
86
|
-
const { isOpen: i } = L(), c = !!n, d = z();
|
|
79
|
+
const U = y(({ className: e, size: a = "default", children: l, errorMessage: n, ...s }, i) => {
|
|
80
|
+
const { isOpen: m } = R(), c = !!n, d = z();
|
|
87
81
|
return /* @__PURE__ */ u(C, { children: [
|
|
88
82
|
/* @__PURE__ */ u(
|
|
89
83
|
o.Trigger,
|
|
90
84
|
{
|
|
85
|
+
ref: i,
|
|
91
86
|
"data-slot": "select-trigger",
|
|
92
87
|
"data-size": a,
|
|
93
88
|
"aria-invalid": c ? !0 : void 0,
|
|
94
89
|
"aria-describedby": c ? d : void 0,
|
|
95
|
-
className:
|
|
90
|
+
className: r(
|
|
96
91
|
"w-fit min-w-50 min-h-9 flex items-center justify-between gap-2 whitespace-nowrap transition-[color,box-shadow] cursor-pointer",
|
|
92
|
+
L,
|
|
97
93
|
G,
|
|
98
94
|
E,
|
|
99
95
|
B,
|
|
100
|
-
T,
|
|
101
96
|
D,
|
|
102
|
-
|
|
103
|
-
"dark:bg-
|
|
97
|
+
T,
|
|
98
|
+
"dark:bg-muted-background/30 dark:text-muted-foreground dark:hover:bg-accent-background",
|
|
104
99
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
105
100
|
"*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2",
|
|
106
101
|
e
|
|
107
102
|
),
|
|
108
|
-
...
|
|
103
|
+
...s,
|
|
109
104
|
children: [
|
|
110
105
|
l,
|
|
111
106
|
/* @__PURE__ */ t(
|
|
@@ -114,9 +109,9 @@ function Z({
|
|
|
114
109
|
render: /* @__PURE__ */ t(
|
|
115
110
|
h,
|
|
116
111
|
{
|
|
117
|
-
className:
|
|
112
|
+
className: r(
|
|
118
113
|
"size-4 opacity-50 transition-transform",
|
|
119
|
-
|
|
114
|
+
m ? "rotate-180" : "rotate-0"
|
|
120
115
|
)
|
|
121
116
|
}
|
|
122
117
|
)
|
|
@@ -131,55 +126,56 @@ function Z({
|
|
|
131
126
|
id: d,
|
|
132
127
|
className: "flex flex-row gap-1 justify-start items-center p-1",
|
|
133
128
|
children: [
|
|
134
|
-
/* @__PURE__ */ t(
|
|
129
|
+
/* @__PURE__ */ t(k, { className: "text-destructive-foreground text-sm size-4" }),
|
|
135
130
|
/* @__PURE__ */ t("span", { className: "text-destructive-foreground text-sm", children: n })
|
|
136
131
|
]
|
|
137
132
|
}
|
|
138
133
|
)
|
|
139
134
|
] });
|
|
140
|
-
}
|
|
141
|
-
|
|
135
|
+
});
|
|
136
|
+
U.displayName = "SelectTrigger";
|
|
137
|
+
function ee({
|
|
142
138
|
className: e,
|
|
143
139
|
children: a,
|
|
144
140
|
position: l = "popper",
|
|
145
141
|
align: n = "start",
|
|
146
|
-
alignOffset:
|
|
142
|
+
alignOffset: s = 0,
|
|
147
143
|
side: i = "bottom",
|
|
148
|
-
sideOffset:
|
|
149
|
-
...
|
|
144
|
+
sideOffset: m = 4,
|
|
145
|
+
...c
|
|
150
146
|
}) {
|
|
151
|
-
const
|
|
152
|
-
return /* @__PURE__ */ t(o.Portal, { container:
|
|
147
|
+
const d = P();
|
|
148
|
+
return /* @__PURE__ */ t(o.Portal, { container: d, children: /* @__PURE__ */ t(
|
|
153
149
|
o.Positioner,
|
|
154
150
|
{
|
|
155
151
|
alignItemWithTrigger: !1,
|
|
156
152
|
align: n,
|
|
157
|
-
alignOffset:
|
|
153
|
+
alignOffset: s,
|
|
158
154
|
side: i,
|
|
159
|
-
sideOffset:
|
|
155
|
+
sideOffset: m,
|
|
160
156
|
collisionPadding: 10,
|
|
161
157
|
className: "isolate z-50",
|
|
162
158
|
children: /* @__PURE__ */ u(
|
|
163
159
|
o.Popup,
|
|
164
160
|
{
|
|
165
161
|
"data-slot": "select-content",
|
|
166
|
-
className:
|
|
167
|
-
"bg-popover text-
|
|
162
|
+
className: r(
|
|
163
|
+
"bg-popover-background text-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md outline-none",
|
|
168
164
|
l === "popper" && "data-[side=bottom]:translate-y-1",
|
|
169
165
|
e
|
|
170
166
|
),
|
|
171
|
-
...
|
|
167
|
+
...c,
|
|
172
168
|
children: [
|
|
173
|
-
/* @__PURE__ */ t(
|
|
169
|
+
/* @__PURE__ */ t(A, {}),
|
|
174
170
|
/* @__PURE__ */ t(o.List, { children: a }),
|
|
175
|
-
/* @__PURE__ */ t(
|
|
171
|
+
/* @__PURE__ */ t(F, {})
|
|
176
172
|
]
|
|
177
173
|
}
|
|
178
174
|
)
|
|
179
175
|
}
|
|
180
176
|
) });
|
|
181
177
|
}
|
|
182
|
-
function
|
|
178
|
+
function te({
|
|
183
179
|
className: e,
|
|
184
180
|
...a
|
|
185
181
|
}) {
|
|
@@ -187,12 +183,12 @@ function ee({
|
|
|
187
183
|
o.GroupLabel,
|
|
188
184
|
{
|
|
189
185
|
"data-slot": "select-label",
|
|
190
|
-
className:
|
|
186
|
+
className: r("text-muted-foreground px-2 py-1.5 text-xs", e),
|
|
191
187
|
...a
|
|
192
188
|
}
|
|
193
189
|
);
|
|
194
190
|
}
|
|
195
|
-
function
|
|
191
|
+
function ae({
|
|
196
192
|
className: e,
|
|
197
193
|
children: a,
|
|
198
194
|
icon: l,
|
|
@@ -202,8 +198,8 @@ function te({
|
|
|
202
198
|
o.Item,
|
|
203
199
|
{
|
|
204
200
|
"data-slot": "select-item",
|
|
205
|
-
className:
|
|
206
|
-
"relative flex w-full min-h-9 cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-base leading-5 tracking-tightest outline-hidden select-none focus:bg-accent focus:text-
|
|
201
|
+
className: r(
|
|
202
|
+
"relative flex w-full min-h-9 cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-base leading-5 tracking-tightest outline-hidden select-none focus:bg-accent-background focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
207
203
|
e
|
|
208
204
|
),
|
|
209
205
|
...n,
|
|
@@ -211,7 +207,7 @@ function te({
|
|
|
211
207
|
/* @__PURE__ */ t(
|
|
212
208
|
o.ItemIndicator,
|
|
213
209
|
{
|
|
214
|
-
render: /* @__PURE__ */ t("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(
|
|
210
|
+
render: /* @__PURE__ */ t("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(_, { className: "size-4 text-foreground" }) })
|
|
215
211
|
}
|
|
216
212
|
),
|
|
217
213
|
l && /* @__PURE__ */ t("span", { className: "flex items-center gap-2 mr-1", children: l }),
|
|
@@ -220,7 +216,7 @@ function te({
|
|
|
220
216
|
}
|
|
221
217
|
);
|
|
222
218
|
}
|
|
223
|
-
function
|
|
219
|
+
function oe({
|
|
224
220
|
className: e,
|
|
225
221
|
...a
|
|
226
222
|
}) {
|
|
@@ -228,12 +224,12 @@ function ae({
|
|
|
228
224
|
o.Separator,
|
|
229
225
|
{
|
|
230
226
|
"data-slot": "select-separator",
|
|
231
|
-
className:
|
|
227
|
+
className: r("bg-border pointer-events-none -mx-1 my-1 h-px", e),
|
|
232
228
|
...a
|
|
233
229
|
}
|
|
234
230
|
);
|
|
235
231
|
}
|
|
236
|
-
function
|
|
232
|
+
function A({
|
|
237
233
|
className: e,
|
|
238
234
|
...a
|
|
239
235
|
}) {
|
|
@@ -241,16 +237,16 @@ function U({
|
|
|
241
237
|
o.ScrollUpArrow,
|
|
242
238
|
{
|
|
243
239
|
"data-slot": "select-scroll-up-button",
|
|
244
|
-
className:
|
|
245
|
-
"bg-popover z-10 flex cursor-default items-center justify-center py-1 top-0 w-full",
|
|
240
|
+
className: r(
|
|
241
|
+
"bg-popover-background z-10 flex cursor-default items-center justify-center py-1 top-0 w-full",
|
|
246
242
|
e
|
|
247
243
|
),
|
|
248
244
|
...a,
|
|
249
|
-
children: /* @__PURE__ */ t(
|
|
245
|
+
children: /* @__PURE__ */ t(O, { className: "size-4" })
|
|
250
246
|
}
|
|
251
247
|
);
|
|
252
248
|
}
|
|
253
|
-
function
|
|
249
|
+
function F({
|
|
254
250
|
className: e,
|
|
255
251
|
...a
|
|
256
252
|
}) {
|
|
@@ -258,8 +254,8 @@ function A({
|
|
|
258
254
|
o.ScrollDownArrow,
|
|
259
255
|
{
|
|
260
256
|
"data-slot": "select-scroll-down-button",
|
|
261
|
-
className:
|
|
262
|
-
"bg-popover z-10 flex cursor-default items-center justify-center py-1 bottom-0 w-full",
|
|
257
|
+
className: r(
|
|
258
|
+
"bg-popover-background z-10 flex cursor-default items-center justify-center py-1 bottom-0 w-full",
|
|
263
259
|
e
|
|
264
260
|
),
|
|
265
261
|
...a,
|
|
@@ -268,14 +264,14 @@ function A({
|
|
|
268
264
|
);
|
|
269
265
|
}
|
|
270
266
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
267
|
+
Y as Select,
|
|
268
|
+
ee as SelectContent,
|
|
269
|
+
Z as SelectGroup,
|
|
270
|
+
ae as SelectItem,
|
|
271
|
+
te as SelectLabel,
|
|
272
|
+
F as SelectScrollDownButton,
|
|
273
|
+
A as SelectScrollUpButton,
|
|
274
|
+
oe as SelectSeparator,
|
|
275
|
+
U as SelectTrigger,
|
|
276
|
+
M as SelectValue
|
|
281
277
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
const n =
|
|
5
|
-
({ className:
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { cn as m } from "../../../../lib/utils.js";
|
|
4
|
+
const n = r(
|
|
5
|
+
({ className: o, ...e }, t) => /* @__PURE__ */ a(
|
|
6
6
|
"div",
|
|
7
7
|
{
|
|
8
8
|
ref: t,
|
|
9
9
|
"data-slot": "skeleton",
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
10
|
+
className: m("bg-accent-background animate-pulse rounded-md", o),
|
|
11
|
+
...e
|
|
12
12
|
}
|
|
13
13
|
)
|
|
14
14
|
);
|
|
@@ -12,7 +12,14 @@ const S = ({ className: r, title: e, children: t, ...o }) => {
|
|
|
12
12
|
...o,
|
|
13
13
|
children: [
|
|
14
14
|
n ? null : i,
|
|
15
|
-
/* @__PURE__ */ s(
|
|
15
|
+
/* @__PURE__ */ s(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
"data-slot": "sources-items",
|
|
19
|
+
className: "flex flex-wrap gap-2 [&>*]:min-w-0",
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
)
|
|
16
23
|
]
|
|
17
24
|
}
|
|
18
25
|
);
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
interface TextareaProps extends ComponentProps<'textarea'> {
|
|
3
|
-
maxChars?: number;
|
|
4
|
-
errorMessage?: string;
|
|
5
|
-
overLimitMessage?: string;
|
|
6
|
-
charactersLeftMessage?: (remaining: number) => string;
|
|
7
|
-
}
|
|
8
|
-
declare const Textarea: import('react').ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
1
|
+
declare const Textarea: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
9
2
|
export { Textarea };
|
|
@@ -1,49 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as r } from "react";
|
|
3
|
+
import { cn as i, disabledState as l, invalidState as n, focusState as s, filledState as d, hoverState as f, formElementBase as m } from "../../../../lib/utils.js";
|
|
4
|
+
const c = r(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
5
|
+
"textarea",
|
|
6
|
+
{
|
|
7
|
+
ref: a,
|
|
8
|
+
"data-slot": "textarea",
|
|
9
|
+
className: i(
|
|
10
|
+
"flex field-sizing-content min-h-20 w-full transition-[color,background-color,border-color,box-shadow] resize-none",
|
|
11
|
+
m,
|
|
12
|
+
f,
|
|
13
|
+
d,
|
|
14
|
+
s,
|
|
15
|
+
n,
|
|
16
|
+
l,
|
|
17
|
+
e
|
|
18
|
+
),
|
|
12
19
|
...t
|
|
13
|
-
}, f) => {
|
|
14
|
-
const i = t.value !== void 0, [h, g] = b(() => {
|
|
15
|
-
const n = t.defaultValue ?? "";
|
|
16
|
-
return String(n).length;
|
|
17
|
-
}), d = i ? String(t.value ?? "").length : h, r = e !== void 0 && d > e, m = !!o || r, v = (n) => {
|
|
18
|
-
i || g(n.target.value.length), t.onChange && t.onChange(n);
|
|
19
|
-
};
|
|
20
|
-
return /* @__PURE__ */ x(C, { children: [
|
|
21
|
-
/* @__PURE__ */ l(
|
|
22
|
-
"textarea",
|
|
23
|
-
{
|
|
24
|
-
ref: f,
|
|
25
|
-
"data-slot": "textarea",
|
|
26
|
-
"aria-invalid": m ? !0 : void 0,
|
|
27
|
-
className: T(
|
|
28
|
-
"flex field-sizing-content min-h-16 w-full placeholder:text-muted-foreground transition-[color,background-color,border-color,box-shadow]",
|
|
29
|
-
L,
|
|
30
|
-
y,
|
|
31
|
-
k,
|
|
32
|
-
j,
|
|
33
|
-
E,
|
|
34
|
-
w,
|
|
35
|
-
"dark:bg-input/30",
|
|
36
|
-
a
|
|
37
|
-
),
|
|
38
|
-
onChange: v,
|
|
39
|
-
...t
|
|
40
|
-
}
|
|
41
|
-
),
|
|
42
|
-
o ? /* @__PURE__ */ l(c, { isError: !0, children: o }) : e !== void 0 && /* @__PURE__ */ l(c, { isError: r, children: r ? s : u(e - d) })
|
|
43
|
-
] });
|
|
44
20
|
}
|
|
45
|
-
);
|
|
46
|
-
|
|
21
|
+
));
|
|
22
|
+
c.displayName = "Textarea";
|
|
47
23
|
export {
|
|
48
|
-
|
|
24
|
+
c as Textarea
|
|
49
25
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { IconSelector as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Badge as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { CodeBlock as c, CodeBlockCopyButton as m,
|
|
8
|
-
import { Collapsible as
|
|
9
|
-
const
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { IconSelector as p } from "@tabler/icons-react";
|
|
4
|
+
import { cn as s } from "../../../../lib/utils.js";
|
|
5
|
+
import { Badge as g } from "../badge/badge.js";
|
|
6
|
+
import { Button as x } from "../button/button.js";
|
|
7
|
+
import { CodeBlock as c, CodeBlockCopyButton as m, CodeBlockDownloadButton as u, CodeBlockCollapseButton as f } from "../code-block/code-block.js";
|
|
8
|
+
import { Collapsible as N, CollapsibleTrigger as h, CollapsibleContent as b } from "../collapsible/collapsible.js";
|
|
9
|
+
const y = d(
|
|
10
10
|
({ className: t, ...o }, l) => /* @__PURE__ */ e(
|
|
11
|
-
|
|
11
|
+
N,
|
|
12
12
|
{
|
|
13
13
|
ref: l,
|
|
14
14
|
"data-slot": "tool",
|
|
15
|
-
className:
|
|
15
|
+
className: s(
|
|
16
16
|
"group not-prose w-full bg-background rounded-md flex flex-col gap-2",
|
|
17
17
|
t
|
|
18
18
|
),
|
|
@@ -20,15 +20,15 @@ const b = s(
|
|
|
20
20
|
}
|
|
21
21
|
)
|
|
22
22
|
);
|
|
23
|
-
|
|
24
|
-
const
|
|
23
|
+
y.displayName = "Tool";
|
|
24
|
+
const v = d(({ className: t, title: o, type: l, hasError: r = !1, ...i }, n) => /* @__PURE__ */ e(
|
|
25
25
|
h,
|
|
26
26
|
{
|
|
27
27
|
ref: n,
|
|
28
28
|
"data-slot": "tool-header",
|
|
29
29
|
className: t,
|
|
30
30
|
render: /* @__PURE__ */ a(
|
|
31
|
-
|
|
31
|
+
x,
|
|
32
32
|
{
|
|
33
33
|
variant: "ghost",
|
|
34
34
|
className: "w-full justify-between text-base leading-5 tracking-tighter",
|
|
@@ -36,14 +36,14 @@ const y = s(({ className: t, title: o, type: l, hasError: r = !1, ...i }, n) =>
|
|
|
36
36
|
/* @__PURE__ */ e("span", { children: o ?? l.substring(l.indexOf("-") + 1) }),
|
|
37
37
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
38
38
|
r ? /* @__PURE__ */ e(
|
|
39
|
-
|
|
39
|
+
g,
|
|
40
40
|
{
|
|
41
41
|
outline: !0,
|
|
42
42
|
className: "bg-background text-destructive-foreground border-border",
|
|
43
43
|
children: "Error"
|
|
44
44
|
}
|
|
45
45
|
) : null,
|
|
46
|
-
/* @__PURE__ */ e(
|
|
46
|
+
/* @__PURE__ */ e(p, { className: "h-4 w-4" })
|
|
47
47
|
] })
|
|
48
48
|
]
|
|
49
49
|
}
|
|
@@ -51,27 +51,27 @@ const y = s(({ className: t, title: o, type: l, hasError: r = !1, ...i }, n) =>
|
|
|
51
51
|
...i
|
|
52
52
|
}
|
|
53
53
|
));
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
v.displayName = "ToolHeader";
|
|
55
|
+
const j = d(({ className: t, ...o }, l) => /* @__PURE__ */ e(
|
|
56
|
+
b,
|
|
57
57
|
{
|
|
58
58
|
ref: l,
|
|
59
59
|
"data-slot": "tool-content",
|
|
60
|
-
className:
|
|
61
|
-
"
|
|
60
|
+
className: s(
|
|
61
|
+
"flex flex-col gap-4 py-3 text-popover-foreground outline-none",
|
|
62
62
|
t
|
|
63
63
|
),
|
|
64
64
|
...o
|
|
65
65
|
}
|
|
66
66
|
));
|
|
67
|
-
|
|
68
|
-
const C =
|
|
67
|
+
j.displayName = "ToolContent";
|
|
68
|
+
const C = d(
|
|
69
69
|
({ className: t, input: o, ...l }, r) => /* @__PURE__ */ a(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
ref: r,
|
|
73
73
|
"data-slot": "tool-input",
|
|
74
|
-
className:
|
|
74
|
+
className: s("space-y-2 overflow-hidden px-3.25", t),
|
|
75
75
|
...l,
|
|
76
76
|
children: [
|
|
77
77
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium uppercase tracking-wide text-muted-foreground", children: "Parameters" }),
|
|
@@ -83,7 +83,8 @@ const C = s(
|
|
|
83
83
|
collapsed: !0,
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ e(m, {}),
|
|
86
|
-
/* @__PURE__ */ e(u, {})
|
|
86
|
+
/* @__PURE__ */ e(u, { fileName: "tool-parameters.json" }),
|
|
87
|
+
/* @__PURE__ */ e(f, {})
|
|
87
88
|
]
|
|
88
89
|
}
|
|
89
90
|
) })
|
|
@@ -92,14 +93,15 @@ const C = s(
|
|
|
92
93
|
)
|
|
93
94
|
);
|
|
94
95
|
C.displayName = "ToolInput";
|
|
95
|
-
const w =
|
|
96
|
+
const w = d(
|
|
96
97
|
({ className: t, output: o, errorText: l, ...r }, i) => {
|
|
97
98
|
if (o == null && !l)
|
|
98
99
|
return null;
|
|
99
100
|
let n = null;
|
|
100
101
|
return typeof o == "string" ? n = /* @__PURE__ */ a(c, { code: o, language: "json", collapsed: !0, children: [
|
|
101
102
|
/* @__PURE__ */ e(m, {}),
|
|
102
|
-
/* @__PURE__ */ e(u, {})
|
|
103
|
+
/* @__PURE__ */ e(u, { fileName: "tool-result.json" }),
|
|
104
|
+
/* @__PURE__ */ e(f, {})
|
|
103
105
|
] }) : o == null ? n = null : typeof o == "object" ? n = /* @__PURE__ */ a(
|
|
104
106
|
c,
|
|
105
107
|
{
|
|
@@ -108,18 +110,20 @@ const w = s(
|
|
|
108
110
|
collapsed: !0,
|
|
109
111
|
children: [
|
|
110
112
|
/* @__PURE__ */ e(m, {}),
|
|
111
|
-
/* @__PURE__ */ e(u, {})
|
|
113
|
+
/* @__PURE__ */ e(u, { fileName: "tool-result.json" }),
|
|
114
|
+
/* @__PURE__ */ e(f, {})
|
|
112
115
|
]
|
|
113
116
|
}
|
|
114
117
|
) : (typeof o == "number" || typeof o == "boolean" || typeof o == "bigint") && (n = /* @__PURE__ */ a(c, { code: String(o), language: "json", collapsed: !0, children: [
|
|
115
118
|
/* @__PURE__ */ e(m, {}),
|
|
116
|
-
/* @__PURE__ */ e(u, {})
|
|
119
|
+
/* @__PURE__ */ e(u, { fileName: "tool-result.json" }),
|
|
120
|
+
/* @__PURE__ */ e(f, {})
|
|
117
121
|
] })), l ? /* @__PURE__ */ e(
|
|
118
122
|
"div",
|
|
119
123
|
{
|
|
120
124
|
ref: i,
|
|
121
125
|
"data-slot": "tool-output",
|
|
122
|
-
className:
|
|
126
|
+
className: s("space-y-2 px-3.25", t),
|
|
123
127
|
...r,
|
|
124
128
|
children: /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 text-sm", children: [
|
|
125
129
|
/* @__PURE__ */ e("span", { className: "font-medium text-destructive-foreground", children: "ERROR" }),
|
|
@@ -131,11 +135,11 @@ const w = s(
|
|
|
131
135
|
{
|
|
132
136
|
ref: i,
|
|
133
137
|
"data-slot": "tool-output",
|
|
134
|
-
className:
|
|
138
|
+
className: s("space-y-2 px-3.25", t),
|
|
135
139
|
...r,
|
|
136
140
|
children: [
|
|
137
141
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium uppercase tracking-wide text-muted-foreground", children: "Result" }),
|
|
138
|
-
/* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md bg-muted/50 text-xs text-foreground [&_table]:w-full", children: n })
|
|
142
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md bg-muted-background/50 text-xs text-foreground [&_table]:w-full", children: n })
|
|
139
143
|
]
|
|
140
144
|
}
|
|
141
145
|
);
|
|
@@ -143,9 +147,9 @@ const w = s(
|
|
|
143
147
|
);
|
|
144
148
|
w.displayName = "ToolOutput";
|
|
145
149
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
150
|
+
y as Tool,
|
|
151
|
+
j as ToolContent,
|
|
152
|
+
v as ToolHeader,
|
|
149
153
|
C as ToolInput,
|
|
150
154
|
w as ToolOutput
|
|
151
155
|
};
|