@mechane-ai/elements 0.7.1 → 0.9.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/README.md +73 -36
- package/dist/ai.js +231 -170
- package/dist/assets/stylex.css +464 -166
- package/dist/{categorical-values-75J0TUkR.js → categorical-values-DYRiw5Qd.js} +2 -2
- package/dist/{chart-frame--DOsZKwP.js → chart-frame-RL1hCWBC.js} +2 -1
- package/dist/{chart-input-C-g586YE.js → chart-input-Bm3ot1yD.js} +2 -2
- package/dist/charts/cartesian.js +6 -5
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +2 -2
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +1 -1
- package/dist/charts.js +1 -1
- package/dist/{code-block-D0Jmsj7w.js → code-block-B30xQKqg.js} +1 -1
- package/dist/collections.js +369 -244
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +2 -2
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +4 -4
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-HLYu0cmz.js → content-link-BrPrpBof.js} +1 -1
- package/dist/content.js +35 -35
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +7 -7
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +144 -91
- package/dist/navigation/commands.js +1 -1
- package/dist/packages/ai/src/conversation.d.ts +2 -1
- package/dist/packages/ai/src/index.d.ts +4 -0
- package/dist/packages/ai/src/message-action.d.ts +10 -0
- package/dist/packages/ai/src/message-boundary.d.ts +6 -0
- package/dist/packages/ai/src/message.d.ts +2 -1
- package/dist/packages/charts/src/chart-theme.d.ts +1 -0
- package/dist/packages/collections/src/data-table.d.ts +9 -1
- package/dist/packages/collections/src/index.d.ts +4 -2
- package/dist/packages/collections/src/metrics.d.ts +5 -2
- package/dist/packages/collections/src/timeline.d.ts +26 -0
- package/dist/packages/core/src/actions.d.ts +7 -0
- package/dist/packages/core/src/agent-avatar-glyphs.d.ts +5 -0
- package/dist/packages/core/src/agent-avatar.d.ts +17 -0
- package/dist/packages/core/src/copy-value.d.ts +2 -1
- package/dist/packages/core/src/index.d.ts +5 -1
- package/dist/packages/forms/src/agent-avatar-picker.d.ts +8 -0
- package/dist/packages/forms/src/field-styles.d.ts +19 -0
- package/dist/packages/forms/src/forms.d.ts +2 -1
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/foundations/src/tokens.stylex.d.ts +52 -0
- package/dist/packages/layout/src/app-shell.d.ts +2 -1
- package/dist/packages/layout/src/index.d.ts +2 -1
- package/dist/packages/layout/src/page-toolbar.d.ts +3 -1
- package/dist/packages/layout/src/sidebar.d.ts +4 -0
- package/dist/packages/layout/src/view-stack.d.ts +13 -0
- package/dist/packages/layout/src/workbench.d.ts +5 -2
- package/dist/{pierre-tree-DVybsnm4.js → pierre-tree-CRk09rx7.js} +2 -2
- package/dist/{src-DjTM64tN.js → src-Cc0Sadzr.js} +378 -295
- package/dist/{src-B_DCatpY.js → src-DuuAmS-c.js} +1 -1
- package/dist/src-elMBQ2Dh.js +1087 -0
- package/dist/theme.js +1 -1
- package/dist/tokens.js +61 -10
- package/package.json +1 -1
- package/packages/foundations/src/tokens.stylex.ts +54 -0
- package/dist/src-BkCsvZGi.js +0 -675
package/dist/ai.js
CHANGED
|
@@ -1,112 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { C as e, S as t, T as n, f as r, h as i, p as a, t as o, w as s } from "./src-elMBQ2Dh.js";
|
|
2
|
+
import { t as c } from "./content-link-BrPrpBof.js";
|
|
3
|
+
import { r as l, t as u } from "./src-CfDf8TY8.js";
|
|
4
|
+
import { c as d, u as f } from "./src-Cc0Sadzr.js";
|
|
5
|
+
import { t as p } from "./accessibility-C-aIZ1Yx.js";
|
|
6
|
+
import * as m from "@stylexjs/stylex";
|
|
7
|
+
import { createContext as h, useContext as g, useId as _, useRef as v } from "react";
|
|
8
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
import { ArrowDown as x, ArrowUp as S, ExternalLink as C, File as w, GitBranch as T, Square as E } from "lucide-react";
|
|
10
|
+
import { MessageScroller as D, useMessageScroller as O, useMessageScrollerScrollable as k } from "@shadcn/react/message-scroller";
|
|
10
11
|
// packages/ai/src/approval.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
function A(e) {
|
|
13
|
+
return /* @__PURE__ */ b("section", {
|
|
13
14
|
"aria-label": e.title,
|
|
14
15
|
"data-request-id": e.requestId,
|
|
15
16
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt",
|
|
16
17
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ y("h3", {
|
|
18
19
|
className: "x1ghz6dp xtqrqnz x1778rvt xk50ysn xj0a0fe",
|
|
19
20
|
children: e.title
|
|
20
21
|
}),
|
|
21
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
22
|
+
e.description !== void 0 && /* @__PURE__ */ y("p", {
|
|
22
23
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
23
24
|
children: e.description
|
|
24
25
|
}),
|
|
25
26
|
e.children,
|
|
26
|
-
e.status === "pending" ? /* @__PURE__ */
|
|
27
|
+
e.status === "pending" ? /* @__PURE__ */ b(r, { children: [/* @__PURE__ */ y(t, {
|
|
27
28
|
variant: "solid",
|
|
28
29
|
onClick: e.onApprove,
|
|
29
30
|
disabled: e.disabled === !0 || e.busy !== void 0,
|
|
30
31
|
pending: e.busy === "approve",
|
|
31
32
|
pendingLabel: "Approving…",
|
|
32
33
|
children: e.approveLabel ?? "Approve"
|
|
33
|
-
}), /* @__PURE__ */
|
|
34
|
+
}), /* @__PURE__ */ y(t, {
|
|
34
35
|
onClick: e.onDeny,
|
|
35
36
|
disabled: e.disabled === !0 || e.busy !== void 0,
|
|
36
37
|
pending: e.busy === "deny",
|
|
37
38
|
pendingLabel: "Denying…",
|
|
38
39
|
children: e.denyLabel ?? "Deny"
|
|
39
|
-
})] }) : /* @__PURE__ */
|
|
40
|
+
})] }) : /* @__PURE__ */ y(o, { children: e.statusLabel })
|
|
40
41
|
]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
// packages/ai/src/conversation.tsx
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
47
|
-
return /* @__PURE__ */
|
|
45
|
+
var j = h(void 0);
|
|
46
|
+
function M({ children: e, initialPosition: t = "end", follow: n = !0 }) {
|
|
47
|
+
let r = v(null);
|
|
48
|
+
return /* @__PURE__ */ y(j.Provider, {
|
|
48
49
|
value: r,
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ y(D.Provider, {
|
|
50
51
|
autoScroll: n,
|
|
51
52
|
defaultScrollPosition: t,
|
|
52
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ y(D.Root, {
|
|
53
54
|
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt",
|
|
54
55
|
children: e
|
|
55
56
|
})
|
|
56
57
|
})
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
let
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
ref:
|
|
60
|
+
function N({ label: e, children: t, scrollRestorationId: n }) {
|
|
61
|
+
let r = g(j);
|
|
62
|
+
return /* @__PURE__ */ y(D.Viewport, {
|
|
63
|
+
ref: r,
|
|
63
64
|
"aria-label": e,
|
|
65
|
+
"data-scroll-restoration-id": n,
|
|
64
66
|
className: "x98rzlu x2lwn1j xeuugli x1odjw0f x1046ku7 x185mbhu x1ok0vyi x13qnu6 x9v5kkp x19rmrnh x1bqaal",
|
|
65
67
|
children: t
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
|
-
function
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
+
function P({ children: e, streaming: t = !1 }) {
|
|
71
|
+
return /* @__PURE__ */ y(D.Content, {
|
|
70
72
|
"aria-live": "polite",
|
|
71
73
|
"aria-relevant": "additions",
|
|
72
74
|
"aria-busy": t,
|
|
73
|
-
className: "x78zum5 xdt5ytf x1j825kq
|
|
75
|
+
className: "x9f619 x78zum5 xdt5ytf x1j825kq xi2fr2z x1m92p3w xvueqy4 xh8yej3 xe10afn xeuugli",
|
|
74
76
|
children: e
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
function F({ messageId: e, children: t }) {
|
|
80
|
+
return /* @__PURE__ */ y(D.Item, {
|
|
79
81
|
messageId: e,
|
|
80
82
|
className: "xeuugli xj0a0fe",
|
|
81
83
|
children: t
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
|
-
function
|
|
85
|
-
let { scrollToEnd:
|
|
86
|
-
return
|
|
86
|
+
function I({ label: e = "Jump to latest" }) {
|
|
87
|
+
let { scrollToEnd: n } = O(), { end: r } = k(), i = g(j);
|
|
88
|
+
return r ? /* @__PURE__ */ y("div", {
|
|
87
89
|
className: "x10l6tqk xwthv0x x1nrll8i xuuh30",
|
|
88
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ b(t, {
|
|
89
91
|
onClick: () => {
|
|
90
|
-
|
|
92
|
+
n({ behavior: "instant" }), i?.current?.focus({ preventScroll: !0 });
|
|
91
93
|
},
|
|
92
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ y(x, {
|
|
93
95
|
size: 16,
|
|
94
96
|
"aria-hidden": !0
|
|
95
97
|
}), e]
|
|
96
98
|
})
|
|
97
99
|
}) : null;
|
|
98
100
|
}
|
|
99
|
-
var
|
|
100
|
-
Root:
|
|
101
|
-
Viewport:
|
|
102
|
-
Content:
|
|
103
|
-
Item:
|
|
104
|
-
JumpToLatest:
|
|
105
|
-
},
|
|
101
|
+
var L = {
|
|
102
|
+
Root: M,
|
|
103
|
+
Viewport: N,
|
|
104
|
+
Content: P,
|
|
105
|
+
Item: F,
|
|
106
|
+
JumpToLatest: I
|
|
107
|
+
}, R = {
|
|
106
108
|
root: {
|
|
107
109
|
k1xSpc: "x78zum5",
|
|
108
110
|
kXwgrk: "xdt5ytf",
|
|
109
|
-
kOIVth: "
|
|
111
|
+
kOIVth: "x1hnptsi",
|
|
110
112
|
k7Eaqz: "xeuugli",
|
|
111
113
|
kMwMTN: "xbixft",
|
|
112
114
|
kMv6JI: "x1hz01jw",
|
|
@@ -115,10 +117,8 @@ var j = {
|
|
|
115
117
|
$$css: !0
|
|
116
118
|
},
|
|
117
119
|
user: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ksu8eU: "x1y0btm7",
|
|
121
|
-
kVAM5u: "x1ey3b81",
|
|
120
|
+
k8WAf4: "x1qokhjc",
|
|
121
|
+
kg3NbH: "x1m92p3w",
|
|
122
122
|
kaIpWk: "x1ok0vyi",
|
|
123
123
|
kWkggS: "x1r7kqkb",
|
|
124
124
|
$$css: !0
|
|
@@ -129,57 +129,67 @@ var j = {
|
|
|
129
129
|
k8WAf4: "xn9t2bk",
|
|
130
130
|
$$css: !0
|
|
131
131
|
}
|
|
132
|
-
},
|
|
133
|
-
user:
|
|
134
|
-
assistant:
|
|
135
|
-
system:
|
|
132
|
+
}, z = {
|
|
133
|
+
user: R.user,
|
|
134
|
+
assistant: R.assistant,
|
|
135
|
+
system: R.system
|
|
136
|
+
}, B = {
|
|
137
|
+
"x-default-marker": "x-default-marker",
|
|
138
|
+
$$css: !0
|
|
136
139
|
};
|
|
137
|
-
function
|
|
138
|
-
return /* @__PURE__ */
|
|
140
|
+
function V({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s }) {
|
|
141
|
+
return /* @__PURE__ */ b("article", {
|
|
139
142
|
id: n,
|
|
140
143
|
"aria-label": e,
|
|
141
|
-
...
|
|
144
|
+
...m.props(R.root, z[r], B),
|
|
142
145
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
className: "x78zum5
|
|
145
|
-
children: [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
/* @__PURE__ */ b("header", {
|
|
147
|
+
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
148
|
+
children: [
|
|
149
|
+
a !== void 0 && /* @__PURE__ */ y("span", {
|
|
150
|
+
className: "x3nfvp2 x2lah0s",
|
|
151
|
+
children: a
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ y("span", {
|
|
154
|
+
className: "xk50ysn xj0a0fe",
|
|
155
|
+
children: e
|
|
156
|
+
}),
|
|
157
|
+
i !== void 0 && /* @__PURE__ */ y("div", {
|
|
158
|
+
className: "x153jb6y xy8obcc xas2l8k",
|
|
159
|
+
children: i
|
|
160
|
+
})
|
|
161
|
+
]
|
|
152
162
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ y("div", {
|
|
154
164
|
className: "xeuugli xj0a0fe",
|
|
155
165
|
children: t
|
|
156
166
|
}),
|
|
157
|
-
|
|
167
|
+
s !== void 0 && /* @__PURE__ */ y("div", {
|
|
158
168
|
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi",
|
|
159
|
-
children:
|
|
169
|
+
children: s
|
|
160
170
|
}),
|
|
161
|
-
|
|
162
|
-
className: "x78zum5 x1a02dak x6s0dn4
|
|
163
|
-
children:
|
|
171
|
+
o !== void 0 && /* @__PURE__ */ y("footer", {
|
|
172
|
+
className: "x78zum5 x1a02dak x6s0dn4 xunmzkg x1hc1fzr x1ac4sdd xea5s0o xbfgl4k",
|
|
173
|
+
children: o
|
|
164
174
|
})
|
|
165
175
|
]
|
|
166
176
|
});
|
|
167
177
|
}
|
|
168
|
-
function
|
|
169
|
-
return /* @__PURE__ */
|
|
178
|
+
function H({ name: e, description: t, href: n, actions: r }) {
|
|
179
|
+
return /* @__PURE__ */ b("div", {
|
|
170
180
|
className: "x78zum5 x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt",
|
|
171
181
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ y(w, {
|
|
173
183
|
size: 16,
|
|
174
184
|
"aria-hidden": !0,
|
|
175
185
|
className: "x153jb6y x2lah0s"
|
|
176
186
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ b("div", {
|
|
178
188
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
179
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
189
|
+
children: [n === void 0 ? /* @__PURE__ */ y("span", { children: e }) : /* @__PURE__ */ y(c, {
|
|
180
190
|
href: n,
|
|
181
191
|
children: e
|
|
182
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
192
|
+
}), t !== void 0 && /* @__PURE__ */ y("span", {
|
|
183
193
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
184
194
|
children: t
|
|
185
195
|
})]
|
|
@@ -188,109 +198,160 @@ function F({ name: e, description: t, href: n, actions: r }) {
|
|
|
188
198
|
]
|
|
189
199
|
});
|
|
190
200
|
}
|
|
201
|
+
// packages/ai/src/message-action.tsx
|
|
202
|
+
function U(t) {
|
|
203
|
+
if (t.kind === "link") {
|
|
204
|
+
let { kind: e, label: n, ...r } = t;
|
|
205
|
+
return /* @__PURE__ */ y(s, {
|
|
206
|
+
...r,
|
|
207
|
+
"aria-label": n
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
let { kind: n, label: r, ...i } = t;
|
|
211
|
+
return /* @__PURE__ */ y(e, {
|
|
212
|
+
...i,
|
|
213
|
+
variant: "ghost",
|
|
214
|
+
"aria-label": r
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function W(e) {
|
|
218
|
+
return /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: U(e) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: e.label }) }) })] });
|
|
219
|
+
}
|
|
220
|
+
// packages/ai/src/message-boundary.tsx
|
|
221
|
+
function G({ label: e, children: t }) {
|
|
222
|
+
return /* @__PURE__ */ b(i.Root, {
|
|
223
|
+
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
224
|
+
children: [/* @__PURE__ */ b(i.Trigger, {
|
|
225
|
+
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xo1l8bm",
|
|
226
|
+
children: [/* @__PURE__ */ y(T, {
|
|
227
|
+
size: 14,
|
|
228
|
+
"aria-hidden": !0,
|
|
229
|
+
className: "x2lah0s"
|
|
230
|
+
}), /* @__PURE__ */ y("span", {
|
|
231
|
+
className: "xeuugli xj0a0fe",
|
|
232
|
+
children: e
|
|
233
|
+
})]
|
|
234
|
+
}), /* @__PURE__ */ y(i.Panel, {
|
|
235
|
+
className: "x153jb6y xy8obcc xas2l8k",
|
|
236
|
+
children: t
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
191
240
|
// packages/ai/src/prompt-input.tsx
|
|
192
|
-
var
|
|
241
|
+
var K = { action: {
|
|
193
242
|
keTefX: "xvc5jky",
|
|
194
243
|
$$css: !0
|
|
195
244
|
} };
|
|
196
|
-
function
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
|
|
245
|
+
function q({ label: t, value: n, onValueChange: r, onSubmit: i, name: a = "prompt", placeholder: o, maxLength: s, required: c = !0, pending: l = !1, disabled: h = !1, submitDisabled: g = !1, submitLabel: v = "Send message", pendingLabel: x = "Sending…", enterBehavior: C = "newline", compact: w = !1, description: T, error: D, controls: O, attachments: k, onStop: A, stopPending: j = !1, stopLabel: M = "Stop response" }) {
|
|
246
|
+
let N = _(), P = h || l, F = v;
|
|
247
|
+
A === void 0 ? l ? F = x : C === "submit" && (F = `${v} · Enter`) : F = j ? "Stopping…" : M;
|
|
248
|
+
function I(e) {
|
|
249
|
+
if (C !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
200
250
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
201
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !
|
|
251
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !g && A === void 0 && e.currentTarget.form?.requestSubmit());
|
|
202
252
|
}
|
|
203
|
-
function
|
|
204
|
-
e.preventDefault(), !
|
|
253
|
+
function L(e) {
|
|
254
|
+
e.preventDefault(), !P && !g && A === void 0 && i(e);
|
|
205
255
|
}
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
onSubmit:
|
|
208
|
-
className: "x78zum5 xdt5ytf
|
|
209
|
-
children:
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
256
|
+
return /* @__PURE__ */ y("form", {
|
|
257
|
+
onSubmit: L,
|
|
258
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4",
|
|
259
|
+
children: /* @__PURE__ */ b(d.Root, {
|
|
260
|
+
invalid: D !== void 0,
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ y(d.Label, {
|
|
263
|
+
...m.props(p.hidden),
|
|
264
|
+
children: t
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ b("div", {
|
|
267
|
+
...{
|
|
268
|
+
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
269
|
+
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" }
|
|
270
|
+
}[D !== void 0 | 0],
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ y(f, {
|
|
273
|
+
appearance: "plain",
|
|
274
|
+
rows: w ? 1 : 2,
|
|
275
|
+
compact: w,
|
|
276
|
+
name: a,
|
|
277
|
+
value: n,
|
|
278
|
+
onChange: (e) => r(e.currentTarget.value),
|
|
279
|
+
onKeyDown: I,
|
|
280
|
+
placeholder: o ?? t,
|
|
281
|
+
maxLength: s,
|
|
282
|
+
required: c,
|
|
283
|
+
disabled: h,
|
|
284
|
+
readOnly: l,
|
|
285
|
+
"aria-errormessage": D === void 0 ? void 0 : N
|
|
286
|
+
}),
|
|
287
|
+
k,
|
|
288
|
+
/* @__PURE__ */ b("div", {
|
|
289
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
290
|
+
children: [O !== void 0 && /* @__PURE__ */ y("div", {
|
|
291
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
292
|
+
children: O
|
|
293
|
+
}), /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: A === void 0 ? /* @__PURE__ */ y(e, {
|
|
294
|
+
xstyle: K.action,
|
|
295
|
+
type: "submit",
|
|
296
|
+
variant: "solid",
|
|
297
|
+
"aria-label": l ? x : v,
|
|
298
|
+
disabled: h || g,
|
|
299
|
+
pending: l,
|
|
300
|
+
children: /* @__PURE__ */ y(S, {
|
|
301
|
+
size: 16,
|
|
302
|
+
"aria-hidden": !0
|
|
303
|
+
})
|
|
304
|
+
}) : /* @__PURE__ */ y(e, {
|
|
305
|
+
xstyle: K.action,
|
|
306
|
+
type: "button",
|
|
307
|
+
"aria-label": j ? "Stopping…" : M,
|
|
308
|
+
onClick: (e) => {
|
|
309
|
+
e.preventDefault(), A();
|
|
310
|
+
},
|
|
311
|
+
disabled: h,
|
|
312
|
+
pending: j,
|
|
313
|
+
children: /* @__PURE__ */ y(E, {
|
|
314
|
+
size: 14,
|
|
315
|
+
"aria-hidden": !0
|
|
316
|
+
})
|
|
317
|
+
}) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: F }) }) })] })]
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}),
|
|
321
|
+
T !== void 0 && /* @__PURE__ */ y(d.Description, { children: T }),
|
|
322
|
+
D !== void 0 && /* @__PURE__ */ y(d.Error, {
|
|
323
|
+
id: N,
|
|
324
|
+
match: !0,
|
|
325
|
+
role: "alert",
|
|
326
|
+
children: D
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
})
|
|
269
330
|
});
|
|
270
331
|
}
|
|
271
332
|
// packages/ai/src/sources.tsx
|
|
272
|
-
function
|
|
273
|
-
return /* @__PURE__ */
|
|
333
|
+
function J({ sources: e, label: t = "Sources" }) {
|
|
334
|
+
return /* @__PURE__ */ b("section", {
|
|
274
335
|
"aria-label": t,
|
|
275
336
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xbixft",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ y("h3", {
|
|
277
338
|
className: "x1ghz6dp xtqrqnz x1778rvt xk50ysn",
|
|
278
339
|
children: t
|
|
279
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ y("ol", {
|
|
280
341
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
281
|
-
children: e.map((e) => /* @__PURE__ */
|
|
342
|
+
children: e.map((e) => /* @__PURE__ */ b("li", {
|
|
282
343
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ b("span", {
|
|
284
345
|
className: "x3nfvp2 x1pha0wt xunmzkg x1a02dak",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ y(c, {
|
|
286
347
|
href: e.href,
|
|
287
348
|
children: e.title
|
|
288
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ y(C, {
|
|
289
350
|
size: 12,
|
|
290
351
|
"aria-hidden": !0,
|
|
291
352
|
className: "x2lah0s x153jb6y"
|
|
292
353
|
})]
|
|
293
|
-
}), e.description !== void 0 && /* @__PURE__ */
|
|
354
|
+
}), e.description !== void 0 && /* @__PURE__ */ y("p", {
|
|
294
355
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
295
356
|
children: e.description
|
|
296
357
|
})]
|
|
@@ -298,22 +359,22 @@ function R({ sources: e, label: t = "Sources" }) {
|
|
|
298
359
|
})]
|
|
299
360
|
});
|
|
300
361
|
}
|
|
301
|
-
function
|
|
302
|
-
return /* @__PURE__ */
|
|
362
|
+
function Y({ source: e, label: t }) {
|
|
363
|
+
return /* @__PURE__ */ y("span", {
|
|
303
364
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
304
|
-
children: /* @__PURE__ */
|
|
305
|
-
render: /* @__PURE__ */
|
|
306
|
-
"aria-label": `Source ${
|
|
307
|
-
children:
|
|
308
|
-
}), /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ b(l.Root, { children: [/* @__PURE__ */ y(l.Trigger, {
|
|
366
|
+
render: /* @__PURE__ */ y(n, {}),
|
|
367
|
+
"aria-label": `Source ${t}: ${e.title}`,
|
|
368
|
+
children: t
|
|
369
|
+
}), /* @__PURE__ */ y(l.Portal, { children: /* @__PURE__ */ y(l.Positioner, {
|
|
309
370
|
side: "top",
|
|
310
|
-
children: /* @__PURE__ */
|
|
371
|
+
children: /* @__PURE__ */ y(l.Popup, { children: /* @__PURE__ */ b(a, {
|
|
311
372
|
compact: !0,
|
|
312
373
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
href:
|
|
374
|
+
/* @__PURE__ */ y(l.Title, { children: e.title }),
|
|
375
|
+
e.description !== void 0 && /* @__PURE__ */ y(l.Description, { children: e.description }),
|
|
376
|
+
/* @__PURE__ */ y(c, {
|
|
377
|
+
href: e.href,
|
|
317
378
|
children: "Open source"
|
|
318
379
|
})
|
|
319
380
|
]
|
|
@@ -321,4 +382,4 @@ function z({ source: t, label: r }) {
|
|
|
321
382
|
}) })] })
|
|
322
383
|
});
|
|
323
384
|
}
|
|
324
|
-
export {
|
|
385
|
+
export { A as Approval, L as Conversation, Y as InlineCitation, V as Message, W as MessageAction, H as MessageAttachment, G as MessageBoundary, q as PromptInput, J as Sources };
|