@devalok/shilp-sutra 0.42.1 → 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.
- package/MIGRATION.md +78 -0
- package/dist/_chunks/chat.js +164 -163
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +35 -33
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/oauth-button.js +102 -97
- package/dist/_chunks/oauth-button.js.map +1 -1
- package/dist/_chunks/popover.js +1 -1
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/shared.js +1 -1
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/tree-view.js +1 -1
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/ai/command-bar.js +1 -1
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/composed/bulk-action-bar.js +1 -1
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.js +4 -4
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.d.ts +6 -0
- package/dist/composed/content-card.d.ts.map +1 -1
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/error-boundary.js +1 -1
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/extensions/emoji-suggestion.js +1 -1
- package/dist/composed/extensions/emoji-suggestion.js.map +1 -1
- package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +147 -143
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.js +5 -2
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/master-detail.js +1 -1
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/page-header.js +1 -1
- package/dist/composed/page-header.js.map +1 -1
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +600 -591
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +166 -164
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +102 -98
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/sidebar.d.ts +6 -0
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +142 -118
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +87 -84
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/semantic.css +9 -2
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/autocomplete.js +1 -1
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/breadcrumb.js +2 -2
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts +82 -7
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +76 -110
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/color-input.js +1 -1
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/combobox.js +3 -3
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.js +2 -2
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.js +1 -1
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.js +11 -5
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/hover-card.js +1 -1
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +58 -56
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/menubar.js +12 -6
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.js +1 -1
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -1
- package/dist/ui/select.js +6 -3
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sidebar.js +74 -74
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/split-button.js +1 -1
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +26 -3
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +183 -150
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/stat-flash.d.ts +46 -0
- package/dist/ui/stat-flash.d.ts.map +1 -0
- package/dist/ui/stat-flash.js +114 -0
- package/dist/ui/stat-flash.js.map +1 -0
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +5 -2
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/toast.js +2 -2
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/truncated-text.d.ts +37 -0
- package/dist/ui/truncated-text.d.ts.map +1 -0
- package/dist/ui/truncated-text.js +53 -0
- package/dist/ui/truncated-text.js.map +1 -0
- package/docs/components/ui/card.md +13 -4
- package/docs/components/ui/stat-card.md +18 -3
- package/docs/components/ui/stat-flash.md +44 -0
- package/docs/components/ui/truncated-text.md +49 -0
- package/llms-full.txt +125 -8
- package/make-kit/components/card.md +14 -4
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/components-full.md +125 -8
package/dist/_chunks/chat.js
CHANGED
|
@@ -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 {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
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
|
|
24
|
-
let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) :
|
|
25
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
29
|
-
/* @__PURE__ */
|
|
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__ */
|
|
34
|
+
/* @__PURE__ */ _("div", { className: "flex-1 border-t border-surface-border-subtle" })
|
|
34
35
|
]
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
+
E.displayName = "DateSeparator";
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/ui/chat/message.tsx
|
|
40
|
-
var
|
|
41
|
+
var D = g.createContext({
|
|
41
42
|
variant: "flat",
|
|
42
43
|
placement: "start",
|
|
43
44
|
grouped: !1
|
|
44
45
|
});
|
|
45
|
-
function
|
|
46
|
-
return
|
|
46
|
+
function O() {
|
|
47
|
+
return g.useContext(D);
|
|
47
48
|
}
|
|
48
|
-
var
|
|
49
|
-
let m =
|
|
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__ */
|
|
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__ */
|
|
74
|
-
icon:
|
|
74
|
+
children: [/* @__PURE__ */ _(o, {
|
|
75
|
+
icon: S,
|
|
75
76
|
size: "xs"
|
|
76
77
|
}), u]
|
|
77
|
-
}) : r === "bubble" ? /* @__PURE__ */
|
|
78
|
+
}) : r === "bubble" ? /* @__PURE__ */ _(D.Provider, {
|
|
78
79
|
value: m,
|
|
79
|
-
children: /* @__PURE__ */
|
|
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" && "
|
|
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__ */
|
|
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__ */
|
|
98
|
+
}) : /* @__PURE__ */ _(D.Provider, {
|
|
98
99
|
value: m,
|
|
99
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
117
|
-
function
|
|
118
|
-
let { grouped: d } =
|
|
119
|
-
return d ? /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
125
|
+
children: /* @__PURE__ */ _(e, {
|
|
125
126
|
size: a === "sm" ? "xs" : "sm",
|
|
126
127
|
children: u(r)
|
|
127
128
|
})
|
|
128
|
-
}) : /* @__PURE__ */
|
|
129
|
+
}) : /* @__PURE__ */ _("div", {
|
|
129
130
|
className: i(f, "shrink-0"),
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ v(s, {
|
|
131
132
|
size: a === "sm" ? "xs" : "sm",
|
|
132
|
-
children: [t && /* @__PURE__ */
|
|
133
|
+
children: [t && /* @__PURE__ */ _(l, {
|
|
133
134
|
src: t,
|
|
134
135
|
alt: n ?? ""
|
|
135
|
-
}), /* @__PURE__ */
|
|
136
|
+
}), /* @__PURE__ */ _(c, { children: n ?? "" })]
|
|
136
137
|
})
|
|
137
138
|
});
|
|
138
139
|
}
|
|
139
|
-
|
|
140
|
-
function
|
|
141
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
148
|
-
function
|
|
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
|
|
155
|
-
let { grouped: a } =
|
|
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__ */
|
|
159
|
+
return /* @__PURE__ */ v("div", {
|
|
159
160
|
className: "flex items-baseline gap-ds-02",
|
|
160
161
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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
|
-
|
|
174
|
-
function
|
|
175
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
182
|
-
function
|
|
183
|
-
let [o, s] =
|
|
184
|
-
|
|
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 =
|
|
188
|
+
let d = g.useCallback(() => {
|
|
188
189
|
r && (l(e), s(!0));
|
|
189
|
-
}, [r, e]),
|
|
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
|
-
]),
|
|
197
|
+
]), m = g.useCallback(() => {
|
|
197
198
|
s(!1), l(e), n?.();
|
|
198
|
-
}, [e, n]),
|
|
199
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(),
|
|
200
|
-
}, [
|
|
201
|
-
return o ? /* @__PURE__ */
|
|
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__ */
|
|
204
|
+
children: [/* @__PURE__ */ _(f, {
|
|
204
205
|
ref: u,
|
|
205
206
|
value: c,
|
|
206
207
|
onChange: (e) => l(e.target.value),
|
|
207
|
-
onKeyDown:
|
|
208
|
-
onBlur:
|
|
209
|
-
className: "
|
|
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__ */
|
|
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__ */
|
|
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
|
-
|
|
227
|
-
function
|
|
228
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
236
|
+
children: [/* @__PURE__ */ _("span", { children: e.emoji }), /* @__PURE__ */ _("span", { children: e.count })]
|
|
236
237
|
}, e.emoji))
|
|
237
238
|
});
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
-
function
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
-
className: i("absolute -top-2 right-0 z-10", "flex items-center gap-ds-01 rounded-control
|
|
240
|
+
I.displayName = "Message.Reactions";
|
|
241
|
+
function L({ children: e, delay: t = 100 }) {
|
|
242
|
+
return /* @__PURE__ */ _("div", {
|
|
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
|
-
|
|
248
|
-
function
|
|
249
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
257
|
+
children: /* @__PURE__ */ _(e, {
|
|
257
258
|
size: "xs",
|
|
258
259
|
children: u(t)
|
|
259
260
|
})
|
|
260
261
|
})
|
|
261
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ _(m, { children: n })] });
|
|
262
263
|
}
|
|
263
|
-
|
|
264
|
-
var
|
|
265
|
-
Avatar:
|
|
266
|
-
Content:
|
|
267
|
-
Author:
|
|
268
|
-
Body:
|
|
269
|
-
EditableBody:
|
|
270
|
-
Reactions:
|
|
271
|
-
Actions:
|
|
272
|
-
Action:
|
|
273
|
-
}),
|
|
274
|
-
let [
|
|
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 =
|
|
278
|
-
|
|
279
|
-
}, [C]), T =
|
|
280
|
-
let t =
|
|
281
|
-
!t || r || (e(t),
|
|
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
|
-
|
|
284
|
+
h,
|
|
284
285
|
r,
|
|
285
286
|
e
|
|
286
|
-
]), E =
|
|
287
|
+
]), E = g.useCallback((e) => {
|
|
287
288
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), r || T());
|
|
288
|
-
}, [r, T]), D =
|
|
289
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
298
|
+
/* @__PURE__ */ _("textarea", {
|
|
298
299
|
ref: S,
|
|
299
|
-
value:
|
|
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__ */
|
|
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__ */
|
|
316
|
-
icon:
|
|
316
|
+
children: /* @__PURE__ */ _(o, {
|
|
317
|
+
icon: x,
|
|
317
318
|
size: "sm"
|
|
318
319
|
})
|
|
319
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
326
|
-
icon:
|
|
326
|
+
children: u ?? /* @__PURE__ */ _(o, {
|
|
327
|
+
icon: b,
|
|
327
328
|
size: "sm"
|
|
328
329
|
})
|
|
329
330
|
}),
|
|
330
331
|
c
|
|
331
332
|
]
|
|
332
|
-
}), l && /* @__PURE__ */
|
|
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
|
-
|
|
339
|
+
B.displayName = "MessageInput";
|
|
339
340
|
//#endregion
|
|
340
341
|
//#region src/ui/chat/message-list.tsx
|
|
341
|
-
var
|
|
342
|
-
let
|
|
343
|
-
let e =
|
|
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 && !
|
|
347
|
+
y.current = t, x(t), e.scrollTop < 100 && s && !S.current && (S.current = !0, T.current = e.scrollHeight, s());
|
|
347
348
|
}, [s]);
|
|
348
|
-
|
|
349
|
-
let e =
|
|
349
|
+
g.useLayoutEffect(() => {
|
|
350
|
+
let e = h.current;
|
|
350
351
|
if (e) {
|
|
351
|
-
if (
|
|
352
|
-
e.scrollTop = e.scrollHeight - T.current,
|
|
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]),
|
|
361
|
-
c || (
|
|
361
|
+
}, [e, t]), g.useEffect(() => {
|
|
362
|
+
c || (S.current = !1);
|
|
362
363
|
}, [c]);
|
|
363
|
-
let O = n > 0 && !b, k =
|
|
364
|
-
let e =
|
|
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__ */
|
|
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__ */
|
|
377
|
-
ref:
|
|
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__ */
|
|
388
|
+
children: [c && /* @__PURE__ */ _("div", {
|
|
388
389
|
className: "flex justify-center py-ds-03",
|
|
389
|
-
children: /* @__PURE__ */
|
|
390
|
-
}), E ? l : /* @__PURE__ */
|
|
390
|
+
children: /* @__PURE__ */ _(a, { size: "sm" })
|
|
391
|
+
}), E ? l : /* @__PURE__ */ _("div", {
|
|
391
392
|
className: "flex flex-col gap-ds-04",
|
|
392
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ _(C, {
|
|
393
394
|
initial: !1,
|
|
394
395
|
children: e
|
|
395
396
|
})
|
|
396
397
|
})]
|
|
397
398
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
420
|
+
V.displayName = "MessageList";
|
|
420
421
|
//#endregion
|
|
421
422
|
//#region src/ui/chat/system-message.tsx
|
|
422
|
-
function
|
|
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
|
|
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__ */
|
|
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__ */
|
|
437
|
+
/* @__PURE__ */ _(e, {
|
|
437
438
|
size: "sm",
|
|
438
|
-
children: u(t) ?? /* @__PURE__ */
|
|
439
|
+
children: u(t) ?? /* @__PURE__ */ _(o, { icon: y })
|
|
439
440
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ _("span", {
|
|
441
442
|
className: "text-ds-sm text-error-11",
|
|
442
443
|
children: a
|
|
443
444
|
}),
|
|
444
|
-
n && /* @__PURE__ */
|
|
445
|
+
n && /* @__PURE__ */ _("span", {
|
|
445
446
|
className: "text-ds-sm text-error-11/60",
|
|
446
|
-
children:
|
|
447
|
+
children: H(n)
|
|
447
448
|
})
|
|
448
449
|
]
|
|
449
450
|
})
|
|
450
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
456
|
+
/* @__PURE__ */ _(e, {
|
|
456
457
|
size: "xs",
|
|
457
458
|
children: u(t)
|
|
458
459
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ _("span", {
|
|
460
461
|
className: "flex-1",
|
|
461
462
|
children: a
|
|
462
463
|
}),
|
|
463
|
-
n && /* @__PURE__ */
|
|
464
|
+
n && /* @__PURE__ */ _("span", { children: H(n) })
|
|
464
465
|
]
|
|
465
466
|
}));
|
|
466
|
-
|
|
467
|
+
U.displayName = "SystemMessage";
|
|
467
468
|
//#endregion
|
|
468
469
|
//#region src/ui/chat/typing-indicator.tsx
|
|
469
|
-
function
|
|
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
|
|
473
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
502
|
+
}), /* @__PURE__ */ _("span", { children: W(e) })]
|
|
502
503
|
}) })
|
|
503
504
|
});
|
|
504
505
|
}
|
|
505
|
-
|
|
506
|
+
G.displayName = "TypingIndicator";
|
|
506
507
|
//#endregion
|
|
507
508
|
//#region src/ui/chat/unread-separator.tsx
|
|
508
|
-
function
|
|
509
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
513
|
-
/* @__PURE__ */
|
|
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__ */
|
|
518
|
+
/* @__PURE__ */ _("div", { className: "flex-1 border-t-2 border-accent-7" })
|
|
518
519
|
]
|
|
519
520
|
});
|
|
520
521
|
}
|
|
521
|
-
|
|
522
|
+
K.displayName = "UnreadSeparator";
|
|
522
523
|
//#endregion
|
|
523
|
-
export {
|
|
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 };
|