@mechane-ai/elements 0.11.0 → 0.13.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 +23 -4
- package/dist/ai.js +167 -141
- package/dist/{categorical-values-FYc43JCa.js → categorical-values-DwobbjBq.js} +2 -2
- package/dist/{chart-frame-Bczk5sWj.js → chart-frame-DAxsgMyl.js} +4 -4
- package/dist/{chart-input-CbzVN76m.js → chart-input-B0snxbMH.js} +2 -2
- package/dist/charts/cartesian.js +6 -6
- package/dist/charts/distribution.js +2 -2
- package/dist/charts/graph.js +3 -3
- package/dist/charts/hierarchy.js +3 -3
- package/dist/charts/matrix.js +2 -2
- package/dist/charts/timeline.js +4 -4
- package/dist/charts.js +1 -1
- package/dist/{code-block-B7xzM3tD.js → code-block-VwrOHz5j.js} +2 -2
- package/dist/collections.js +402 -267
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-CatGOrbo.js → content-link-Oj-MtNYi.js} +1 -1
- package/dist/content.js +3 -4
- package/dist/elements.css +141 -96
- package/dist/feedback.js +1 -1
- package/dist/forms/dates.js +22 -23
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +223 -237
- package/dist/navigation/commands.js +3 -3
- package/dist/navigation.js +26 -12
- package/dist/overlays.js +1 -1
- package/dist/packages/ai/src/index.d.ts +2 -2
- package/dist/packages/ai/src/prompt-input.d.ts +4 -0
- package/dist/packages/collections/src/collection-controls.d.ts +1 -1
- package/dist/packages/collections/src/data-table.d.ts +24 -6
- package/dist/packages/collections/src/index.d.ts +2 -2
- package/dist/packages/core/src/actions.d.ts +5 -8
- package/dist/packages/feedback/src/async-region.d.ts +15 -9
- package/dist/packages/feedback/src/control-placeholders.d.ts +21 -0
- package/dist/packages/feedback/src/index.d.ts +4 -3
- package/dist/packages/forms/src/field-styles.d.ts +2 -74
- package/dist/packages/forms/src/form-actions.d.ts +11 -0
- package/dist/packages/forms/src/form-controls.d.ts +1 -1
- package/dist/packages/forms/src/forms.d.ts +3 -3
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/select.d.ts +2 -2
- package/dist/packages/forms/src/selection-styles.d.ts +0 -13
- package/dist/packages/foundations/src/control-styles.d.ts +122 -0
- package/dist/packages/foundations/src/style-composition.d.ts +0 -2
- package/dist/packages/foundations/src/tokens.stylex.d.ts +13 -2
- package/dist/packages/layout/src/frame.stylex.d.ts +0 -1
- package/dist/packages/layout/src/index.d.ts +2 -0
- package/dist/packages/layout/src/page-content.d.ts +5 -0
- package/dist/packages/layout/src/page-toolbar.d.ts +1 -1
- package/dist/packages/layout/src/sidebar.d.ts +3 -3
- package/dist/packages/navigation/src/index.d.ts +2 -2
- package/dist/packages/navigation/src/page-navigation.d.ts +5 -0
- package/dist/{pierre-diff--zsiHCCB.js → pierre-diff-sUAU-xeL.js} +1 -1
- package/dist/{pierre-theme-D9hnHv3Z.js → pierre-theme-CBAncKdH.js} +1 -1
- package/dist/{pierre-tree-D47uA7lb.js → pierre-tree-Db1yaDM2.js} +3 -3
- package/dist/src-B0UTwpOz.js +1003 -0
- package/dist/{src-D05isEh_.js → src-BNlyCwOr.js} +141 -69
- package/dist/{src-Cs0dRc4X.js → src-CVlgjAlw.js} +1 -1
- package/dist/src-DMsnWyru.js +1184 -0
- package/dist/tokens.js +18 -8
- package/package.json +1 -1
- package/packages/foundations/src/tokens.stylex.ts +15 -5
- package/dist/packages/feedback/src/loading.d.ts +0 -7
- package/dist/src-C_heP5kL.js +0 -1264
- package/dist/src-DXsGTJgv.js +0 -969
package/README.md
CHANGED
|
@@ -104,8 +104,10 @@ which view is active and when to unmount it; use this for a draft or reading pos
|
|
|
104
104
|
`WorkbenchScroll` requires an accessible `label`; its `flush` mode leaves list insets to the table. Its
|
|
105
105
|
`scrollRestorationId` identifies the actual scroll region for application-owned restoration.
|
|
106
106
|
|
|
107
|
-
`DataTable`
|
|
108
|
-
|
|
107
|
+
Each `DataTable` column declares a role: `primary`, `text`, `status`, `number`, `timestamp`, or `actions`. Roles own
|
|
108
|
+
alignment and minimum sizing; the primary column uses available space. Headers and placeholders follow the same
|
|
109
|
+
geometry. The table uses 48px rows by default and truncates text to preserve stable column and virtualization geometry.
|
|
110
|
+
Set `rowSizing="content"` for records that need multiline cells; virtualization then measures those rows. Long content
|
|
109
111
|
belongs in a detail view or a deliberately content-sized row, not behind a clipped control. Use `DataTableText` for a
|
|
110
112
|
primary string and optional secondary string inside one cell; both text elements own their ellipsis. Arbitrary nested
|
|
111
113
|
layouts do not inherit text truncation. Give dates and numeric values sufficient column width or explicit content
|
|
@@ -125,8 +127,10 @@ acknowledgement, and draft retention.
|
|
|
125
127
|
record and store named choices rather than catalog indexes. Identity palettes remain separate from status colors.
|
|
126
128
|
|
|
127
129
|
`MetricGrid layout="columns"` distributes supplied metrics by available container width. Its inline layout suits compact
|
|
128
|
-
record summaries. `
|
|
129
|
-
|
|
130
|
+
record summaries. `PageContent` owns report insets and section gaps; keep full-width tables outside it so their cell
|
|
131
|
+
insets remain the only gutter. `SettingsSection` keeps wide tables inside their scroll region, and `SettingsRow` aligns
|
|
132
|
+
labels and controls. `FormActions` owns submission rows and their internal spacing. The enclosing section owns the gap
|
|
133
|
+
before and after the actions.
|
|
130
134
|
|
|
131
135
|
The default theme is light, with system fonts and a compact spacing scale. Import `themeProps` from
|
|
132
136
|
`@mechane-ai/elements/theme` and spread `themeProps.light` or `themeProps.dark` onto the document root. Portaled content
|
|
@@ -150,6 +154,21 @@ structural styles in the published stylesheet, so the production package injects
|
|
|
150
154
|
initial-read failures and field validation local; retained-content refresh failures can use one notification with Retry.
|
|
151
155
|
The application owns stable notification IDs and dismissal on recovery or navigation.
|
|
152
156
|
|
|
157
|
+
## Loading content
|
|
158
|
+
|
|
159
|
+
Use `AsyncRegion` from `/feedback` with an explicit `pending`, `ready`, or `failed` state and a destination-specific
|
|
160
|
+
`placeholder`. Pending reserves that geometry immediately and reveals it after two seconds. Ready content enters in
|
|
161
|
+
80ms; ready-at-mount and failed content appear immediately. Reduced motion removes the fades. There is no minimum
|
|
162
|
+
loading duration, and ordinary callers do not configure timing.
|
|
163
|
+
|
|
164
|
+
Wrap a page in `LoadingScope` and pass its navigation `identity` to share one clock across dependent reads. Updating the
|
|
165
|
+
identity resets pending presentation without remounting ready children. Keep refreshes in the ready state and retain
|
|
166
|
+
their content, focus, and drafts; display progress or failure alongside the last result.
|
|
167
|
+
|
|
168
|
+
Build placeholders from the same layouts as their destinations. `DataTablePlaceholder` accepts the real table's
|
|
169
|
+
`DataTableColumnLayout` definitions and optional decorative cells. The async region owns the loading announcement; its
|
|
170
|
+
placeholders must not contain interactive controls, invented records, or independent status announcements.
|
|
171
|
+
|
|
153
172
|
## Develop and release
|
|
154
173
|
|
|
155
174
|
From `workspaces/core`:
|
package/dist/ai.js
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { C as e, E as t,
|
|
2
|
-
import { t as
|
|
3
|
-
import { r as
|
|
4
|
-
import { c as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { C as e, E as t, O as n, T as r, f as i, g as a, p as o, t as s, w as c } from "./src-BNlyCwOr.js";
|
|
2
|
+
import { t as l } from "./content-link-Oj-MtNYi.js";
|
|
3
|
+
import { r as u, t as d } from "./src-CVlgjAlw.js";
|
|
4
|
+
import { c as f, d as p } from "./src-B0UTwpOz.js";
|
|
5
|
+
import { c as m, u as h } from "./src-DMsnWyru.js";
|
|
6
|
+
import { t as g } from "./accessibility-C-aIZ1Yx.js";
|
|
7
|
+
import * as _ from "@stylexjs/stylex";
|
|
8
|
+
import { createContext as v, useContext as y, useId as b, useRef as x } from "react";
|
|
9
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
10
|
+
import { ArrowDown as w, ArrowUp as T, File as E, GitBranch as D, Square as O } from "lucide-react";
|
|
11
|
+
import { MessageScroller as k, useMessageScroller as A, useMessageScrollerScrollable as j } from "@shadcn/react/message-scroller";
|
|
11
12
|
// packages/ai/src/approval.tsx
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
function M(t) {
|
|
14
|
+
return /* @__PURE__ */ C("section", {
|
|
14
15
|
"aria-label": t.title,
|
|
15
16
|
"data-request-id": t.requestId,
|
|
16
17
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli x1c8xbx5 xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
17
18
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ S("h3", {
|
|
19
20
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
20
21
|
children: t.title
|
|
21
22
|
}),
|
|
22
|
-
t.description !== void 0 && /* @__PURE__ */
|
|
23
|
+
t.description !== void 0 && /* @__PURE__ */ S("p", {
|
|
23
24
|
className: "x1ghz6dp x153jb6y xj0a0fe",
|
|
24
25
|
children: t.description
|
|
25
26
|
}),
|
|
26
27
|
t.children,
|
|
27
|
-
t.status === "pending" ? /* @__PURE__ */
|
|
28
|
+
t.status === "pending" ? /* @__PURE__ */ C(i, { children: [/* @__PURE__ */ S(e, {
|
|
28
29
|
variant: "solid",
|
|
29
30
|
onClick: t.onApprove,
|
|
30
31
|
disabled: t.disabled === !0 || t.busy !== void 0,
|
|
31
32
|
pending: t.busy === "approve",
|
|
32
33
|
pendingLabel: "Approving…",
|
|
33
34
|
children: t.approveLabel ?? "Approve"
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ S(e, {
|
|
35
36
|
onClick: t.onDeny,
|
|
36
37
|
disabled: t.disabled === !0 || t.busy !== void 0,
|
|
37
38
|
pending: t.busy === "deny",
|
|
38
39
|
pendingLabel: "Denying…",
|
|
39
40
|
children: t.denyLabel ?? "Deny"
|
|
40
|
-
})] }) : /* @__PURE__ */
|
|
41
|
+
})] }) : /* @__PURE__ */ S(s, { children: t.statusLabel })
|
|
41
42
|
]
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
// packages/ai/src/conversation.tsx
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
let i =
|
|
48
|
-
return /* @__PURE__ */
|
|
46
|
+
var N = v(void 0);
|
|
47
|
+
function P({ children: e, initialPosition: t = "end", follow: n = !0, viewportRef: r }) {
|
|
48
|
+
let i = x(null), a = r ?? i;
|
|
49
|
+
return /* @__PURE__ */ S(N.Provider, {
|
|
49
50
|
value: a,
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ S(k.Provider, {
|
|
51
52
|
autoScroll: n,
|
|
52
53
|
defaultScrollPosition: t,
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ S(k.Root, {
|
|
54
55
|
className: "x1n2onr6 x78zum5 xdt5ytf x5yr21d x2lwn1j xeuugli xpvm0e4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
55
56
|
children: e
|
|
56
57
|
})
|
|
57
58
|
})
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
let r =
|
|
62
|
-
return /* @__PURE__ */
|
|
61
|
+
function F({ label: e, children: t, scrollRestorationId: n }) {
|
|
62
|
+
let r = y(N);
|
|
63
|
+
return /* @__PURE__ */ S(k.Viewport, {
|
|
63
64
|
ref: r,
|
|
64
65
|
"aria-label": e,
|
|
65
66
|
"data-scroll-restoration-id": n,
|
|
@@ -67,8 +68,8 @@ function M({ label: e, children: t, scrollRestorationId: n }) {
|
|
|
67
68
|
children: t
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
return /* @__PURE__ */
|
|
71
|
+
function I({ children: e, streaming: t = !1 }) {
|
|
72
|
+
return /* @__PURE__ */ S(k.Content, {
|
|
72
73
|
"aria-live": "polite",
|
|
73
74
|
"aria-relevant": "additions",
|
|
74
75
|
"aria-busy": t,
|
|
@@ -76,51 +77,50 @@ function N({ children: e, streaming: t = !1 }) {
|
|
|
76
77
|
children: e
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
-
return /* @__PURE__ */
|
|
80
|
+
function L({ messageId: e, children: t }) {
|
|
81
|
+
return /* @__PURE__ */ S(k.Item, {
|
|
81
82
|
messageId: e,
|
|
82
83
|
className: "xeuugli xj0a0fe",
|
|
83
84
|
children: t
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
function R({ children: e }) {
|
|
88
|
+
return /* @__PURE__ */ S("div", {
|
|
88
89
|
className: "x9f619 x2lah0s xeuugli xh8yej3 xe10afn xvueqy4 xn9t2bk x1m92p3w",
|
|
89
90
|
children: e
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let { end: t } =
|
|
94
|
-
return t ? /* @__PURE__ */
|
|
93
|
+
function z({ label: e = "Jump to latest" }) {
|
|
94
|
+
let { end: t } = j();
|
|
95
|
+
return t ? /* @__PURE__ */ S("div", {
|
|
95
96
|
className: "x10l6tqk xwthv0x x1nrll8i xuuh30 x1tv4vx4 xeuugli",
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ S(B, { label: e })
|
|
97
98
|
}) : null;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
let { scrollToEnd: r } =
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
size: "sm",
|
|
100
|
+
function B({ label: t, onActivate: n }) {
|
|
101
|
+
let { scrollToEnd: r } = A(), i = y(N);
|
|
102
|
+
return /* @__PURE__ */ C(e, {
|
|
103
103
|
onClick: () => {
|
|
104
104
|
n?.(), requestAnimationFrame(() => {
|
|
105
105
|
let e = i?.current;
|
|
106
106
|
e != null && (r({ behavior: "instant" }), e.focus({ preventScroll: !0 }));
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ S(w, {
|
|
110
110
|
size: 14,
|
|
111
111
|
"aria-hidden": !0
|
|
112
112
|
}), t]
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
var
|
|
116
|
-
Root:
|
|
117
|
-
Viewport:
|
|
118
|
-
Content:
|
|
119
|
-
Item:
|
|
120
|
-
Controls:
|
|
121
|
-
LatestButton:
|
|
122
|
-
JumpToLatest:
|
|
123
|
-
},
|
|
115
|
+
var V = {
|
|
116
|
+
Root: P,
|
|
117
|
+
Viewport: F,
|
|
118
|
+
Content: I,
|
|
119
|
+
Item: L,
|
|
120
|
+
Controls: R,
|
|
121
|
+
LatestButton: B,
|
|
122
|
+
JumpToLatest: z
|
|
123
|
+
}, H = {
|
|
124
124
|
root: {
|
|
125
125
|
k1xSpc: "x78zum5",
|
|
126
126
|
kXwgrk: "xdt5ytf",
|
|
@@ -146,72 +146,72 @@ var R = {
|
|
|
146
146
|
k8WAf4: "xn9t2bk",
|
|
147
147
|
$$css: !0
|
|
148
148
|
}
|
|
149
|
-
},
|
|
150
|
-
user:
|
|
151
|
-
assistant:
|
|
152
|
-
system:
|
|
153
|
-
},
|
|
149
|
+
}, U = {
|
|
150
|
+
user: H.user,
|
|
151
|
+
assistant: H.assistant,
|
|
152
|
+
system: H.system
|
|
153
|
+
}, W = {
|
|
154
154
|
"x-default-marker": "x-default-marker",
|
|
155
155
|
$$css: !0
|
|
156
156
|
};
|
|
157
|
-
function
|
|
158
|
-
return /* @__PURE__ */
|
|
157
|
+
function G({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s }) {
|
|
158
|
+
return /* @__PURE__ */ C("article", {
|
|
159
159
|
id: n,
|
|
160
160
|
"aria-label": e,
|
|
161
|
-
...
|
|
161
|
+
..._.props(H.root, U[r], W),
|
|
162
162
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ C("header", {
|
|
164
164
|
className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
|
|
165
165
|
children: [
|
|
166
|
-
a !== void 0 && /* @__PURE__ */
|
|
166
|
+
a !== void 0 && /* @__PURE__ */ S("span", {
|
|
167
167
|
className: "x3nfvp2 x2lah0s",
|
|
168
168
|
children: a
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ S("span", {
|
|
171
171
|
className: "xk4h15q xeuugli xj0a0fe",
|
|
172
172
|
children: e
|
|
173
173
|
}),
|
|
174
|
-
i !== void 0 && /* @__PURE__ */
|
|
174
|
+
i !== void 0 && /* @__PURE__ */ S("div", {
|
|
175
175
|
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
176
176
|
children: i
|
|
177
177
|
})
|
|
178
178
|
]
|
|
179
179
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ S("div", {
|
|
181
181
|
className: "xeuugli xj0a0fe x1ytb0s6",
|
|
182
182
|
children: t
|
|
183
183
|
}),
|
|
184
|
-
s !== void 0 && /* @__PURE__ */
|
|
184
|
+
s !== void 0 && /* @__PURE__ */ S("div", {
|
|
185
185
|
className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
|
|
186
186
|
children: s
|
|
187
187
|
}),
|
|
188
|
-
o !== void 0 && /* @__PURE__ */
|
|
188
|
+
o !== void 0 && /* @__PURE__ */ S("footer", {
|
|
189
189
|
className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x1ac4sdd xea5s0o xbfgl4k",
|
|
190
190
|
children: o
|
|
191
191
|
})
|
|
192
192
|
]
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
return /* @__PURE__ */
|
|
195
|
+
function K({ name: e, description: t, href: n, actions: r }) {
|
|
196
|
+
return /* @__PURE__ */ C("div", {
|
|
197
197
|
className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
198
198
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ S(E, {
|
|
200
200
|
size: 16,
|
|
201
201
|
"aria-hidden": !0,
|
|
202
202
|
className: "x153jb6y x2lah0s"
|
|
203
203
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ C("div", {
|
|
205
205
|
className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
|
|
206
|
-
children: [n === void 0 ? /* @__PURE__ */
|
|
206
|
+
children: [n === void 0 ? /* @__PURE__ */ S("span", { children: e }) : /* @__PURE__ */ S(l, {
|
|
207
207
|
href: n,
|
|
208
208
|
children: e
|
|
209
|
-
}), t !== void 0 && /* @__PURE__ */
|
|
209
|
+
}), t !== void 0 && /* @__PURE__ */ S("span", {
|
|
210
210
|
className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
|
|
211
211
|
children: t
|
|
212
212
|
})]
|
|
213
213
|
}),
|
|
214
|
-
r !== void 0 && /* @__PURE__ */
|
|
214
|
+
r !== void 0 && /* @__PURE__ */ S("div", {
|
|
215
215
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
|
|
216
216
|
children: r
|
|
217
217
|
})
|
|
@@ -219,158 +219,184 @@ function U({ name: e, description: t, href: n, actions: r }) {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
// packages/ai/src/message-action.tsx
|
|
222
|
-
function
|
|
222
|
+
function q(e) {
|
|
223
223
|
if (e.kind === "link") {
|
|
224
|
-
let { kind: t, label:
|
|
225
|
-
return /* @__PURE__ */
|
|
224
|
+
let { kind: t, label: n, ...i } = e;
|
|
225
|
+
return /* @__PURE__ */ S(r, {
|
|
226
226
|
...i,
|
|
227
|
-
"aria-label":
|
|
227
|
+
"aria-label": n
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
let { kind: t, label:
|
|
231
|
-
return /* @__PURE__ */
|
|
230
|
+
let { kind: t, label: n, ...i } = e;
|
|
231
|
+
return /* @__PURE__ */ S(c, {
|
|
232
232
|
...i,
|
|
233
233
|
variant: "ghost",
|
|
234
|
-
"aria-label":
|
|
234
|
+
"aria-label": n
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return /* @__PURE__ */
|
|
237
|
+
function J(e) {
|
|
238
|
+
return /* @__PURE__ */ C(d.Root, { children: [/* @__PURE__ */ S(d.Trigger, { render: q(e) }), /* @__PURE__ */ S(d.Portal, { children: /* @__PURE__ */ S(d.Positioner, { children: /* @__PURE__ */ S(d.Popup, { children: e.label }) }) })] });
|
|
239
239
|
}
|
|
240
240
|
// packages/ai/src/message-boundary.tsx
|
|
241
|
-
function
|
|
242
|
-
return /* @__PURE__ */
|
|
241
|
+
function Y({ label: e, children: t }) {
|
|
242
|
+
return /* @__PURE__ */ C(a.Root, {
|
|
243
243
|
className: "xeuugli x1kbiq1m xykt701 xpu655y",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ C(a.Trigger, {
|
|
245
245
|
className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ S(D, {
|
|
247
247
|
size: 14,
|
|
248
248
|
"aria-hidden": !0,
|
|
249
249
|
className: "x2lah0s"
|
|
250
|
-
}), /* @__PURE__ */
|
|
250
|
+
}), /* @__PURE__ */ S("span", {
|
|
251
251
|
className: "xeuugli xj0a0fe",
|
|
252
252
|
children: e
|
|
253
253
|
})]
|
|
254
|
-
}), /* @__PURE__ */
|
|
254
|
+
}), /* @__PURE__ */ S(a.Panel, {
|
|
255
255
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
256
256
|
children: t
|
|
257
257
|
})]
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
// packages/ai/src/prompt-input.tsx
|
|
261
|
-
var
|
|
261
|
+
var X = { action: {
|
|
262
262
|
keTefX: "xvc5jky",
|
|
263
263
|
$$css: !0
|
|
264
264
|
} };
|
|
265
|
-
function
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
function Z({ compact: e = !1 }) {
|
|
266
|
+
return /* @__PURE__ */ S("div", {
|
|
267
|
+
"aria-hidden": !0,
|
|
268
|
+
inert: !0,
|
|
269
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
270
|
+
children: /* @__PURE__ */ C("div", {
|
|
271
|
+
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep",
|
|
272
|
+
children: [/* @__PURE__ */ S("div", {
|
|
273
|
+
..._.props(n.base, n.field, n.textarea, n.plainTextarea),
|
|
274
|
+
children: /* @__PURE__ */ S(p, {
|
|
275
|
+
lines: e ? 1 : 2,
|
|
276
|
+
width: "22ch"
|
|
277
|
+
})
|
|
278
|
+
}), /* @__PURE__ */ C("div", {
|
|
279
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
280
|
+
children: [/* @__PURE__ */ S("div", {
|
|
281
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd xy8obcc xas2l8k",
|
|
282
|
+
children: /* @__PURE__ */ S(p, { width: "8ch" })
|
|
283
|
+
}), /* @__PURE__ */ S(f, {
|
|
284
|
+
icon: !0,
|
|
285
|
+
xstyle: X.action
|
|
286
|
+
})]
|
|
287
|
+
})]
|
|
288
|
+
})
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
function Q({ label: e, value: t, onValueChange: n, onSubmit: r, name: i = "prompt", placeholder: a, maxLength: o, required: s = !0, pending: l = !1, disabled: u = !1, submitDisabled: f = !1, submitLabel: p = "Send message", pendingLabel: v = "Sending…", enterBehavior: y = "newline", compact: x = !1, description: w, error: E, controls: D, attachments: k, onStop: A, stopPending: j = !1, stopLabel: M = "Stop response" }) {
|
|
292
|
+
let N = b(), P = u || l, F = p;
|
|
293
|
+
A === void 0 ? l ? F = v : y === "submit" && (F = `${p} · Enter`) : F = j ? "Stopping…" : M;
|
|
268
294
|
function I(e) {
|
|
269
|
-
if (
|
|
295
|
+
if (y !== "submit" || e.key !== "Enter" || e.repeat) return;
|
|
270
296
|
let t = e.altKey || e.ctrlKey || e.metaKey;
|
|
271
|
-
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !
|
|
297
|
+
e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !f && A === void 0 && e.currentTarget.form?.requestSubmit());
|
|
272
298
|
}
|
|
273
299
|
function L(e) {
|
|
274
|
-
e.preventDefault(), !P && !
|
|
300
|
+
e.preventDefault(), !P && !f && A === void 0 && r(e);
|
|
275
301
|
}
|
|
276
|
-
return /* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ S("form", {
|
|
277
303
|
onSubmit: L,
|
|
278
304
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
|
|
279
|
-
children: /* @__PURE__ */
|
|
280
|
-
invalid:
|
|
305
|
+
children: /* @__PURE__ */ C(m.Root, {
|
|
306
|
+
invalid: E !== void 0,
|
|
281
307
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
...
|
|
308
|
+
/* @__PURE__ */ S(m.Label, {
|
|
309
|
+
..._.props(g.hidden),
|
|
284
310
|
children: e
|
|
285
311
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ C("div", {
|
|
287
313
|
...{
|
|
288
314
|
0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
|
|
289
315
|
1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" }
|
|
290
|
-
}[
|
|
316
|
+
}[E !== void 0 | 0],
|
|
291
317
|
children: [
|
|
292
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ S(h, {
|
|
293
319
|
appearance: "plain",
|
|
294
|
-
rows:
|
|
295
|
-
compact:
|
|
320
|
+
rows: x ? 1 : 2,
|
|
321
|
+
compact: x,
|
|
296
322
|
name: i,
|
|
297
323
|
value: t,
|
|
298
324
|
onChange: (e) => n(e.currentTarget.value),
|
|
299
325
|
onKeyDown: I,
|
|
300
326
|
placeholder: a ?? e,
|
|
301
327
|
maxLength: o,
|
|
302
|
-
required:
|
|
303
|
-
disabled:
|
|
328
|
+
required: s,
|
|
329
|
+
disabled: u,
|
|
304
330
|
readOnly: l,
|
|
305
|
-
"aria-errormessage":
|
|
331
|
+
"aria-errormessage": E === void 0 ? void 0 : N
|
|
306
332
|
}),
|
|
307
333
|
k,
|
|
308
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ C("div", {
|
|
309
335
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
|
|
310
|
-
children: [
|
|
336
|
+
children: [D !== void 0 && /* @__PURE__ */ S("div", {
|
|
311
337
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
|
|
312
|
-
children:
|
|
313
|
-
}), /* @__PURE__ */
|
|
314
|
-
xstyle:
|
|
338
|
+
children: D
|
|
339
|
+
}), /* @__PURE__ */ C(d.Root, { children: [/* @__PURE__ */ S(d.Trigger, { render: A === void 0 ? /* @__PURE__ */ S(c, {
|
|
340
|
+
xstyle: X.action,
|
|
315
341
|
type: "submit",
|
|
316
342
|
variant: "solid",
|
|
317
|
-
"aria-label": l ?
|
|
318
|
-
disabled:
|
|
343
|
+
"aria-label": l ? v : p,
|
|
344
|
+
disabled: u || f,
|
|
319
345
|
pending: l,
|
|
320
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ S(T, {
|
|
321
347
|
size: 16,
|
|
322
348
|
"aria-hidden": !0
|
|
323
349
|
})
|
|
324
|
-
}) : /* @__PURE__ */
|
|
325
|
-
xstyle:
|
|
350
|
+
}) : /* @__PURE__ */ S(c, {
|
|
351
|
+
xstyle: X.action,
|
|
326
352
|
type: "button",
|
|
327
353
|
"aria-label": j ? "Stopping…" : M,
|
|
328
354
|
onClick: (e) => {
|
|
329
355
|
e.preventDefault(), A();
|
|
330
356
|
},
|
|
331
|
-
disabled:
|
|
357
|
+
disabled: u,
|
|
332
358
|
pending: j,
|
|
333
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ S(O, {
|
|
334
360
|
size: 14,
|
|
335
361
|
"aria-hidden": !0
|
|
336
362
|
})
|
|
337
|
-
}) }), /* @__PURE__ */
|
|
363
|
+
}) }), /* @__PURE__ */ S(d.Portal, { children: /* @__PURE__ */ S(d.Positioner, { children: /* @__PURE__ */ S(d.Popup, { children: F }) }) })] })]
|
|
338
364
|
})
|
|
339
365
|
]
|
|
340
366
|
}),
|
|
341
|
-
|
|
342
|
-
|
|
367
|
+
w !== void 0 && /* @__PURE__ */ S(m.Description, { children: w }),
|
|
368
|
+
E !== void 0 && /* @__PURE__ */ S(m.Error, {
|
|
343
369
|
id: N,
|
|
344
370
|
match: !0,
|
|
345
371
|
role: "alert",
|
|
346
|
-
children:
|
|
372
|
+
children: E
|
|
347
373
|
})
|
|
348
374
|
]
|
|
349
375
|
})
|
|
350
376
|
});
|
|
351
377
|
}
|
|
352
378
|
// packages/ai/src/sources.tsx
|
|
353
|
-
function
|
|
354
|
-
return /* @__PURE__ */
|
|
379
|
+
function $({ sources: e, label: t = "Sources" }) {
|
|
380
|
+
return /* @__PURE__ */ C("section", {
|
|
355
381
|
"aria-label": t,
|
|
356
382
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
|
|
357
383
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ S("h3", {
|
|
359
385
|
className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
|
|
360
386
|
children: t
|
|
361
387
|
}),
|
|
362
|
-
e.length === 0 && /* @__PURE__ */
|
|
388
|
+
e.length === 0 && /* @__PURE__ */ S("p", {
|
|
363
389
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
364
390
|
children: "No sources supplied."
|
|
365
391
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ S("ol", {
|
|
367
393
|
className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
|
|
368
|
-
children: e.map((e) => /* @__PURE__ */
|
|
394
|
+
children: e.map((e) => /* @__PURE__ */ C("li", {
|
|
369
395
|
className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ S("span", { children: /* @__PURE__ */ S(l, {
|
|
371
397
|
href: e.href,
|
|
372
398
|
children: e.title
|
|
373
|
-
}) }), e.description !== void 0 && /* @__PURE__ */
|
|
399
|
+
}) }), e.description !== void 0 && /* @__PURE__ */ S("p", {
|
|
374
400
|
className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
|
|
375
401
|
children: e.description
|
|
376
402
|
})]
|
|
@@ -379,21 +405,21 @@ function Y({ sources: e, label: t = "Sources" }) {
|
|
|
379
405
|
]
|
|
380
406
|
});
|
|
381
407
|
}
|
|
382
|
-
function
|
|
383
|
-
return /* @__PURE__ */
|
|
408
|
+
function ee({ source: e, label: n }) {
|
|
409
|
+
return /* @__PURE__ */ S("span", {
|
|
384
410
|
className: "xt0psk2 x11njtxf xss6m8b",
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
render: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ C(u.Root, { children: [/* @__PURE__ */ S(u.Trigger, {
|
|
412
|
+
render: /* @__PURE__ */ S(t, {}),
|
|
387
413
|
"aria-label": `Source ${n}: ${e.title}`,
|
|
388
414
|
children: n
|
|
389
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ S(u.Portal, { children: /* @__PURE__ */ S(u.Positioner, {
|
|
390
416
|
side: "top",
|
|
391
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ S(u.Popup, { children: /* @__PURE__ */ C(o, {
|
|
392
418
|
compact: !0,
|
|
393
419
|
children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
e.description !== void 0 && /* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ S(u.Title, { children: e.title }),
|
|
421
|
+
e.description !== void 0 && /* @__PURE__ */ S(u.Description, { children: e.description }),
|
|
422
|
+
/* @__PURE__ */ S(l, {
|
|
397
423
|
href: e.href,
|
|
398
424
|
children: "Open source"
|
|
399
425
|
})
|
|
@@ -402,4 +428,4 @@ function X({ source: e, label: n }) {
|
|
|
402
428
|
}) })] })
|
|
403
429
|
});
|
|
404
430
|
}
|
|
405
|
-
export {
|
|
431
|
+
export { M as Approval, V as Conversation, ee as InlineCitation, G as Message, J as MessageAction, K as MessageAttachment, Y as MessageBoundary, Q as PromptInput, Z as PromptInputPlaceholder, $ as Sources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, s as t } from "./chart-frame-
|
|
2
|
-
import { n } from "./chart-input-
|
|
1
|
+
import { n as e, s as t } from "./chart-frame-DAxsgMyl.js";
|
|
2
|
+
import { n } from "./chart-input-B0snxbMH.js";
|
|
3
3
|
import * as r from "@stylexjs/stylex";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
// packages/charts/src/categorical-values.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as e } from "./src-
|
|
1
|
+
import { g as e } from "./src-BNlyCwOr.js";
|
|
2
2
|
import { chartColors as t, colors as n } from "./tokens.js";
|
|
3
3
|
import * as r from "@stylexjs/stylex";
|
|
4
4
|
import { useId as i } from "react";
|
|
@@ -125,7 +125,7 @@ function f({ items: e, label: t = "Legend" }) {
|
|
|
125
125
|
}
|
|
126
126
|
function p({ label: e, selected: t = !1, onSelect: n, children: r }) {
|
|
127
127
|
return n === void 0 ? /* @__PURE__ */ a("div", {
|
|
128
|
-
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli
|
|
128
|
+
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r xwu7q15 x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b",
|
|
129
129
|
children: r
|
|
130
130
|
}) : /* @__PURE__ */ a("button", {
|
|
131
131
|
type: "button",
|
|
@@ -133,8 +133,8 @@ function p({ label: e, selected: t = !1, onSelect: n, children: r }) {
|
|
|
133
133
|
"aria-pressed": t,
|
|
134
134
|
onClick: n,
|
|
135
135
|
...{
|
|
136
|
-
0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli
|
|
137
|
-
1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli
|
|
136
|
+
0: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r xwu7q15 x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xpvm0e4 xss6m8b x1ypdohk x1t137rt xzro8vx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal" },
|
|
137
|
+
1: { className: "x78zum5 x1a02dak x6s0dn4 x1qughib x8zbtdt x1gkm1c7 xeuugli x17tes2r xwu7q15 x9f619 xh8yej3 xc342km x1hmw7ec x5g2kb4 x1hz01jw xtqrqnz xj57cvi x1778rvt x1yc453h xj0a0fe xbixft xss6m8b x1ypdohk x1t137rt xzro8vx x1ecmtor x19rmrnh x9v5kkp x13qnu6 x1bqaal x1r7kqkb xh3r7i3" }
|
|
138
138
|
}[!!t | 0],
|
|
139
139
|
children: r
|
|
140
140
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as t } from "./chart-frame-
|
|
1
|
+
import { m as e } from "./src-B0UTwpOz.js";
|
|
2
|
+
import { r as t } from "./chart-frame-DAxsgMyl.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
// packages/charts/src/chart-input.tsx
|
|
5
5
|
function r(e) {
|