@devalok/shilp-sutra 0.43.0 → 0.44.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 (90) hide show
  1. package/MIGRATION.md +46 -0
  2. package/dist/_chunks/chat.js +163 -162
  3. package/dist/_chunks/chat.js.map +1 -1
  4. package/dist/_chunks/mention-suggestion.js +34 -32
  5. package/dist/_chunks/mention-suggestion.js.map +1 -1
  6. package/dist/_chunks/oauth-button.js +102 -97
  7. package/dist/_chunks/oauth-button.js.map +1 -1
  8. package/dist/_chunks/tree-view.js +1 -1
  9. package/dist/_chunks/tree-view.js.map +1 -1
  10. package/dist/ai/command-bar.js.map +1 -1
  11. package/dist/composed/command-palette.js +3 -3
  12. package/dist/composed/command-palette.js.map +1 -1
  13. package/dist/composed/content-card.d.ts +6 -0
  14. package/dist/composed/content-card.d.ts.map +1 -1
  15. package/dist/composed/content-card.js.map +1 -1
  16. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  17. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
  18. package/dist/composed/file-preview.d.ts.map +1 -1
  19. package/dist/composed/file-preview.js +146 -142
  20. package/dist/composed/file-preview.js.map +1 -1
  21. package/dist/composed/filter-bar.js +5 -2
  22. package/dist/composed/filter-bar.js.map +1 -1
  23. package/dist/composed/master-detail.js +1 -1
  24. package/dist/composed/master-detail.js.map +1 -1
  25. package/dist/composed/page-header.js +1 -1
  26. package/dist/composed/page-header.js.map +1 -1
  27. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  28. package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -1
  29. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  30. package/dist/composed/rich-chat-input.js +595 -586
  31. package/dist/composed/rich-chat-input.js.map +1 -1
  32. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  33. package/dist/composed/rich-text-editor.js +164 -162
  34. package/dist/composed/rich-text-editor.js.map +1 -1
  35. package/dist/hooks/index.d.ts +2 -2
  36. package/dist/hooks/index.d.ts.map +1 -1
  37. package/dist/shell/notification-center.d.ts.map +1 -1
  38. package/dist/shell/notification-center.js +101 -97
  39. package/dist/shell/notification-center.js.map +1 -1
  40. package/dist/shell/sidebar.d.ts.map +1 -1
  41. package/dist/shell/sidebar.js +137 -122
  42. package/dist/shell/sidebar.js.map +1 -1
  43. package/dist/shell/top-bar.d.ts.map +1 -1
  44. package/dist/shell/top-bar.js +86 -83
  45. package/dist/shell/top-bar.js.map +1 -1
  46. package/dist/tokens/semantic.css +1 -0
  47. package/dist/ui/avatar.js +1 -1
  48. package/dist/ui/avatar.js.map +1 -1
  49. package/dist/ui/breadcrumb.js +2 -2
  50. package/dist/ui/breadcrumb.js.map +1 -1
  51. package/dist/ui/button.js.map +1 -1
  52. package/dist/ui/card.d.ts +82 -7
  53. package/dist/ui/card.d.ts.map +1 -1
  54. package/dist/ui/card.js +74 -108
  55. package/dist/ui/card.js.map +1 -1
  56. package/dist/ui/chat/message.d.ts.map +1 -1
  57. package/dist/ui/combobox.js +2 -2
  58. package/dist/ui/combobox.js.map +1 -1
  59. package/dist/ui/dropdown-menu.js +9 -3
  60. package/dist/ui/dropdown-menu.js.map +1 -1
  61. package/dist/ui/index.d.ts +2 -1
  62. package/dist/ui/index.d.ts.map +1 -1
  63. package/dist/ui/index.js +58 -57
  64. package/dist/ui/index.js.map +1 -1
  65. package/dist/ui/menubar.js +9 -3
  66. package/dist/ui/menubar.js.map +1 -1
  67. package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -1
  68. package/dist/ui/select.js +5 -2
  69. package/dist/ui/select.js.map +1 -1
  70. package/dist/ui/sidebar.js +73 -73
  71. package/dist/ui/sidebar.js.map +1 -1
  72. package/dist/ui/stat-card.d.ts +8 -5
  73. package/dist/ui/stat-card.d.ts.map +1 -1
  74. package/dist/ui/stat-card.js +168 -150
  75. package/dist/ui/stat-card.js.map +1 -1
  76. package/dist/ui/tabs.d.ts.map +1 -1
  77. package/dist/ui/tabs.js +5 -2
  78. package/dist/ui/tabs.js.map +1 -1
  79. package/dist/ui/truncated-text.d.ts +37 -0
  80. package/dist/ui/truncated-text.d.ts.map +1 -0
  81. package/dist/ui/truncated-text.js +53 -0
  82. package/dist/ui/truncated-text.js.map +1 -0
  83. package/docs/components/ui/card.md +13 -4
  84. package/docs/components/ui/stat-card.md +7 -2
  85. package/docs/components/ui/truncated-text.md +49 -0
  86. package/llms-full.txt +70 -7
  87. package/make-kit/components/card.md +14 -4
  88. package/package.json +1 -1
  89. package/skill/SKILL.md +1 -1
  90. package/skill/references/components-full.md +70 -7
@@ -7,46 +7,47 @@ import { Icon as o } from "../ui/icon.js";
7
7
  import { Avatar as s, AvatarFallback as c, AvatarImage as l } from "../ui/avatar.js";
8
8
  import { t as u } from "./normalize-icon.js";
9
9
  import { Button as d } from "../ui/button.js";
10
- import { Tooltip as f, TooltipContent as p, TooltipTrigger as m } from "../ui/tooltip.js";
11
- import * as h from "react";
12
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
- import { IconAlertCircle as v, IconSend as y, IconSquare as b, IconTrash as x } from "@tabler/icons-react";
14
- import { AnimatePresence as S, motion as C } from "framer-motion";
10
+ import { Textarea as f } from "../ui/textarea.js";
11
+ import { Tooltip as p, TooltipContent as m, TooltipTrigger as h } from "../ui/tooltip.js";
12
+ import * as g from "react";
13
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { IconAlertCircle as y, IconSend as b, IconSquare as x, IconTrash as S } from "@tabler/icons-react";
15
+ import { AnimatePresence as C, motion as w } from "framer-motion";
15
16
  //#region src/ui/chat/date-separator.tsx
16
- function w(e) {
17
+ function T(e) {
17
18
  let t = /* @__PURE__ */ new Date(), n = new Date(t.getFullYear(), t.getMonth(), t.getDate()), r = new Date(e.getFullYear(), e.getMonth(), e.getDate()), i = n.getTime() - r.getTime(), a = Math.round(i / (1e3 * 60 * 60 * 24));
18
19
  if (a === 0) return "Today";
19
20
  if (a === 1) return "Yesterday";
20
21
  let o = e.toLocaleString("en-US", { month: "short" }), s = e.getDate();
21
22
  return e.getFullYear() === t.getFullYear() ? `${o} ${s}` : `${o} ${s}, ${e.getFullYear()}`;
22
23
  }
23
- function T({ date: e, format: t, className: n }) {
24
- let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) : w(r);
25
- return /* @__PURE__ */ _("div", {
24
+ function E({ date: e, format: t, className: n }) {
25
+ let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) : T(r);
26
+ return /* @__PURE__ */ v("div", {
26
27
  className: i("flex items-center gap-ds-03 py-ds-03", n),
27
28
  children: [
28
- /* @__PURE__ */ g("div", { className: "flex-1 border-t border-surface-border-subtle" }),
29
- /* @__PURE__ */ g("span", {
29
+ /* @__PURE__ */ _("div", { className: "flex-1 border-t border-surface-border-subtle" }),
30
+ /* @__PURE__ */ _("span", {
30
31
  className: "text-ds-xs font-medium text-surface-fg-subtle/50 uppercase tracking-wider",
31
32
  children: a
32
33
  }),
33
- /* @__PURE__ */ g("div", { className: "flex-1 border-t border-surface-border-subtle" })
34
+ /* @__PURE__ */ _("div", { className: "flex-1 border-t border-surface-border-subtle" })
34
35
  ]
35
36
  });
36
37
  }
37
- T.displayName = "DateSeparator";
38
+ E.displayName = "DateSeparator";
38
39
  //#endregion
39
40
  //#region src/ui/chat/message.tsx
40
- var E = h.createContext({
41
+ var D = g.createContext({
41
42
  variant: "flat",
42
43
  placement: "start",
43
44
  grouped: !1
44
45
  });
45
- function D() {
46
- return h.useContext(E);
46
+ function O() {
47
+ return g.useContext(D);
47
48
  }
48
- var O = h.forwardRef(({ children: e, variant: r = "flat", placement: a = "start", highlight: s, grouped: c = !1, deleted: l = !1, deletedText: u = "This message was deleted", className: d, ...f }, p) => {
49
- let m = h.useMemo(() => ({
49
+ var k = g.forwardRef(({ children: e, variant: r = "flat", placement: a = "start", highlight: s, grouped: c = !1, deleted: l = !1, deletedText: u = "This message was deleted", className: d, ...f }, p) => {
50
+ let m = g.useMemo(() => ({
50
51
  variant: r,
51
52
  placement: a,
52
53
  grouped: c,
@@ -57,7 +58,7 @@ var O = h.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
57
58
  c,
58
59
  s
59
60
  ]);
60
- return l ? /* @__PURE__ */ _(C.div, {
61
+ return l ? /* @__PURE__ */ v(w.div, {
61
62
  ref: p,
62
63
  initial: {
63
64
  opacity: 0,
@@ -70,13 +71,13 @@ var O = h.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
70
71
  transition: n.snappy,
71
72
  className: i("flex items-center gap-ds-02 py-ds-02 text-ds-xs text-surface-fg-subtle/50 italic", d),
72
73
  ...t(f),
73
- children: [/* @__PURE__ */ g(o, {
74
- icon: x,
74
+ children: [/* @__PURE__ */ _(o, {
75
+ icon: S,
75
76
  size: "xs"
76
77
  }), u]
77
- }) : r === "bubble" ? /* @__PURE__ */ g(E.Provider, {
78
+ }) : r === "bubble" ? /* @__PURE__ */ _(D.Provider, {
78
79
  value: m,
79
- children: /* @__PURE__ */ g(C.div, {
80
+ children: /* @__PURE__ */ _(w.div, {
80
81
  ref: p,
81
82
  initial: {
82
83
  opacity: 0,
@@ -87,16 +88,16 @@ var O = h.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
87
88
  y: 0
88
89
  },
89
90
  transition: n.snappy,
90
- className: i("group/message relative flex", a === "end" ? "justify-end" : "justify-start", s === "mention" && "border-l-2 border-l-accent-9 bg-accent-2 pl-ds-03 rounded-control-inner", s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
91
+ className: i("group/message relative flex", a === "end" ? "justify-end" : "justify-start", s === "mention" && "bg-accent-2 pl-ds-03 rounded-control-inner", s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
91
92
  ...t(f),
92
- children: /* @__PURE__ */ g("div", {
93
+ children: /* @__PURE__ */ _("div", {
93
94
  className: i("max-w-[85%] rounded-bubble px-ds-04 py-ds-03", a === "end" ? "bg-accent-3 text-surface-fg" : "bg-surface-raised text-surface-fg"),
94
95
  children: e
95
96
  })
96
97
  })
97
- }) : /* @__PURE__ */ g(E.Provider, {
98
+ }) : /* @__PURE__ */ _(D.Provider, {
98
99
  value: m,
99
- children: /* @__PURE__ */ g(C.div, {
100
+ children: /* @__PURE__ */ _(w.div, {
100
101
  ref: p,
101
102
  initial: {
102
103
  opacity: 0,
@@ -113,106 +114,106 @@ var O = h.forwardRef(({ children: e, variant: r = "flat", placement: a = "start"
113
114
  })
114
115
  });
115
116
  });
116
- O.displayName = "Message";
117
- function k({ src: t, fallback: n, icon: r, size: a = "md", children: o }) {
118
- let { grouped: d } = D(), f = a === "sm" ? "w-5" : "w-6";
119
- return d ? /* @__PURE__ */ g("div", { className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0") }) : o ? /* @__PURE__ */ g("div", {
117
+ k.displayName = "Message";
118
+ function A({ src: t, fallback: n, icon: r, size: a = "md", children: o }) {
119
+ let { grouped: d } = O(), f = a === "sm" ? "w-5" : "w-6";
120
+ return d ? /* @__PURE__ */ _("div", { className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0") }) : o ? /* @__PURE__ */ _("div", {
120
121
  className: i(f, "shrink-0 flex items-start"),
121
122
  children: o
122
- }) : r ? /* @__PURE__ */ g("div", {
123
+ }) : r ? /* @__PURE__ */ _("div", {
123
124
  className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0 flex items-center justify-center rounded-pill bg-surface-raised-hover"),
124
- children: /* @__PURE__ */ g(e, {
125
+ children: /* @__PURE__ */ _(e, {
125
126
  size: a === "sm" ? "xs" : "sm",
126
127
  children: u(r)
127
128
  })
128
- }) : /* @__PURE__ */ g("div", {
129
+ }) : /* @__PURE__ */ _("div", {
129
130
  className: i(f, "shrink-0"),
130
- children: /* @__PURE__ */ _(s, {
131
+ children: /* @__PURE__ */ v(s, {
131
132
  size: a === "sm" ? "xs" : "sm",
132
- children: [t && /* @__PURE__ */ g(l, {
133
+ children: [t && /* @__PURE__ */ _(l, {
133
134
  src: t,
134
135
  alt: n ?? ""
135
- }), /* @__PURE__ */ g(c, { children: n ?? "" })]
136
+ }), /* @__PURE__ */ _(c, { children: n ?? "" })]
136
137
  })
137
138
  });
138
139
  }
139
- k.displayName = "Message.Avatar";
140
- function A({ children: e, className: t, ...n }) {
141
- return /* @__PURE__ */ g("div", {
140
+ A.displayName = "Message.Avatar";
141
+ function j({ children: e, className: t, ...n }) {
142
+ return /* @__PURE__ */ _("div", {
142
143
  className: i("min-w-0 flex-1 flex flex-col gap-ds-02", t),
143
144
  ...n,
144
145
  children: e
145
146
  });
146
147
  }
147
- A.displayName = "Message.Content";
148
- function j(e) {
148
+ j.displayName = "Message.Content";
149
+ function M(e) {
149
150
  return e.toLocaleTimeString("en-US", {
150
151
  hour: "numeric",
151
152
  minute: "2-digit"
152
153
  });
153
154
  }
154
- function M({ name: e, badge: t, timestamp: n, formattedTimestamp: r, timestampFormat: i = j }) {
155
- let { grouped: a } = D();
155
+ function N({ name: e, badge: t, timestamp: n, formattedTimestamp: r, timestampFormat: i = M }) {
156
+ let { grouped: a } = O();
156
157
  if (a) return null;
157
158
  let o = r ?? (n ? i(n) : void 0);
158
- return /* @__PURE__ */ _("div", {
159
+ return /* @__PURE__ */ v("div", {
159
160
  className: "flex items-baseline gap-ds-02",
160
161
  children: [
161
- /* @__PURE__ */ g("span", {
162
+ /* @__PURE__ */ _("span", {
162
163
  className: "font-semibold text-[13px] text-surface-fg",
163
164
  children: e
164
165
  }),
165
166
  t,
166
- o && /* @__PURE__ */ g("span", {
167
+ o && /* @__PURE__ */ _("span", {
167
168
  className: "text-[11px] text-surface-fg-subtle/50",
168
169
  children: o
169
170
  })
170
171
  ]
171
172
  });
172
173
  }
173
- M.displayName = "Message.Author";
174
- function N({ children: e, className: t, ...n }) {
175
- return /* @__PURE__ */ g("div", {
174
+ N.displayName = "Message.Author";
175
+ function P({ children: e, className: t, ...n }) {
176
+ return /* @__PURE__ */ _("div", {
176
177
  className: i("text-[13px] leading-relaxed text-surface-fg whitespace-pre-wrap", t),
177
178
  ...n,
178
179
  children: e
179
180
  });
180
181
  }
181
- N.displayName = "Message.Body";
182
- function P({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent: a }) {
183
- let [o, s] = h.useState(!1), [c, l] = h.useState(e), u = h.useRef(null);
184
- h.useEffect(() => {
182
+ P.displayName = "Message.Body";
183
+ function F({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent: a }) {
184
+ let [o, s] = g.useState(!1), [c, l] = g.useState(e), u = g.useRef(null);
185
+ g.useEffect(() => {
185
186
  o && u.current && (u.current.focus(), u.current.select());
186
187
  }, [o]);
187
- let d = h.useCallback(() => {
188
+ let d = g.useCallback(() => {
188
189
  r && (l(e), s(!0));
189
- }, [r, e]), f = h.useCallback(() => {
190
+ }, [r, e]), p = g.useCallback(() => {
190
191
  let n = c.trim();
191
192
  n && n !== e && t(n), s(!1);
192
193
  }, [
193
194
  c,
194
195
  e,
195
196
  t
196
- ]), p = h.useCallback(() => {
197
+ ]), m = g.useCallback(() => {
197
198
  s(!1), l(e), n?.();
198
- }, [e, n]), m = h.useCallback((e) => {
199
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), f()) : e.key === "Escape" && (e.preventDefault(), p());
200
- }, [f, p]);
201
- return o ? /* @__PURE__ */ _("div", {
199
+ }, [e, n]), h = g.useCallback((e) => {
200
+ e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), p()) : e.key === "Escape" && (e.preventDefault(), m());
201
+ }, [p, m]);
202
+ return o ? /* @__PURE__ */ v("div", {
202
203
  className: "text-[13px] leading-relaxed",
203
- children: [/* @__PURE__ */ g("textarea", {
204
+ children: [/* @__PURE__ */ _(f, {
204
205
  ref: u,
205
206
  value: c,
206
207
  onChange: (e) => l(e.target.value),
207
- onKeyDown: m,
208
- onBlur: f,
209
- className: "w-full resize-none rounded-control-inner border border-surface-border-strong bg-surface-raised-hover px-ds-02 py-ds-01 text-[13px] leading-relaxed text-surface-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9",
208
+ onKeyDown: h,
209
+ onBlur: p,
210
+ className: "resize-none rounded-control-inner bg-surface-raised-hover px-ds-02 py-ds-01 text-[13px] leading-relaxed",
210
211
  rows: 2
211
- }), /* @__PURE__ */ g("div", {
212
+ }), /* @__PURE__ */ _("div", {
212
213
  className: "mt-ds-01 text-ds-xs text-surface-fg-subtle/50",
213
214
  children: "Enter to save · Escape to cancel"
214
215
  })]
215
- }) : /* @__PURE__ */ g("div", {
216
+ }) : /* @__PURE__ */ _("div", {
216
217
  className: i("text-[13px] leading-relaxed text-surface-fg whitespace-pre-wrap", r && "cursor-pointer hover:bg-surface-raised-hover rounded-control-inner transition-colors"),
217
218
  onClick: d,
218
219
  role: r ? "button" : void 0,
@@ -223,80 +224,80 @@ function P({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent:
223
224
  children: a ? a(e) : e
224
225
  });
225
226
  }
226
- P.displayName = "Message.EditableBody";
227
- function F({ reactions: e, onReact: t }) {
228
- return e.length === 0 ? null : /* @__PURE__ */ g("div", {
227
+ F.displayName = "Message.EditableBody";
228
+ function I({ reactions: e, onReact: t }) {
229
+ return e.length === 0 ? null : /* @__PURE__ */ _("div", {
229
230
  className: "flex flex-wrap gap-ds-02 mt-ds-03",
230
- children: e.map((e) => /* @__PURE__ */ _("button", {
231
+ children: e.map((e) => /* @__PURE__ */ v("button", {
231
232
  type: "button",
232
233
  onClick: () => t(e.emoji),
233
234
  "aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}${e.reacted ? ", you reacted" : ""}`,
234
235
  className: i("inline-flex items-center gap-ds-01 rounded-pill px-ds-02 py-ds-01 text-ds-xs transition-colors", e.reacted ? "bg-accent-3 ring-1 ring-accent-6" : "bg-surface-raised-hover hover:bg-surface-raised-active"),
235
- children: [/* @__PURE__ */ g("span", { children: e.emoji }), /* @__PURE__ */ g("span", { children: e.count })]
236
+ children: [/* @__PURE__ */ _("span", { children: e.emoji }), /* @__PURE__ */ _("span", { children: e.count })]
236
237
  }, e.emoji))
237
238
  });
238
239
  }
239
- F.displayName = "Message.Reactions";
240
- function I({ children: e, delay: t = 100 }) {
241
- return /* @__PURE__ */ g("div", {
240
+ I.displayName = "Message.Reactions";
241
+ function L({ children: e, delay: t = 100 }) {
242
+ return /* @__PURE__ */ _("div", {
242
243
  className: i("absolute -top-2 right-0 z-10", "flex items-center gap-ds-01 rounded-control bg-surface-raised px-ds-01 py-ds-01 shadow-raised", "opacity-0 group-hover/message:opacity-100 group-focus-within/message:opacity-100 transition-opacity duration-150"),
243
244
  style: { transitionDelay: `${t}ms` },
244
245
  children: e
245
246
  });
246
247
  }
247
- I.displayName = "Message.Actions";
248
- function L({ icon: t, label: n, onClick: r, variant: a = "default" }) {
249
- return /* @__PURE__ */ _(f, { children: [/* @__PURE__ */ g(m, {
248
+ L.displayName = "Message.Actions";
249
+ function R({ icon: t, label: n, onClick: r, variant: a = "default" }) {
250
+ return /* @__PURE__ */ v(p, { children: [/* @__PURE__ */ _(h, {
250
251
  asChild: !0,
251
- children: /* @__PURE__ */ g("button", {
252
+ children: /* @__PURE__ */ _("button", {
252
253
  type: "button",
253
254
  onClick: r,
254
255
  "aria-label": n,
255
256
  className: i("p-ds-02 rounded-control-inner transition-colors", a === "default" && "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", a === "danger" && "text-surface-fg-subtle hover:text-error-11 hover:bg-surface-raised-hover"),
256
- children: /* @__PURE__ */ g(e, {
257
+ children: /* @__PURE__ */ _(e, {
257
258
  size: "xs",
258
259
  children: u(t)
259
260
  })
260
261
  })
261
- }), /* @__PURE__ */ g(p, { children: n })] });
262
+ }), /* @__PURE__ */ _(m, { children: n })] });
262
263
  }
263
- L.displayName = "Message.Action";
264
- var R = Object.assign(O, {
265
- Avatar: k,
266
- Content: A,
267
- Author: M,
268
- Body: N,
269
- EditableBody: P,
270
- Reactions: F,
271
- Actions: I,
272
- Action: L
273
- }), z = h.forwardRef(({ onSubmit: e, placeholder: t = "Type a message...", disabled: n = !1, isStreaming: r = !1, onCancel: a, leadingSlot: s, trailingSlot: c, disclaimer: l, sendIcon: u, className: f, ...p }, m) => {
274
- let [v, x] = h.useState(""), S = h.useRef(null), C = h.useCallback(() => {
264
+ R.displayName = "Message.Action";
265
+ var z = Object.assign(k, {
266
+ Avatar: A,
267
+ Content: j,
268
+ Author: N,
269
+ Body: P,
270
+ EditableBody: F,
271
+ Reactions: I,
272
+ Actions: L,
273
+ Action: R
274
+ }), B = g.forwardRef(({ onSubmit: e, placeholder: t = "Type a message...", disabled: n = !1, isStreaming: r = !1, onCancel: a, leadingSlot: s, trailingSlot: c, disclaimer: l, sendIcon: u, className: f, ...p }, m) => {
275
+ let [h, y] = g.useState(""), S = g.useRef(null), C = g.useCallback(() => {
275
276
  let e = S.current;
276
277
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
277
- }, []), w = h.useCallback((e) => {
278
- x(e.target.value), C();
279
- }, [C]), T = h.useCallback(() => {
280
- let t = v.trim();
281
- !t || r || (e(t), x(""), S.current && (S.current.style.height = "auto"));
278
+ }, []), w = g.useCallback((e) => {
279
+ y(e.target.value), C();
280
+ }, [C]), T = g.useCallback(() => {
281
+ let t = h.trim();
282
+ !t || r || (e(t), y(""), S.current && (S.current.style.height = "auto"));
282
283
  }, [
283
- v,
284
+ h,
284
285
  r,
285
286
  e
286
- ]), E = h.useCallback((e) => {
287
+ ]), E = g.useCallback((e) => {
287
288
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), r || T());
288
- }, [r, T]), D = v.trim().length === 0;
289
- return /* @__PURE__ */ _("div", {
289
+ }, [r, T]), D = h.trim().length === 0;
290
+ return /* @__PURE__ */ v("div", {
290
291
  ref: m,
291
292
  className: i("border-t border-surface-border-subtle px-ds-05 py-ds-04", f),
292
293
  ...p,
293
- children: [/* @__PURE__ */ _("div", {
294
+ children: [/* @__PURE__ */ v("div", {
294
295
  className: "flex items-end gap-ds-02 rounded-overlay-lg border border-surface-border bg-surface-base p-ds-03",
295
296
  children: [
296
297
  s,
297
- /* @__PURE__ */ g("textarea", {
298
+ /* @__PURE__ */ _("textarea", {
298
299
  ref: S,
299
- value: v,
300
+ value: h,
300
301
  onChange: w,
301
302
  onKeyDown: E,
302
303
  placeholder: t,
@@ -306,50 +307,50 @@ var R = Object.assign(O, {
306
307
  className: "flex-1 resize-none bg-transparent px-ds-02 py-ds-01 text-ds-sm text-surface-fg placeholder:text-surface-fg-subtle/50 focus:outline-hidden disabled:opacity-50",
307
308
  style: { maxHeight: 160 }
308
309
  }),
309
- r ? /* @__PURE__ */ g(d, {
310
+ r ? /* @__PURE__ */ _(d, {
310
311
  variant: "ghost",
311
312
  size: "icon-sm",
312
313
  color: "error",
313
314
  onClick: a,
314
315
  "aria-label": "Stop",
315
- children: /* @__PURE__ */ g(o, {
316
- icon: b,
316
+ children: /* @__PURE__ */ _(o, {
317
+ icon: x,
317
318
  size: "sm"
318
319
  })
319
- }) : /* @__PURE__ */ g(d, {
320
+ }) : /* @__PURE__ */ _(d, {
320
321
  variant: "ghost",
321
322
  size: "icon-sm",
322
323
  onClick: T,
323
324
  disabled: D || n,
324
325
  "aria-label": "Send",
325
- children: u ?? /* @__PURE__ */ g(o, {
326
- icon: y,
326
+ children: u ?? /* @__PURE__ */ _(o, {
327
+ icon: b,
327
328
  size: "sm"
328
329
  })
329
330
  }),
330
331
  c
331
332
  ]
332
- }), l && /* @__PURE__ */ g("p", {
333
+ }), l && /* @__PURE__ */ _("p", {
333
334
  className: "mt-ds-02 text-center text-ds-xs text-surface-fg-subtle/50",
334
335
  children: l
335
336
  })]
336
337
  });
337
338
  });
338
- z.displayName = "MessageInput";
339
+ B.displayName = "MessageInput";
339
340
  //#endregion
340
341
  //#region src/ui/chat/message-list.tsx
341
- var B = h.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0, onScrollToBottom: o, onLoadMore: s, loadingMore: c = !1, emptySlot: l, scrollToBottomSlot: u, headerSlot: d, className: f, ...p }, m) => {
342
- let v = h.useRef(null), y = h.useRef(!0), [b, x] = h.useState(!0), w = h.useRef(!1), T = h.useRef(0), E = h.Children.count(e) === 0 && !c, D = h.useCallback(() => {
343
- let e = v.current;
342
+ var V = g.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0, onScrollToBottom: o, onLoadMore: s, loadingMore: c = !1, emptySlot: l, scrollToBottomSlot: u, headerSlot: d, className: f, ...p }, m) => {
343
+ let h = g.useRef(null), y = g.useRef(!0), [b, x] = g.useState(!0), S = g.useRef(!1), T = g.useRef(0), E = g.Children.count(e) === 0 && !c, D = g.useCallback(() => {
344
+ let e = h.current;
344
345
  if (!e) return;
345
346
  let t = e.scrollHeight - e.scrollTop - e.clientHeight < 40;
346
- y.current = t, x(t), e.scrollTop < 100 && s && !w.current && (w.current = !0, T.current = e.scrollHeight, s());
347
+ y.current = t, x(t), e.scrollTop < 100 && s && !S.current && (S.current = !0, T.current = e.scrollHeight, s());
347
348
  }, [s]);
348
- h.useLayoutEffect(() => {
349
- let e = v.current;
349
+ g.useLayoutEffect(() => {
350
+ let e = h.current;
350
351
  if (e) {
351
- if (w.current) {
352
- e.scrollTop = e.scrollHeight - T.current, w.current = !1;
352
+ if (S.current) {
353
+ e.scrollTop = e.scrollHeight - T.current, S.current = !1;
353
354
  return;
354
355
  }
355
356
  t && y.current && e.scrollTo({
@@ -357,24 +358,24 @@ var B = h.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
357
358
  behavior: "smooth"
358
359
  });
359
360
  }
360
- }, [e, t]), h.useEffect(() => {
361
- c || (w.current = !1);
361
+ }, [e, t]), g.useEffect(() => {
362
+ c || (S.current = !1);
362
363
  }, [c]);
363
- let O = n > 0 && !b, k = h.useCallback(() => {
364
- let e = v.current;
364
+ let O = n > 0 && !b, k = g.useCallback(() => {
365
+ let e = h.current;
365
366
  e && e.scrollTo({
366
367
  top: e.scrollHeight,
367
368
  behavior: "smooth"
368
369
  }), o?.();
369
370
  }, [o]);
370
- return /* @__PURE__ */ _("div", {
371
+ return /* @__PURE__ */ v("div", {
371
372
  ref: m,
372
373
  className: i("relative flex flex-1 flex-col overflow-hidden", f),
373
374
  ...p,
374
375
  children: [
375
376
  d,
376
- /* @__PURE__ */ _("div", {
377
- ref: v,
377
+ /* @__PURE__ */ v("div", {
378
+ ref: h,
378
379
  role: "log",
379
380
  "aria-live": "polite",
380
381
  "aria-relevant": "additions",
@@ -384,18 +385,18 @@ var B = h.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
384
385
  scrollbarColor: "var(--color-surface-border) transparent"
385
386
  },
386
387
  onScroll: D,
387
- children: [c && /* @__PURE__ */ g("div", {
388
+ children: [c && /* @__PURE__ */ _("div", {
388
389
  className: "flex justify-center py-ds-03",
389
- children: /* @__PURE__ */ g(a, { size: "sm" })
390
- }), E ? l : /* @__PURE__ */ g("div", {
390
+ children: /* @__PURE__ */ _(a, { size: "sm" })
391
+ }), E ? l : /* @__PURE__ */ _("div", {
391
392
  className: "flex flex-col gap-ds-04",
392
- children: /* @__PURE__ */ g(S, {
393
+ children: /* @__PURE__ */ _(C, {
393
394
  initial: !1,
394
395
  children: e
395
396
  })
396
397
  })]
397
398
  }),
398
- /* @__PURE__ */ g(S, { children: O && /* @__PURE__ */ _(C.button, {
399
+ /* @__PURE__ */ _(C, { children: O && /* @__PURE__ */ v(w.button, {
399
400
  initial: {
400
401
  opacity: 0,
401
402
  y: 10
@@ -416,76 +417,76 @@ var B = h.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
416
417
  ]
417
418
  });
418
419
  });
419
- B.displayName = "MessageList";
420
+ V.displayName = "MessageList";
420
421
  //#endregion
421
422
  //#region src/ui/chat/system-message.tsx
422
- function V(e) {
423
+ function H(e) {
423
424
  return new Date(e).toLocaleTimeString("en-US", {
424
425
  hour: "numeric",
425
426
  minute: "2-digit"
426
427
  });
427
428
  }
428
- var H = h.forwardRef(({ icon: t, timestamp: n, variant: r = "event", children: a, className: s, ...c }, l) => r === "alert" ? /* @__PURE__ */ g("div", {
429
+ var U = g.forwardRef(({ icon: t, timestamp: n, variant: r = "event", children: a, className: s, ...c }, l) => r === "alert" ? /* @__PURE__ */ _("div", {
429
430
  ref: l,
430
431
  role: "alert",
431
432
  className: i("flex justify-center", s),
432
433
  ...c,
433
- children: /* @__PURE__ */ _("div", {
434
+ children: /* @__PURE__ */ v("div", {
434
435
  className: "flex items-center gap-ds-03 rounded-surface bg-error-3 px-ds-04 py-ds-03",
435
436
  children: [
436
- /* @__PURE__ */ g(e, {
437
+ /* @__PURE__ */ _(e, {
437
438
  size: "sm",
438
- children: u(t) ?? /* @__PURE__ */ g(o, { icon: v })
439
+ children: u(t) ?? /* @__PURE__ */ _(o, { icon: y })
439
440
  }),
440
- /* @__PURE__ */ g("span", {
441
+ /* @__PURE__ */ _("span", {
441
442
  className: "text-ds-sm text-error-11",
442
443
  children: a
443
444
  }),
444
- n && /* @__PURE__ */ g("span", {
445
+ n && /* @__PURE__ */ _("span", {
445
446
  className: "text-ds-sm text-error-11/60",
446
- children: V(n)
447
+ children: H(n)
447
448
  })
448
449
  ]
449
450
  })
450
- }) : /* @__PURE__ */ _("div", {
451
+ }) : /* @__PURE__ */ v("div", {
451
452
  ref: l,
452
453
  className: i("flex items-center gap-ds-02 rounded-control-inner bg-surface-raised-hover/30 px-ds-02 py-ds-01 -mx-ds-02 text-ds-sm text-surface-fg-subtle/60", s),
453
454
  ...c,
454
455
  children: [
455
- /* @__PURE__ */ g(e, {
456
+ /* @__PURE__ */ _(e, {
456
457
  size: "xs",
457
458
  children: u(t)
458
459
  }),
459
- /* @__PURE__ */ g("span", {
460
+ /* @__PURE__ */ _("span", {
460
461
  className: "flex-1",
461
462
  children: a
462
463
  }),
463
- n && /* @__PURE__ */ g("span", { children: V(n) })
464
+ n && /* @__PURE__ */ _("span", { children: H(n) })
464
465
  ]
465
466
  }));
466
- H.displayName = "SystemMessage";
467
+ U.displayName = "SystemMessage";
467
468
  //#endregion
468
469
  //#region src/ui/chat/typing-indicator.tsx
469
- function U(e) {
470
+ function W(e) {
470
471
  return e.length === 1 ? `${e[0].name} is typing...` : e.length === 2 ? `${e[0].name} and ${e[1].name} are typing...` : "Several people are typing...";
471
472
  }
472
- function W({ users: e, className: t }) {
473
- return /* @__PURE__ */ g("div", {
473
+ function G({ users: e, className: t }) {
474
+ return /* @__PURE__ */ _("div", {
474
475
  className: i("min-h-[24px] px-ds-05", t),
475
476
  role: "status",
476
477
  "aria-live": "polite",
477
- children: /* @__PURE__ */ g(S, { children: e.length > 0 && /* @__PURE__ */ _(C.div, {
478
+ children: /* @__PURE__ */ _(C, { children: e.length > 0 && /* @__PURE__ */ v(w.div, {
478
479
  initial: { opacity: 0 },
479
480
  animate: { opacity: 1 },
480
481
  exit: { opacity: 0 },
481
482
  className: "flex items-center gap-ds-02 text-ds-xs text-surface-fg-subtle",
482
- children: [/* @__PURE__ */ g("span", {
483
+ children: [/* @__PURE__ */ _("span", {
483
484
  className: "flex items-center gap-ds-01",
484
485
  children: [
485
486
  0,
486
487
  1,
487
488
  2
488
- ].map((e) => /* @__PURE__ */ g(C.span, {
489
+ ].map((e) => /* @__PURE__ */ _(w.span, {
489
490
  className: "h-1 w-1 rounded-pill bg-surface-fg-subtle",
490
491
  animate: { y: [
491
492
  0,
@@ -498,26 +499,26 @@ function W({ users: e, className: t }) {
498
499
  delay: e * .15
499
500
  }
500
501
  }, e))
501
- }), /* @__PURE__ */ g("span", { children: U(e) })]
502
+ }), /* @__PURE__ */ _("span", { children: W(e) })]
502
503
  }) })
503
504
  });
504
505
  }
505
- W.displayName = "TypingIndicator";
506
+ G.displayName = "TypingIndicator";
506
507
  //#endregion
507
508
  //#region src/ui/chat/unread-separator.tsx
508
- function G({ label: e = "NEW", count: t, className: n }) {
509
- return /* @__PURE__ */ _("div", {
509
+ function K({ label: e = "NEW", count: t, className: n }) {
510
+ return /* @__PURE__ */ v("div", {
510
511
  className: i("relative flex items-center py-ds-02", n),
511
512
  children: [
512
- /* @__PURE__ */ g("div", { className: "flex-1 border-t-2 border-accent-7" }),
513
- /* @__PURE__ */ g("span", {
513
+ /* @__PURE__ */ _("div", { className: "flex-1 border-t-2 border-accent-7" }),
514
+ /* @__PURE__ */ _("span", {
514
515
  className: "px-ds-03 text-ds-xs font-semibold text-accent-11",
515
516
  children: t ? `${t} ${e}` : e
516
517
  }),
517
- /* @__PURE__ */ g("div", { className: "flex-1 border-t-2 border-accent-7" })
518
+ /* @__PURE__ */ _("div", { className: "flex-1 border-t-2 border-accent-7" })
518
519
  ]
519
520
  });
520
521
  }
521
- G.displayName = "UnreadSeparator";
522
+ K.displayName = "UnreadSeparator";
522
523
  //#endregion
523
- export { z as a, T as c, B as i, W as n, R as o, H as r, D as s, G as t };
524
+ export { B as a, E as c, V as i, G as n, z as o, U as r, O as s, K as t };