@mechane-ai/elements 0.12.0 → 0.14.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.
Files changed (88) hide show
  1. package/README.md +50 -11
  2. package/dist/ai.js +175 -148
  3. package/dist/{categorical-values-CTrHn9jH.js → categorical-values-BnWfIPlv.js} +3 -3
  4. package/dist/{chart-frame-38ES6kwK.js → chart-frame-Dm8UNfYD.js} +6 -6
  5. package/dist/{chart-input-C9fu7f1Q.js → chart-input-ceiMZYI-.js} +3 -3
  6. package/dist/charts/cartesian.js +16 -16
  7. package/dist/charts/distribution.js +6 -6
  8. package/dist/charts/graph.js +5 -5
  9. package/dist/charts/hierarchy.js +3 -3
  10. package/dist/charts/matrix.js +13 -13
  11. package/dist/charts/timeline.js +30 -30
  12. package/dist/charts.js +1 -1
  13. package/dist/{code-block-BjV2EFZS.js → code-block-D07N6mYS.js} +4 -4
  14. package/dist/collections.js +414 -395
  15. package/dist/constants.stylex-bbdiv1fD.js +83 -0
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +5 -5
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +4 -4
  20. package/dist/content/tree.js +2 -2
  21. package/dist/{content-link-C460m-O7.js → content-link-CEx2s1MU.js} +1 -1
  22. package/dist/content.js +5 -5
  23. package/dist/elements.css +71 -120
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +21 -21
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +22 -22
  29. package/dist/navigation/commands.js +6 -6
  30. package/dist/navigation.js +30 -16
  31. package/dist/overlays.js +1 -1
  32. package/dist/packages/ai/src/approval.d.ts +1 -1
  33. package/dist/packages/ai/src/conversation.d.ts +4 -4
  34. package/dist/packages/ai/src/index.d.ts +2 -2
  35. package/dist/packages/ai/src/prompt-input.d.ts +9 -5
  36. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +1 -1
  37. package/dist/packages/charts/src/cartesian/time-series.d.ts +2 -2
  38. package/dist/packages/charts/src/chart-frame.d.ts +2 -2
  39. package/dist/packages/collections/src/collection-controls.d.ts +8 -7
  40. package/dist/packages/collections/src/collection-scroll.d.ts +2 -2
  41. package/dist/packages/collections/src/data-table.d.ts +23 -6
  42. package/dist/packages/collections/src/index.d.ts +4 -5
  43. package/dist/packages/content/src/code/code-block.d.ts +4 -4
  44. package/dist/packages/content/src/diff/diff-source.d.ts +1 -1
  45. package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -2
  46. package/dist/packages/content/src/markdown/markdown.d.ts +2 -2
  47. package/dist/packages/content/src/trace.d.ts +3 -3
  48. package/dist/packages/core/src/actions.d.ts +2 -2
  49. package/dist/packages/core/src/surfaces.d.ts +6 -6
  50. package/dist/packages/core/src/text.d.ts +2 -2
  51. package/dist/packages/feedback/src/async-region.d.ts +18 -10
  52. package/dist/packages/feedback/src/control-placeholders.d.ts +10 -5
  53. package/dist/packages/feedback/src/feedback.d.ts +2 -2
  54. package/dist/packages/feedback/src/index.d.ts +2 -3
  55. package/dist/packages/forms/src/form-actions.d.ts +2 -2
  56. package/dist/packages/forms/src/forms.d.ts +2 -2
  57. package/dist/packages/forms/src/selection-styles.d.ts +1 -1
  58. package/dist/packages/foundations/src/constants.stylex.d.ts +90 -0
  59. package/dist/packages/foundations/src/control-styles.d.ts +21 -0
  60. package/dist/packages/foundations/src/tokens.d.ts +2 -0
  61. package/dist/packages/foundations/src/tokens.stylex.d.ts +0 -85
  62. package/dist/packages/layout/src/app-shell.d.ts +2 -2
  63. package/dist/packages/layout/src/page-toolbar.d.ts +3 -3
  64. package/dist/packages/layout/src/record-page.d.ts +2 -2
  65. package/dist/packages/layout/src/resizable.d.ts +2 -2
  66. package/dist/packages/layout/src/sidebar.d.ts +6 -6
  67. package/dist/packages/layout/src/view-stack.d.ts +2 -2
  68. package/dist/packages/layout/src/workbench.d.ts +2 -2
  69. package/dist/packages/navigation/src/commands/command.d.ts +3 -3
  70. package/dist/packages/navigation/src/index.d.ts +2 -2
  71. package/dist/packages/navigation/src/page-navigation.d.ts +7 -2
  72. package/dist/packages/overlays/src/drawer.d.ts +2 -2
  73. package/dist/{pierre-diff-sUAU-xeL.js → pierre-diff-C_j0nxwS.js} +2 -2
  74. package/dist/pierre-theme-BUeJim8s.js +127 -0
  75. package/dist/{pierre-tree-DKN2eGlZ.js → pierre-tree-CBBDlJ_Y.js} +4 -4
  76. package/dist/{src-DOzle5d4.js → src-BkXlN6aZ.js} +180 -195
  77. package/dist/{src-CI6KtN2w.js → src-C9GQP3px.js} +353 -377
  78. package/dist/{src-3gzujMhN.js → src-CyJd2qSZ.js} +47 -33
  79. package/dist/{src-CVlgjAlw.js → src-d7EAi61b.js} +9 -9
  80. package/dist/theme.js +1 -1
  81. package/dist/tokens.js +3 -203
  82. package/dist/tokens.stylex-DTHHFbyl.js +128 -0
  83. package/package.json +4 -2
  84. package/packages/foundations/src/constants.stylex.ts +91 -0
  85. package/packages/foundations/src/tokens.stylex.ts +0 -88
  86. package/dist/packages/collections/src/table.d.ts +0 -17
  87. package/dist/packages/feedback/src/loading.d.ts +0 -7
  88. package/dist/pierre-theme-CBAncKdH.js +0 -126
package/README.md CHANGED
@@ -77,7 +77,8 @@ Every path below belongs to `@mechane-ai/elements`. There is one package, versio
77
77
  | `/theme` | Light and dark theme props. |
78
78
  | `/csp` | Application-supplied content security policy configuration. |
79
79
  | `/tokens` | Compiled token references for runtime styles. |
80
- | `/tokens.stylex` | Direct definitions for StyleX authoring and themes. |
80
+ | `/tokens.stylex` | Variable definitions for StyleX authoring and themes. |
81
+ | `/constants.stylex` | Compile-time conditions, palette values, layers, and shared geometry. |
81
82
  | `/styles.css` | Component styles and token defaults. |
82
83
 
83
84
  Focused entries keep renderer and chart dependencies out of basic controls. There is no all-components barrel. Renderers
@@ -98,10 +99,10 @@ Detail titles wrap; list metadata truncates. Sidebar items share contiguous hit
98
99
  navigation and reserve the divided sidebar footer for persistent account controls. Use
99
100
  `SidebarFooter layout="navigation"` for a group of commands; its intrinsic height keeps the scrolling navigation clear.
100
101
 
101
- `AppShell focus` temporarily hides navigation while retaining its expansion state. `ViewStack.Panel` keeps inactive
102
- content mounted and measurable but removes it from keyboard and assistive-technology navigation. The application owns
103
- which view is active and when to unmount it; use this for a draft or reading position that must survive inspection.
104
- `WorkbenchScroll` requires an accessible `label`; its `flush` mode leaves list insets to the table. Its
102
+ `AppShell shouldFocus` temporarily hides navigation while retaining its expansion state. `ViewStack.Panel` keeps
103
+ inactive content mounted and measurable but removes it from keyboard and assistive-technology navigation. The
104
+ application owns which view is active and when to unmount it; use this for a draft or reading position that must survive
105
+ inspection. `WorkbenchScroll` requires an accessible `label`; its `isFlush` mode leaves list insets to the table. Its
105
106
  `scrollRestorationId` identifies the actual scroll region for application-owned restoration.
106
107
 
107
108
  Each `DataTable` column declares a role: `primary`, `text`, `status`, `number`, `timestamp`, or `actions`. Roles own
@@ -136,13 +137,35 @@ The default theme is light, with system fonts and a compact spacing scale. Impor
136
137
  `@mechane-ai/elements/theme` and spread `themeProps.light` or `themeProps.dark` onto the document root. Portaled content
137
138
  then inherits the same theme. The application owns the preference; no theme provider is required.
138
139
 
139
- For custom StyleX themes, import definitions from `@mechane-ai/elements/tokens.stylex`, enable `useCSSLayers: true` and
140
- CommonJS module resolution in the StyleX plugin, and use `stylex.createTheme`. The defining path is preserved in the
141
- archive so generated variables match its compiled CSS. The ordinary `/tokens` entry supplies runtime references rather
142
- than compile-time definitions.
140
+ For custom StyleX styles and themes, import variables from `@mechane-ai/elements/tokens.stylex` and compile-time
141
+ constants from `@mechane-ai/elements/constants.stylex`. The archive preserves both defining paths. Variables retain the
142
+ same names as the packaged CSS; constants need their source compiled with the consuming styles. The ordinary `/tokens`
143
+ entry supplies runtime references and values for both groups.
144
+
145
+ With Vite and StyleX 0.19.1, configure the consumer as follows:
146
+
147
+ ```ts
148
+ import stylex from '@stylexjs/unplugin/vite';
149
+ import { defineConfig } from 'vite';
150
+
151
+ export default defineConfig({
152
+ plugins: [
153
+ stylex({
154
+ useCSSLayers: true,
155
+ debug: false,
156
+ runtimeInjection: false,
157
+ unstable_moduleResolution: { type: 'commonJS' },
158
+ externalPackages: ['@mechane-ai/elements'],
159
+ }),
160
+ ],
161
+ resolve: { alias: [{ find: /^@mechane-ai\/elements\/tokens\.stylex$/, replacement: '@mechane-ai/elements/tokens' }] },
162
+ });
163
+ ```
143
164
 
144
- Set the consumer compiler's `debug: false` so placement overrides use the archive's property keys. Keep definition
145
- resolution for compilation; bundle `/tokens` runtime references to avoid reinjecting defaults over a chosen theme.
165
+ The bundler alias uses compiled variable references without re-emitting defaults over the selected theme. StyleX still
166
+ resolves the original defining path during compilation. Keep `/constants.stylex` direct so its metadata reaches the
167
+ compiler. Consumer styles can then use `[conditions.coarsePointer]` from that entry, and
168
+ `stylex.createTheme(colors, ...)` with `colors` from `/tokens.stylex`.
146
169
 
147
170
  When an application's Content Security Policy requires nonces, wrap its component tree in `CSPProvider` from
148
171
  `@mechane-ai/elements/csp` and pass the same request nonce used in its policy. Preserve that nonce during hydration.
@@ -154,6 +177,22 @@ structural styles in the published stylesheet, so the production package injects
154
177
  initial-read failures and field validation local; retained-content refresh failures can use one notification with Retry.
155
178
  The application owns stable notification IDs and dismissal on recovery or navigation.
156
179
 
180
+ ## Loading content
181
+
182
+ Use `AsyncRegion` from `/feedback` with an explicit `pending`, `ready`, or `failed` state and a destination-specific
183
+ `placeholder`. Pending reserves that geometry immediately and reveals it after two seconds. Ready content enters in
184
+ 80ms; ready-at-mount and failed content appear immediately. Reduced motion removes the fades. There is no minimum
185
+ loading duration, and ordinary callers do not configure timing.
186
+
187
+ Wrap a page in `LoadingScope` and pass its navigation `identity` to share one clock across dependent reads. Updating the
188
+ identity resets pending presentation without remounting ready children. Use `initialStartedAt` only to preserve elapsed
189
+ document loading time at hydration; later identities start their own clock. Keep refreshes in the ready state and retain
190
+ their content, focus, and drafts; display progress or failure alongside the last result.
191
+
192
+ Build placeholders from the same layouts as their destinations. `DataTablePlaceholder` accepts the real table's
193
+ `DataTableColumnLayout` definitions and optional decorative cells. The async region owns the loading announcement; its
194
+ placeholders must not contain interactive controls, invented records, or independent status announcements.
195
+
157
196
  ## Develop and release
158
197
 
159
198
  From `workspaces/core`:
package/dist/ai.js CHANGED
@@ -1,65 +1,66 @@
1
- import { C as e, E as t, T as n, f as r, g as i, p as a, t as o, w as s } from "./src-3gzujMhN.js";
2
- import { t as c } from "./content-link-C460m-O7.js";
3
- import { r as l, t as u } from "./src-CVlgjAlw.js";
4
- import { c as d, u as f } from "./src-DOzle5d4.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, File as C, GitBranch as w, Square as T } from "lucide-react";
10
- import { MessageScroller as E, useMessageScroller as D, useMessageScrollerScrollable as O } from "@shadcn/react/message-scroller";
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-CyJd2qSZ.js";
2
+ import { t as l } from "./content-link-CEx2s1MU.js";
3
+ import { r as u, t as d } from "./src-d7EAi61b.js";
4
+ import { c as f, d as p } from "./src-C9GQP3px.js";
5
+ import { c as m, u as h } from "./src-BkXlN6aZ.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 k(t) {
13
- return /* @__PURE__ */ b("section", {
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__ */ y("h3", {
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__ */ y("p", {
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__ */ b(r, { children: [/* @__PURE__ */ y(e, {
28
+ t.status === "pending" ? /* @__PURE__ */ C(i, { children: [/* @__PURE__ */ S(e, {
28
29
  variant: "solid",
29
30
  onClick: t.onApprove,
30
- disabled: t.disabled === !0 || t.busy !== void 0,
31
- pending: t.busy === "approve",
31
+ disabled: t.isDisabled === !0 || t.busy !== void 0,
32
+ isPending: t.busy === "approve",
32
33
  pendingLabel: "Approving…",
33
34
  children: t.approveLabel ?? "Approve"
34
- }), /* @__PURE__ */ y(e, {
35
+ }), /* @__PURE__ */ S(e, {
35
36
  onClick: t.onDeny,
36
- disabled: t.disabled === !0 || t.busy !== void 0,
37
- pending: t.busy === "deny",
37
+ disabled: t.isDisabled === !0 || t.busy !== void 0,
38
+ isPending: t.busy === "deny",
38
39
  pendingLabel: "Denying…",
39
40
  children: t.denyLabel ?? "Deny"
40
- })] }) : /* @__PURE__ */ y(o, { children: t.statusLabel })
41
+ })] }) : /* @__PURE__ */ S(s, { children: t.statusLabel })
41
42
  ]
42
43
  });
43
44
  }
44
45
  // packages/ai/src/conversation.tsx
45
- var A = h(void 0);
46
- function j({ children: e, initialPosition: t = "end", follow: n = !0, viewportRef: r }) {
47
- let i = v(null), a = r ?? i;
48
- return /* @__PURE__ */ y(A.Provider, {
46
+ var N = v(void 0);
47
+ function P({ children: e, initialPosition: t = "end", shouldFollow: 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__ */ y(E.Provider, {
51
+ children: /* @__PURE__ */ S(k.Provider, {
51
52
  autoScroll: n,
52
53
  defaultScrollPosition: t,
53
- children: /* @__PURE__ */ y(E.Root, {
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 M({ label: e, children: t, scrollRestorationId: n }) {
61
- let r = g(A);
62
- return /* @__PURE__ */ y(E.Viewport, {
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 N({ children: e, streaming: t = !1 }) {
71
- return /* @__PURE__ */ y(E.Content, {
71
+ function I({ children: e, isStreaming: t = !1 }) {
72
+ return /* @__PURE__ */ S(k.Content, {
72
73
  "aria-live": "polite",
73
74
  "aria-relevant": "additions",
74
75
  "aria-busy": t,
@@ -76,50 +77,50 @@ function N({ children: e, streaming: t = !1 }) {
76
77
  children: e
77
78
  });
78
79
  }
79
- function P({ messageId: e, children: t }) {
80
- return /* @__PURE__ */ y(E.Item, {
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 F({ children: e }) {
87
- return /* @__PURE__ */ y("div", {
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 I({ label: e = "Jump to latest" }) {
93
- let { end: t } = O();
94
- return t ? /* @__PURE__ */ y("div", {
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__ */ y(L, { label: e })
97
+ children: /* @__PURE__ */ S(B, { label: e })
97
98
  }) : null;
98
99
  }
99
- function L({ label: t, onActivate: n }) {
100
- let { scrollToEnd: r } = D(), i = g(A);
101
- return /* @__PURE__ */ b(e, {
100
+ function B({ label: t, onActivate: n }) {
101
+ let { scrollToEnd: r } = A(), i = y(N);
102
+ return /* @__PURE__ */ C(e, {
102
103
  onClick: () => {
103
104
  n?.(), requestAnimationFrame(() => {
104
105
  let e = i?.current;
105
106
  e != null && (r({ behavior: "instant" }), e.focus({ preventScroll: !0 }));
106
107
  });
107
108
  },
108
- children: [/* @__PURE__ */ y(x, {
109
+ children: [/* @__PURE__ */ S(w, {
109
110
  size: 14,
110
111
  "aria-hidden": !0
111
112
  }), t]
112
113
  });
113
114
  }
114
- var R = {
115
- Root: j,
116
- Viewport: M,
117
- Content: N,
118
- Item: P,
119
- Controls: F,
120
- LatestButton: L,
121
- JumpToLatest: I
122
- }, z = {
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 = {
123
124
  root: {
124
125
  k1xSpc: "x78zum5",
125
126
  kXwgrk: "xdt5ytf",
@@ -145,72 +146,72 @@ var R = {
145
146
  k8WAf4: "xn9t2bk",
146
147
  $$css: !0
147
148
  }
148
- }, B = {
149
- user: z.user,
150
- assistant: z.assistant,
151
- system: z.system
152
- }, V = {
149
+ }, U = {
150
+ user: H.user,
151
+ assistant: H.assistant,
152
+ system: H.system
153
+ }, W = {
153
154
  "x-default-marker": "x-default-marker",
154
155
  $$css: !0
155
156
  };
156
- function H({ author: e, children: t, id: n, kind: r = "assistant", meta: i, avatar: a, actions: o, attachments: s }) {
157
- return /* @__PURE__ */ b("article", {
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", {
158
159
  id: n,
159
160
  "aria-label": e,
160
- ...m.props(z.root, B[r], V),
161
+ ..._.props(H.root, U[r], W),
161
162
  children: [
162
- /* @__PURE__ */ b("header", {
163
+ /* @__PURE__ */ C("header", {
163
164
  className: "x78zum5 x6s0dn4 x1hnptsi x1a02dak xeuugli",
164
165
  children: [
165
- a !== void 0 && /* @__PURE__ */ y("span", {
166
+ a !== void 0 && /* @__PURE__ */ S("span", {
166
167
  className: "x3nfvp2 x2lah0s",
167
168
  children: a
168
169
  }),
169
- /* @__PURE__ */ y("span", {
170
+ /* @__PURE__ */ S("span", {
170
171
  className: "xk4h15q xeuugli xj0a0fe",
171
172
  children: e
172
173
  }),
173
- i !== void 0 && /* @__PURE__ */ y("div", {
174
+ i !== void 0 && /* @__PURE__ */ S("div", {
174
175
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
175
176
  children: i
176
177
  })
177
178
  ]
178
179
  }),
179
- /* @__PURE__ */ y("div", {
180
+ /* @__PURE__ */ S("div", {
180
181
  className: "xeuugli xj0a0fe x1ytb0s6",
181
182
  children: t
182
183
  }),
183
- s !== void 0 && /* @__PURE__ */ y("div", {
184
+ s !== void 0 && /* @__PURE__ */ S("div", {
184
185
  className: "x78zum5 x1a02dak x1qjc9v5 x1hnptsi xeuugli",
185
186
  children: s
186
187
  }),
187
- o !== void 0 && /* @__PURE__ */ y("footer", {
188
- className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x1ac4sdd xea5s0o xbfgl4k",
188
+ o !== void 0 && /* @__PURE__ */ S("footer", {
189
+ className: "x78zum5 x1a02dak x6s0dn4 xeuugli xunmzkg x1hc1fzr x12vu8c0 xtf8l8m x1thm12b",
189
190
  children: o
190
191
  })
191
192
  ]
192
193
  });
193
194
  }
194
- function U({ name: e, description: t, href: n, actions: r }) {
195
- return /* @__PURE__ */ b("div", {
195
+ function K({ name: e, description: t, href: n, actions: r }) {
196
+ return /* @__PURE__ */ C("div", {
196
197
  className: "x78zum5 x1a02dak x6s0dn4 x1n8ia3y xeuugli x193iq5w x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xpvm0e4 x1hz01jw xtqrqnz x1778rvt xj57cvi",
197
198
  children: [
198
- /* @__PURE__ */ y(C, {
199
+ /* @__PURE__ */ S(E, {
199
200
  size: 16,
200
201
  "aria-hidden": !0,
201
202
  className: "x153jb6y x2lah0s"
202
203
  }),
203
- /* @__PURE__ */ b("div", {
204
+ /* @__PURE__ */ C("div", {
204
205
  className: "x78zum5 xdt5ytf xfko13i x1slnebi xeuugli xj0a0fe",
205
- children: [n === void 0 ? /* @__PURE__ */ y("span", { children: e }) : /* @__PURE__ */ y(c, {
206
+ children: [n === void 0 ? /* @__PURE__ */ S("span", { children: e }) : /* @__PURE__ */ S(l, {
206
207
  href: n,
207
208
  children: e
208
- }), t !== void 0 && /* @__PURE__ */ y("span", {
209
+ }), t !== void 0 && /* @__PURE__ */ S("span", {
209
210
  className: "x153jb6y xy8obcc xas2l8k xeuugli xj0a0fe",
210
211
  children: t
211
212
  })]
212
213
  }),
213
- r !== void 0 && /* @__PURE__ */ y("div", {
214
+ r !== void 0 && /* @__PURE__ */ S("div", {
214
215
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli",
215
216
  children: r
216
217
  })
@@ -218,158 +219,184 @@ function U({ name: e, description: t, href: n, actions: r }) {
218
219
  });
219
220
  }
220
221
  // packages/ai/src/message-action.tsx
221
- function W(e) {
222
+ function q(e) {
222
223
  if (e.kind === "link") {
223
- let { kind: t, label: r, ...i } = e;
224
- return /* @__PURE__ */ y(n, {
224
+ let { kind: t, label: n, ...i } = e;
225
+ return /* @__PURE__ */ S(r, {
225
226
  ...i,
226
- "aria-label": r
227
+ "aria-label": n
227
228
  });
228
229
  }
229
- let { kind: t, label: r, ...i } = e;
230
- return /* @__PURE__ */ y(s, {
230
+ let { kind: t, label: n, ...i } = e;
231
+ return /* @__PURE__ */ S(c, {
231
232
  ...i,
232
233
  variant: "ghost",
233
- "aria-label": r
234
+ "aria-label": n
234
235
  });
235
236
  }
236
- function G(e) {
237
- return /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: W(e) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: e.label }) }) })] });
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 }) }) })] });
238
239
  }
239
240
  // packages/ai/src/message-boundary.tsx
240
- function K({ label: e, children: t }) {
241
- return /* @__PURE__ */ b(i.Root, {
241
+ function Y({ label: e, children: t }) {
242
+ return /* @__PURE__ */ C(a.Root, {
242
243
  className: "xeuugli x1kbiq1m xykt701 xpu655y",
243
- children: [/* @__PURE__ */ b(i.Trigger, {
244
+ children: [/* @__PURE__ */ C(a.Trigger, {
244
245
  className: "xlqzeqv x1hnptsi x153jb6y xy8obcc xas2l8k xj57cvi",
245
- children: [/* @__PURE__ */ y(w, {
246
+ children: [/* @__PURE__ */ S(D, {
246
247
  size: 14,
247
248
  "aria-hidden": !0,
248
249
  className: "x2lah0s"
249
- }), /* @__PURE__ */ y("span", {
250
+ }), /* @__PURE__ */ S("span", {
250
251
  className: "xeuugli xj0a0fe",
251
252
  children: e
252
253
  })]
253
- }), /* @__PURE__ */ y(i.Panel, {
254
+ }), /* @__PURE__ */ S(a.Panel, {
254
255
  className: "x153jb6y xy8obcc xas2l8k",
255
256
  children: t
256
257
  })]
257
258
  });
258
259
  }
259
260
  // packages/ai/src/prompt-input.tsx
260
- var q = { action: {
261
+ var X = { action: {
261
262
  keTefX: "xvc5jky",
262
263
  $$css: !0
263
264
  } };
264
- function J({ label: e, value: t, onValueChange: n, onSubmit: r, name: i = "prompt", placeholder: a, maxLength: o, 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: E, error: D, controls: O, attachments: k, onStop: A, stopPending: j = !1, stopLabel: M = "Stop response" }) {
265
- let N = _(), P = h || l, F = v;
266
- A === void 0 ? l ? F = x : C === "submit" && (F = `${v} · Enter`) : F = j ? "Stopping…" : M;
265
+ function Z({ isCompact: 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
+ isIconOnly: !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, isPending: l = !1, disabled: u = !1, isSubmitDisabled: f = !1, submitLabel: p = "Send message", pendingLabel: v = "Sending…", enterBehavior: y = "newline", isCompact: x = !1, description: w, error: E, controls: D, attachments: k, onStop: A, isStopPending: 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;
267
294
  function I(e) {
268
- if (C !== "submit" || e.key !== "Enter" || e.repeat) return;
295
+ if (y !== "submit" || e.key !== "Enter" || e.repeat) return;
269
296
  let t = e.altKey || e.ctrlKey || e.metaKey;
270
- e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !g && A === void 0 && e.currentTarget.form?.requestSubmit());
297
+ e.shiftKey || t || e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 || (e.preventDefault(), !P && !f && A === void 0 && e.currentTarget.form?.requestSubmit());
271
298
  }
272
299
  function L(e) {
273
- e.preventDefault(), !P && !g && A === void 0 && r(e);
300
+ e.preventDefault(), !P && !f && A === void 0 && r(e);
274
301
  }
275
- return /* @__PURE__ */ y("form", {
302
+ return /* @__PURE__ */ S("form", {
276
303
  onSubmit: L,
277
304
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli xh8yej3 xe10afn xvueqy4 xbixft x1hz01jw xtqrqnz x1778rvt xj57cvi",
278
- children: /* @__PURE__ */ b(d.Root, {
279
- invalid: D !== void 0,
305
+ children: /* @__PURE__ */ C(m.Root, {
306
+ invalid: E !== void 0,
280
307
  children: [
281
- /* @__PURE__ */ y(d.Label, {
282
- ...m.props(p.hidden),
308
+ /* @__PURE__ */ S(m.Label, {
309
+ ..._.props(g.hidden),
283
310
  children: e
284
311
  }),
285
- /* @__PURE__ */ b("div", {
312
+ /* @__PURE__ */ C("div", {
286
313
  ...{
287
314
  0: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 x1ey3b81 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep" },
288
315
  1: { className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1mvvolr xmkeg23 x1y0btm7 xy32g2j x1r7kqkb x1gd1hh4 x1u8w8hx x14xc8xn x1nvizq4 xgzwmep x1oddvo6" }
289
- }[D !== void 0 | 0],
316
+ }[E !== void 0 | 0],
290
317
  children: [
291
- /* @__PURE__ */ y(f, {
318
+ /* @__PURE__ */ S(h, {
292
319
  appearance: "plain",
293
- rows: w ? 1 : 2,
294
- compact: w,
320
+ rows: x ? 1 : 2,
321
+ isCompact: x,
295
322
  name: i,
296
323
  value: t,
297
324
  onChange: (e) => n(e.currentTarget.value),
298
325
  onKeyDown: I,
299
326
  placeholder: a ?? e,
300
327
  maxLength: o,
301
- required: c,
302
- disabled: h,
328
+ required: s,
329
+ disabled: u,
303
330
  readOnly: l,
304
- "aria-errormessage": D === void 0 ? void 0 : N
331
+ "aria-errormessage": E === void 0 ? void 0 : N
305
332
  }),
306
333
  k,
307
- /* @__PURE__ */ b("div", {
334
+ /* @__PURE__ */ C("div", {
308
335
  className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi",
309
- children: [O !== void 0 && /* @__PURE__ */ y("div", {
336
+ children: [D !== void 0 && /* @__PURE__ */ S("div", {
310
337
  className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi xeuugli x12lumcd",
311
- children: O
312
- }), /* @__PURE__ */ b(u.Root, { children: [/* @__PURE__ */ y(u.Trigger, { render: A === void 0 ? /* @__PURE__ */ y(s, {
313
- xstyle: q.action,
338
+ children: D
339
+ }), /* @__PURE__ */ C(d.Root, { children: [/* @__PURE__ */ S(d.Trigger, { render: A === void 0 ? /* @__PURE__ */ S(c, {
340
+ xstyle: X.action,
314
341
  type: "submit",
315
342
  variant: "solid",
316
- "aria-label": l ? x : v,
317
- disabled: h || g,
318
- pending: l,
319
- children: /* @__PURE__ */ y(S, {
343
+ "aria-label": l ? v : p,
344
+ disabled: u || f,
345
+ isPending: l,
346
+ children: /* @__PURE__ */ S(T, {
320
347
  size: 16,
321
348
  "aria-hidden": !0
322
349
  })
323
- }) : /* @__PURE__ */ y(s, {
324
- xstyle: q.action,
350
+ }) : /* @__PURE__ */ S(c, {
351
+ xstyle: X.action,
325
352
  type: "button",
326
353
  "aria-label": j ? "Stopping…" : M,
327
354
  onClick: (e) => {
328
355
  e.preventDefault(), A();
329
356
  },
330
- disabled: h,
331
- pending: j,
332
- children: /* @__PURE__ */ y(T, {
357
+ disabled: u,
358
+ isPending: j,
359
+ children: /* @__PURE__ */ S(O, {
333
360
  size: 14,
334
361
  "aria-hidden": !0
335
362
  })
336
- }) }), /* @__PURE__ */ y(u.Portal, { children: /* @__PURE__ */ y(u.Positioner, { children: /* @__PURE__ */ y(u.Popup, { children: F }) }) })] })]
363
+ }) }), /* @__PURE__ */ S(d.Portal, { children: /* @__PURE__ */ S(d.Positioner, { children: /* @__PURE__ */ S(d.Popup, { children: F }) }) })] })]
337
364
  })
338
365
  ]
339
366
  }),
340
- E !== void 0 && /* @__PURE__ */ y(d.Description, { children: E }),
341
- D !== void 0 && /* @__PURE__ */ y(d.Error, {
367
+ w !== void 0 && /* @__PURE__ */ S(m.Description, { children: w }),
368
+ E !== void 0 && /* @__PURE__ */ S(m.Error, {
342
369
  id: N,
343
370
  match: !0,
344
371
  role: "alert",
345
- children: D
372
+ children: E
346
373
  })
347
374
  ]
348
375
  })
349
376
  });
350
377
  }
351
378
  // packages/ai/src/sources.tsx
352
- function Y({ sources: e, label: t = "Sources" }) {
353
- return /* @__PURE__ */ b("section", {
379
+ function $({ sources: e, label: t = "Sources" }) {
380
+ return /* @__PURE__ */ C("section", {
354
381
  "aria-label": t,
355
382
  className: "x78zum5 xdt5ytf x1hnptsi xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft",
356
383
  children: [
357
- /* @__PURE__ */ y("h3", {
384
+ /* @__PURE__ */ S("h3", {
358
385
  className: "x1ghz6dp xtqrqnz x1778rvt xk4h15q xj0a0fe",
359
386
  children: t
360
387
  }),
361
- e.length === 0 && /* @__PURE__ */ y("p", {
388
+ e.length === 0 && /* @__PURE__ */ S("p", {
362
389
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
363
390
  children: "No sources supplied."
364
391
  }),
365
- /* @__PURE__ */ y("ol", {
392
+ /* @__PURE__ */ S("ol", {
366
393
  className: "x78zum5 xdt5ytf x1n8ia3y x1ghz6dp x1717udv x3ct3a4",
367
- children: e.map((e) => /* @__PURE__ */ b("li", {
394
+ children: e.map((e) => /* @__PURE__ */ C("li", {
368
395
  className: "x78zum5 xdt5ytf xfko13i xeuugli xj0a0fe",
369
- children: [/* @__PURE__ */ y("span", { children: /* @__PURE__ */ y(c, {
396
+ children: [/* @__PURE__ */ S("span", { children: /* @__PURE__ */ S(l, {
370
397
  href: e.href,
371
398
  children: e.title
372
- }) }), e.description !== void 0 && /* @__PURE__ */ y("p", {
399
+ }) }), e.description !== void 0 && /* @__PURE__ */ S("p", {
373
400
  className: "x1ghz6dp x153jb6y xy8obcc xas2l8k xj0a0fe",
374
401
  children: e.description
375
402
  })]
@@ -378,21 +405,21 @@ function Y({ sources: e, label: t = "Sources" }) {
378
405
  ]
379
406
  });
380
407
  }
381
- function X({ source: e, label: n }) {
382
- return /* @__PURE__ */ y("span", {
408
+ function ee({ source: e, label: n }) {
409
+ return /* @__PURE__ */ S("span", {
383
410
  className: "xt0psk2 x11njtxf xss6m8b",
384
- children: /* @__PURE__ */ b(l.Root, { children: [/* @__PURE__ */ y(l.Trigger, {
385
- render: /* @__PURE__ */ y(t, {}),
411
+ children: /* @__PURE__ */ C(u.Root, { children: [/* @__PURE__ */ S(u.Trigger, {
412
+ render: /* @__PURE__ */ S(t, {}),
386
413
  "aria-label": `Source ${n}: ${e.title}`,
387
414
  children: n
388
- }), /* @__PURE__ */ y(l.Portal, { children: /* @__PURE__ */ y(l.Positioner, {
415
+ }), /* @__PURE__ */ S(u.Portal, { children: /* @__PURE__ */ S(u.Positioner, {
389
416
  side: "top",
390
- children: /* @__PURE__ */ y(l.Popup, { children: /* @__PURE__ */ b(a, {
391
- compact: !0,
417
+ children: /* @__PURE__ */ S(u.Popup, { children: /* @__PURE__ */ C(o, {
418
+ isCompact: !0,
392
419
  children: [
393
- /* @__PURE__ */ y(l.Title, { children: e.title }),
394
- e.description !== void 0 && /* @__PURE__ */ y(l.Description, { children: e.description }),
395
- /* @__PURE__ */ y(c, {
420
+ /* @__PURE__ */ S(u.Title, { children: e.title }),
421
+ e.description !== void 0 && /* @__PURE__ */ S(u.Description, { children: e.description }),
422
+ /* @__PURE__ */ S(l, {
396
423
  href: e.href,
397
424
  children: "Open source"
398
425
  })
@@ -401,4 +428,4 @@ function X({ source: e, label: n }) {
401
428
  }) })] })
402
429
  });
403
430
  }
404
- export { k as Approval, R as Conversation, X as InlineCitation, H as Message, G as MessageAction, U as MessageAttachment, K as MessageBoundary, J as PromptInput, Y as Sources };
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 };