@photon-ai/pho-ui 4.26.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
- package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
- package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
- package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
- package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
- package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
- package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
- package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
- package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
- package/dist/chunks/chat-D6SGRahp.js.map +1 -0
- package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
- package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
- package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
- package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
- package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
- package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
- package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
- package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
- package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
- package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
- package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
- package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
- package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
- package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
- package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
- package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
- package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
- package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
- package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
- package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
- package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
- package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
- package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
- package/dist/chunks/input-hrrPhzXp.js.map +1 -0
- package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
- package/dist/chunks/select-DlyDd7AB.js.map +1 -0
- package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
- package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
- package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
- package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
- package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
- package/dist/chunks/trace-CKYAff2U.js.map +1 -0
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/command.js +36 -37
- package/dist/components/command.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/error.js +252 -11
- package/dist/components/error.js.map +1 -0
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/notification.js +27 -34
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +3 -4
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/scope.js +52 -53
- package/dist/components/scope.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/theme-toggle.js +69 -95
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/icons.js +235 -78
- package/dist/icons.js.map +1 -1
- package/dist/index.js +158 -158
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/avatar/avatar.d.ts +1 -1
- package/dist/src/components/notification/notification.d.ts +2 -2
- package/dist/src/components/trace/decorations.d.ts +3 -3
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/photon/icons.d.ts +315 -0
- package/dist/src/icons/photon/index.d.ts +2 -0
- package/dist/src/icons/photon/photon-icon.d.ts +51 -0
- package/package.json +5 -3
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
- package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
- package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
- package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
- package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
- package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
- package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
- package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
- package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
- package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
- package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
- package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
- package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
- package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
- package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
- package/dist/chunks/IconX-DnPlFC68.js +0 -14
- package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
- package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
- package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
- package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
- package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
- package/dist/chunks/chat-D98GCjbe.js.map +0 -1
- package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
- package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
- package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
- package/dist/chunks/copy-button-BLvirhXk.js +0 -76
- package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
- package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
- package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
- package/dist/chunks/error-BT71wcUd.js +0 -270
- package/dist/chunks/error-BT71wcUd.js.map +0 -1
- package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
- package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
- package/dist/chunks/input-DWnb33UF.js.map +0 -1
- package/dist/chunks/select-Dux2SBVc.js.map +0 -1
- package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
- package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
- package/dist/chunks/trace-ClMpG82z.js.map +0 -1
|
@@ -1,88 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { n as
|
|
4
|
-
import { FADE_SWAP as
|
|
5
|
-
import { n as
|
|
2
|
+
import { t as b } from "./cn-CPbhpG1q.js";
|
|
3
|
+
import { n as ue } from "./link-provider-DXzDQ08N.js";
|
|
4
|
+
import { FADE_SWAP as q, PRESS_SCALE_ROW as de, SPRING_PRESS as fe, TRAVEL_LINEAR as pe } from "../motion.js";
|
|
5
|
+
import { n as he } from "./spinner-BSutFL4l.js";
|
|
6
6
|
import { a as F } from "./button-KM0lAQ4x.js";
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { i as ge } from "./status-view-Buhh1UBJ.js";
|
|
7
|
+
import { Vn as me, _n as xe, d as ve, p as be, zn as we } from "./icons-eq5FZ3Yc.js";
|
|
8
|
+
import { t as ge } from "./input-hrrPhzXp.js";
|
|
9
|
+
import { t as R } from "./scroll-area-DjdSnx2p.js";
|
|
10
|
+
import { i as ye } from "./status-view-Buhh1UBJ.js";
|
|
11
|
+
import { n as Q } from "./avatar-BJvgi8ON.js";
|
|
13
12
|
import { t as A } from "./skeleton-CqZlGphn.js";
|
|
14
|
-
import { n as
|
|
15
|
-
import { createContext as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { AnimatePresence as
|
|
18
|
-
var ke = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}],
|
|
23
|
-
["path", {
|
|
24
|
-
d: "M5 12l6 6",
|
|
25
|
-
key: "svg-1"
|
|
26
|
-
}],
|
|
27
|
-
["path", {
|
|
28
|
-
d: "M5 12l6 -6",
|
|
29
|
-
key: "svg-2"
|
|
30
|
-
}]
|
|
31
|
-
], Re = D("outline", "arrow-left", "ArrowLeft", ke), _e = [
|
|
32
|
-
["path", {
|
|
33
|
-
d: "M12 5l0 14",
|
|
34
|
-
key: "svg-0"
|
|
35
|
-
}],
|
|
36
|
-
["path", {
|
|
37
|
-
d: "M18 11l-6 -6",
|
|
38
|
-
key: "svg-1"
|
|
39
|
-
}],
|
|
40
|
-
["path", {
|
|
41
|
-
d: "M6 11l6 -6",
|
|
42
|
-
key: "svg-2"
|
|
43
|
-
}]
|
|
44
|
-
], Ae = D("outline", "arrow-up", "ArrowUp", _e), Pe = [["path", {
|
|
45
|
-
d: "M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",
|
|
46
|
-
key: "svg-0"
|
|
47
|
-
}], ["path", {
|
|
48
|
-
d: "M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",
|
|
49
|
-
key: "svg-1"
|
|
50
|
-
}]], Ie = D("outline", "user", "User", Pe), Te = [
|
|
51
|
-
["path", {
|
|
52
|
-
d: "M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",
|
|
53
|
-
key: "svg-0"
|
|
54
|
-
}],
|
|
55
|
-
["path", {
|
|
56
|
-
d: "M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",
|
|
57
|
-
key: "svg-1"
|
|
58
|
-
}],
|
|
59
|
-
["path", {
|
|
60
|
-
d: "M16 3.13a4 4 0 0 1 0 7.75",
|
|
61
|
-
key: "svg-2"
|
|
62
|
-
}],
|
|
63
|
-
["path", {
|
|
64
|
-
d: "M21 21v-2a4 4 0 0 0 -3 -3.85",
|
|
65
|
-
key: "svg-3"
|
|
66
|
-
}]
|
|
67
|
-
], Me = D("outline", "users", "Users", Te), Le = "rounded-base border border-pho-secondary bg-pho-primary", Ee = 672, Oe = 24, ze = 8, oe = "min-h-[61px]", De = 273, P = 256, V = 320, He = 16;
|
|
68
|
-
function Y(t, e) {
|
|
69
|
-
const a = Math.max(P, t);
|
|
70
|
-
return e <= 0 ? Number.isFinite(a) ? a : P : Math.min(a, Math.max(P, e - V));
|
|
13
|
+
import { n as Ne } from "./box-search-DD2EPtDy.js";
|
|
14
|
+
import { createContext as Ce, useCallback as M, useContext as Se, useEffect as te, useId as Re, useLayoutEffect as Pe, useMemo as re, useRef as S, useState as T } from "react";
|
|
15
|
+
import { Fragment as ne, jsx as r, jsxs as N } from "react/jsx-runtime";
|
|
16
|
+
import { AnimatePresence as _e, motion as z, useReducedMotion as ae } from "motion/react";
|
|
17
|
+
var Ae = "rounded-base border border-pho-secondary bg-pho-primary", Ie = 672, Te = 24, ke = 8, ie = "min-h-[61px]", Ee = 273, I = 256, V = 320, Le = 16;
|
|
18
|
+
function J(t, e) {
|
|
19
|
+
const a = Math.max(I, t);
|
|
20
|
+
return e <= 0 ? Number.isFinite(a) ? a : I : Math.min(a, Math.max(I, e - V));
|
|
71
21
|
}
|
|
72
|
-
var se =
|
|
73
|
-
function
|
|
74
|
-
const e =
|
|
22
|
+
var se = Ce(null);
|
|
23
|
+
function E(t) {
|
|
24
|
+
const e = Se(se);
|
|
75
25
|
if (e == null) throw new Error(`Chat.${t} must be used inside Chat.Root`);
|
|
76
26
|
return e;
|
|
77
27
|
}
|
|
78
|
-
var
|
|
79
|
-
function
|
|
28
|
+
var k = typeof window > "u" ? te : Pe;
|
|
29
|
+
function H(t) {
|
|
80
30
|
return t === "thread" ? 1 : -1;
|
|
81
31
|
}
|
|
82
|
-
function
|
|
83
|
-
return t === "compact" || t === "auto" && e > 0 && e <
|
|
32
|
+
function Oe(t, e) {
|
|
33
|
+
return t === "compact" || t === "auto" && e > 0 && e < Ie;
|
|
84
34
|
}
|
|
85
|
-
function
|
|
35
|
+
function O(t, e) {
|
|
86
36
|
return e ? {
|
|
87
37
|
initial: { opacity: 0 },
|
|
88
38
|
animate: { opacity: 1 },
|
|
@@ -90,7 +40,7 @@ function E(t, e) {
|
|
|
90
40
|
transition: { duration: 0 }
|
|
91
41
|
} : {
|
|
92
42
|
initial: {
|
|
93
|
-
x: t *
|
|
43
|
+
x: t * Te,
|
|
94
44
|
opacity: 0,
|
|
95
45
|
filter: "blur(1px)"
|
|
96
46
|
},
|
|
@@ -100,122 +50,122 @@ function E(t, e) {
|
|
|
100
50
|
filter: "blur(0px)"
|
|
101
51
|
},
|
|
102
52
|
exit: {
|
|
103
|
-
x: -t *
|
|
53
|
+
x: -t * ke,
|
|
104
54
|
opacity: 0,
|
|
105
55
|
filter: "blur(1px)"
|
|
106
56
|
},
|
|
107
57
|
transition: {
|
|
108
|
-
x:
|
|
109
|
-
opacity:
|
|
110
|
-
filter:
|
|
58
|
+
x: pe,
|
|
59
|
+
opacity: q,
|
|
60
|
+
filter: q
|
|
111
61
|
}
|
|
112
62
|
};
|
|
113
63
|
}
|
|
114
|
-
function
|
|
64
|
+
function Me(t) {
|
|
115
65
|
return {
|
|
116
|
-
enter: (e) =>
|
|
117
|
-
rest: (e) =>
|
|
118
|
-
leave: (e) =>
|
|
66
|
+
enter: (e) => O(e, t).initial,
|
|
67
|
+
rest: (e) => O(e, t).animate,
|
|
68
|
+
leave: (e) => O(e, t).exit
|
|
119
69
|
};
|
|
120
70
|
}
|
|
121
|
-
function
|
|
122
|
-
const u =
|
|
123
|
-
custom:
|
|
124
|
-
variants:
|
|
71
|
+
function oe({ as: t, show: e, swapped: a, direction: o, reduceMotion: s, children: d, ...l }) {
|
|
72
|
+
const u = O(o, s), h = {
|
|
73
|
+
custom: o,
|
|
74
|
+
variants: Me(s),
|
|
125
75
|
initial: "enter",
|
|
126
76
|
animate: "rest",
|
|
127
77
|
exit: "leave",
|
|
128
78
|
transition: u.transition
|
|
129
79
|
};
|
|
130
|
-
return /* @__PURE__ */ r(
|
|
80
|
+
return /* @__PURE__ */ r(_e, {
|
|
131
81
|
initial: !a && e ? !1 : void 0,
|
|
132
82
|
mode: "popLayout",
|
|
133
|
-
custom:
|
|
83
|
+
custom: o,
|
|
134
84
|
children: e ? t === "aside" ? /* @__PURE__ */ r(z.aside, {
|
|
135
|
-
...
|
|
85
|
+
...l,
|
|
136
86
|
...h,
|
|
137
87
|
children: d
|
|
138
88
|
}, "list") : /* @__PURE__ */ r(z.section, {
|
|
139
|
-
...
|
|
89
|
+
...l,
|
|
140
90
|
...h,
|
|
141
91
|
children: d
|
|
142
92
|
}, "thread") : null
|
|
143
93
|
});
|
|
144
94
|
}
|
|
145
|
-
function
|
|
146
|
-
const [h, w] =
|
|
147
|
-
let _ =
|
|
148
|
-
L.current !==
|
|
149
|
-
const
|
|
150
|
-
n(
|
|
151
|
-
}, [
|
|
152
|
-
m(
|
|
153
|
-
}, []),
|
|
154
|
-
|
|
95
|
+
function ze({ layout: t = "default", pane: e, defaultPane: a = "list", onPaneChange: o, className: s, style: d, ref: l, ...u }) {
|
|
96
|
+
const [h, w] = T(a), [y, m] = T(Ee), [i, p] = T(0), f = S(null), x = e !== void 0, v = x ? e : h, [g, n] = T(() => H(v)), [c, P] = T(!1), L = S(v);
|
|
97
|
+
let _ = g, D = c;
|
|
98
|
+
L.current !== v && (_ = H(v), D = !0, L.current = v, _ !== g && n(_), c || P(!0));
|
|
99
|
+
const U = M((C) => {
|
|
100
|
+
n(H(C)), x || w(C), o?.(C);
|
|
101
|
+
}, [x, o]), $ = M((C) => {
|
|
102
|
+
m(J(C, f.current?.clientWidth ?? 0));
|
|
103
|
+
}, []), j = Oe(t, i);
|
|
104
|
+
k(() => {
|
|
155
105
|
const C = f.current;
|
|
156
106
|
if (!C || typeof ResizeObserver > "u") return;
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
p(
|
|
107
|
+
const B = () => {
|
|
108
|
+
const G = C.clientWidth;
|
|
109
|
+
p(G), m((le) => J(le, G));
|
|
160
110
|
};
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
return
|
|
111
|
+
B();
|
|
112
|
+
const K = new ResizeObserver(B);
|
|
113
|
+
return K.observe(C), () => K.disconnect();
|
|
164
114
|
}, []);
|
|
165
|
-
const ce =
|
|
115
|
+
const ce = re(() => ({
|
|
166
116
|
layout: t,
|
|
167
|
-
pane:
|
|
168
|
-
setPane:
|
|
117
|
+
pane: v,
|
|
118
|
+
setPane: U,
|
|
169
119
|
direction: _,
|
|
170
|
-
swap:
|
|
171
|
-
swapped:
|
|
120
|
+
swap: j,
|
|
121
|
+
swapped: D,
|
|
172
122
|
listWidth: y,
|
|
173
123
|
frameWidth: i,
|
|
174
|
-
resizeList:
|
|
124
|
+
resizeList: $,
|
|
175
125
|
rootRef: f
|
|
176
126
|
}), [
|
|
177
127
|
t,
|
|
178
|
-
|
|
179
|
-
|
|
128
|
+
v,
|
|
129
|
+
U,
|
|
180
130
|
_,
|
|
181
|
-
|
|
182
|
-
|
|
131
|
+
j,
|
|
132
|
+
D,
|
|
183
133
|
y,
|
|
184
134
|
i,
|
|
185
|
-
|
|
135
|
+
$
|
|
186
136
|
]);
|
|
187
137
|
return /* @__PURE__ */ r(se.Provider, {
|
|
188
138
|
value: ce,
|
|
189
139
|
children: /* @__PURE__ */ r("div", {
|
|
190
140
|
ref: (C) => {
|
|
191
|
-
f.current = C, typeof
|
|
141
|
+
f.current = C, typeof l == "function" ? l(C) : l && (l.current = C);
|
|
192
142
|
},
|
|
193
143
|
"data-chat": "",
|
|
194
144
|
"data-basic-page-card": "",
|
|
195
145
|
"data-layout": t,
|
|
196
|
-
"data-pane":
|
|
146
|
+
"data-pane": v,
|
|
197
147
|
style: {
|
|
198
148
|
...d,
|
|
199
149
|
"--chat-list-width": `${y}px`
|
|
200
150
|
},
|
|
201
|
-
className:
|
|
151
|
+
className: b(Ae, "@container relative flex min-h-0 min-w-0 overflow-hidden", s),
|
|
202
152
|
...u
|
|
203
153
|
})
|
|
204
154
|
});
|
|
205
155
|
}
|
|
206
|
-
function
|
|
207
|
-
const { layout:
|
|
156
|
+
function De({ className: t, children: e, id: a, ...o }) {
|
|
157
|
+
const { layout: s, pane: d, direction: l, swap: u, swapped: h } = E("List"), w = ae(), y = Re(), m = a ?? y, i = b("border-pho-secondary bg-pho-page relative z-10 flex min-h-0 shrink-0 flex-col", s === "default" && "min-w-64 w-[var(--chat-list-width)] border-r", s === "compact" && "w-full", s === "auto" && b("w-full @2xl:min-w-64 @2xl:w-[var(--chat-list-width)] @2xl:border-r", !u && d === "thread" && "@max-2xl:hidden"), t), p = /* @__PURE__ */ N(ne, { children: [e, s !== "compact" && /* @__PURE__ */ r(He, { controlsId: m })] }), f = {
|
|
208
158
|
id: m,
|
|
209
159
|
"aria-label": "Conversations",
|
|
210
160
|
"data-chat-list": "",
|
|
211
161
|
className: i,
|
|
212
|
-
...
|
|
162
|
+
...o
|
|
213
163
|
};
|
|
214
|
-
return u ? /* @__PURE__ */ r(
|
|
164
|
+
return u ? /* @__PURE__ */ r(oe, {
|
|
215
165
|
as: "aside",
|
|
216
166
|
show: d === "list",
|
|
217
167
|
swapped: h,
|
|
218
|
-
direction:
|
|
168
|
+
direction: l,
|
|
219
169
|
reduceMotion: w,
|
|
220
170
|
...f,
|
|
221
171
|
children: p
|
|
@@ -224,40 +174,40 @@ function Xe({ className: t, children: e, id: a, ...s }) {
|
|
|
224
174
|
children: p
|
|
225
175
|
});
|
|
226
176
|
}
|
|
227
|
-
function
|
|
228
|
-
const { layout: e, listWidth: a, frameWidth:
|
|
229
|
-
i.button === 0 && (i.currentTarget.setPointerCapture?.(i.pointerId),
|
|
177
|
+
function He({ controlsId: t }) {
|
|
178
|
+
const { layout: e, listWidth: a, frameWidth: o, resizeList: s, rootRef: d } = E("Splitter"), l = S(null), u = (i) => {
|
|
179
|
+
i.button === 0 && (i.currentTarget.setPointerCapture?.(i.pointerId), l.current = {
|
|
230
180
|
x: i.clientX,
|
|
231
181
|
width: a
|
|
232
182
|
});
|
|
233
183
|
}, h = (i) => {
|
|
234
|
-
const p =
|
|
184
|
+
const p = l.current;
|
|
235
185
|
if (p == null) return;
|
|
236
|
-
const f = d.current,
|
|
237
|
-
|
|
186
|
+
const f = d.current, x = f != null && getComputedStyle(f).direction === "rtl", v = (i.clientX - p.x) * (x ? -1 : 1);
|
|
187
|
+
s(p.width + v);
|
|
238
188
|
}, w = () => {
|
|
239
|
-
|
|
189
|
+
l.current = null;
|
|
240
190
|
}, y = (i) => {
|
|
241
|
-
const p = d.current, f = p != null && getComputedStyle(p).direction === "rtl",
|
|
242
|
-
if (i.key ===
|
|
243
|
-
i.preventDefault(),
|
|
244
|
-
else if (i.key ===
|
|
245
|
-
i.preventDefault(),
|
|
191
|
+
const p = d.current, f = p != null && getComputedStyle(p).direction === "rtl", x = f ? "ArrowRight" : "ArrowLeft", v = f ? "ArrowLeft" : "ArrowRight", g = i.shiftKey ? 32 : Le;
|
|
192
|
+
if (i.key === x)
|
|
193
|
+
i.preventDefault(), s(a - g);
|
|
194
|
+
else if (i.key === v)
|
|
195
|
+
i.preventDefault(), s(a + g);
|
|
246
196
|
else if (i.key === "Home")
|
|
247
|
-
i.preventDefault(),
|
|
197
|
+
i.preventDefault(), s(I);
|
|
248
198
|
else if (i.key === "End") {
|
|
249
199
|
i.preventDefault();
|
|
250
200
|
const n = p?.clientWidth ?? 0;
|
|
251
|
-
n > 0 &&
|
|
201
|
+
n > 0 && s(n - V);
|
|
252
202
|
}
|
|
253
|
-
}, m =
|
|
203
|
+
}, m = o > 0 ? Math.max(I, o - V) : a;
|
|
254
204
|
return /* @__PURE__ */ r("div", {
|
|
255
205
|
role: "separator",
|
|
256
206
|
"aria-orientation": "vertical",
|
|
257
207
|
"aria-label": "Resize conversation list",
|
|
258
208
|
"aria-controls": t,
|
|
259
209
|
"aria-valuenow": a,
|
|
260
|
-
"aria-valuemin":
|
|
210
|
+
"aria-valuemin": I,
|
|
261
211
|
"aria-valuemax": m,
|
|
262
212
|
"aria-valuetext": `${a} pixels`,
|
|
263
213
|
tabIndex: 0,
|
|
@@ -267,61 +217,61 @@ function Fe({ controlsId: t }) {
|
|
|
267
217
|
onPointerUp: w,
|
|
268
218
|
onPointerCancel: w,
|
|
269
219
|
onKeyDown: y,
|
|
270
|
-
className:
|
|
220
|
+
className: b("absolute inset-y-0 -right-3 z-10 w-6 cursor-col-resize touch-none select-none", "outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2", "after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-transparent", "[@media(hover:hover)]:hover:after:bg-pho-brand focus-visible:after:bg-pho-brand", e === "auto" && "@max-2xl:hidden")
|
|
271
221
|
});
|
|
272
222
|
}
|
|
273
|
-
function
|
|
223
|
+
function We({ className: t, wrapperClassName: e, placeholder: a = "Search", ...o }) {
|
|
274
224
|
return /* @__PURE__ */ r("div", {
|
|
275
225
|
"data-chat-search": "",
|
|
276
|
-
className:
|
|
277
|
-
children: /* @__PURE__ */ r(
|
|
226
|
+
className: b("p-3", ie, t),
|
|
227
|
+
children: /* @__PURE__ */ r(ge, {
|
|
278
228
|
size: "sm",
|
|
279
229
|
icon: xe,
|
|
280
230
|
placeholder: a,
|
|
281
231
|
"aria-label": "Search conversations",
|
|
282
232
|
autoComplete: "off",
|
|
283
233
|
spellCheck: !1,
|
|
284
|
-
wrapperClassName:
|
|
285
|
-
...
|
|
234
|
+
wrapperClassName: b(Ne, "[&:focus-within>svg]:text-pho-primary [&>svg]:transition-colors [&>svg]:duration-100", e),
|
|
235
|
+
...o
|
|
286
236
|
})
|
|
287
237
|
});
|
|
288
238
|
}
|
|
289
|
-
function
|
|
239
|
+
function Ve({ className: t, children: e, ...a }) {
|
|
290
240
|
return /* @__PURE__ */ r("div", {
|
|
291
241
|
"data-chat-conversations": "",
|
|
292
|
-
className:
|
|
242
|
+
className: b("flex min-h-0 flex-1 flex-col", t),
|
|
293
243
|
...a,
|
|
294
|
-
children: /* @__PURE__ */ N(
|
|
244
|
+
children: /* @__PURE__ */ N(R.Root, {
|
|
295
245
|
className: "min-h-0 flex-1",
|
|
296
|
-
children: [/* @__PURE__ */ r(
|
|
246
|
+
children: [/* @__PURE__ */ r(R.Viewport, { children: /* @__PURE__ */ r(R.Content, {
|
|
297
247
|
style: { minWidth: 0 },
|
|
298
248
|
className: "flex min-h-full flex-col px-3 py-1",
|
|
299
249
|
children: e
|
|
300
|
-
}) }), /* @__PURE__ */ r(
|
|
250
|
+
}) }), /* @__PURE__ */ r(R.Scrollbar, { children: /* @__PURE__ */ r(R.Thumb, {}) })]
|
|
301
251
|
})
|
|
302
252
|
});
|
|
303
253
|
}
|
|
304
|
-
function
|
|
254
|
+
function Xe({ className: t, ...e }) {
|
|
305
255
|
return /* @__PURE__ */ r("ul", {
|
|
306
256
|
"data-chat-conversation-list": "",
|
|
307
|
-
className:
|
|
257
|
+
className: b("m-0 flex list-none flex-col gap-0.5 *:m-0", t),
|
|
308
258
|
...e
|
|
309
259
|
});
|
|
310
260
|
}
|
|
311
|
-
var
|
|
261
|
+
var Fe = "outline-pho-brand rounded-base flex w-full cursor-pointer items-center gap-3 px-2 py-2.5 text-left transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1", Ue = "bg-pho-primary text-pho-primary ring-pho-secondary ring-1 ring-inset *:data-icon:text-pho-primary", $e = "hover:bg-pho-ghost-hover", Y = {
|
|
312
262
|
initial: !1,
|
|
313
|
-
whileTap: { scale:
|
|
314
|
-
transition:
|
|
263
|
+
whileTap: { scale: de },
|
|
264
|
+
transition: fe
|
|
315
265
|
};
|
|
316
|
-
function
|
|
317
|
-
const { layout: y, setPane: m } =
|
|
266
|
+
function je({ title: t, time: e, preview: a, avatar: o, group: s, active: d, className: l, href: u, onClick: h, ...w }) {
|
|
267
|
+
const { layout: y, setPane: m } = E("Conversation"), i = ue(), p = re(() => z.create(i), [i]), f = b(Fe, d ? Ue : $e, l), x = () => {
|
|
318
268
|
y !== "default" && m("thread");
|
|
319
|
-
},
|
|
269
|
+
}, v = /* @__PURE__ */ N(ne, { children: [o ?? /* @__PURE__ */ r(Q.Root, {
|
|
320
270
|
size: "sm",
|
|
321
|
-
children: /* @__PURE__ */ r(
|
|
271
|
+
children: /* @__PURE__ */ r(Q.Fallback, { children: s ? /* @__PURE__ */ r(me, {
|
|
322
272
|
className: "size-4",
|
|
323
273
|
"aria-hidden": !0
|
|
324
|
-
}) : /* @__PURE__ */ r(
|
|
274
|
+
}) : /* @__PURE__ */ r(we, {
|
|
325
275
|
className: "size-4",
|
|
326
276
|
"aria-hidden": !0
|
|
327
277
|
}) })
|
|
@@ -345,29 +295,29 @@ function Qe({ title: t, time: e, preview: a, avatar: s, group: o, active: d, cla
|
|
|
345
295
|
href: u,
|
|
346
296
|
"aria-current": d ? "page" : void 0,
|
|
347
297
|
...w,
|
|
348
|
-
onClick: (
|
|
349
|
-
h?.(
|
|
298
|
+
onClick: (g) => {
|
|
299
|
+
h?.(g), g.defaultPrevented || x();
|
|
350
300
|
},
|
|
351
301
|
className: f,
|
|
352
|
-
...
|
|
353
|
-
children:
|
|
302
|
+
...Y,
|
|
303
|
+
children: v
|
|
354
304
|
}) }) : /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(z.button, {
|
|
355
305
|
type: "button",
|
|
356
306
|
"aria-current": d ? "true" : void 0,
|
|
357
307
|
...w,
|
|
358
|
-
onClick: (
|
|
359
|
-
h?.(
|
|
308
|
+
onClick: (g) => {
|
|
309
|
+
h?.(g), g.defaultPrevented || x();
|
|
360
310
|
},
|
|
361
311
|
className: f,
|
|
362
|
-
...
|
|
363
|
-
children:
|
|
312
|
+
...Y,
|
|
313
|
+
children: v
|
|
364
314
|
}) });
|
|
365
315
|
}
|
|
366
|
-
function
|
|
367
|
-
const { layout:
|
|
368
|
-
return
|
|
316
|
+
function Be({ className: t, children: e, ...a }) {
|
|
317
|
+
const { layout: o, pane: s, direction: d, swap: l, swapped: u } = E("Thread"), h = ae(), w = b("bg-pho-primary flex min-h-0 flex-1 flex-col", o === "default" && "min-w-80", o === "compact" && "min-w-0", o === "auto" && "min-w-0 @2xl:min-w-80", !l && o === "auto" && s === "list" && "@max-2xl:hidden", t);
|
|
318
|
+
return l ? /* @__PURE__ */ r(oe, {
|
|
369
319
|
as: "section",
|
|
370
|
-
show:
|
|
320
|
+
show: s === "thread",
|
|
371
321
|
swapped: u,
|
|
372
322
|
direction: d,
|
|
373
323
|
reduceMotion: h,
|
|
@@ -384,28 +334,28 @@ function Je({ className: t, children: e, ...a }) {
|
|
|
384
334
|
children: e
|
|
385
335
|
});
|
|
386
336
|
}
|
|
387
|
-
function
|
|
388
|
-
const { layout:
|
|
337
|
+
function Ke({ avatar: t, actions: e, backLabel: a = "Back to conversations", className: o, children: s, ...d }) {
|
|
338
|
+
const { layout: l, setPane: u } = E("Header");
|
|
389
339
|
return /* @__PURE__ */ N("header", {
|
|
390
340
|
"data-chat-header": "",
|
|
391
|
-
className:
|
|
341
|
+
className: b("flex shrink-0 items-center gap-3 px-4 py-1.5", ie, o),
|
|
392
342
|
...d,
|
|
393
343
|
children: [
|
|
394
|
-
|
|
344
|
+
l !== "default" && /* @__PURE__ */ r(F, {
|
|
395
345
|
variant: "ghost",
|
|
396
346
|
size: "sm",
|
|
397
347
|
shape: "circle",
|
|
398
348
|
svgOnly: !0,
|
|
399
349
|
"aria-label": a,
|
|
400
350
|
"data-chat-back": "",
|
|
401
|
-
className:
|
|
351
|
+
className: b("-ml-1 shrink-0", l === "auto" && "@2xl:hidden"),
|
|
402
352
|
onClick: () => u("list"),
|
|
403
|
-
children: /* @__PURE__ */ r(
|
|
353
|
+
children: /* @__PURE__ */ r(ve, {})
|
|
404
354
|
}),
|
|
405
355
|
t,
|
|
406
356
|
/* @__PURE__ */ r("div", {
|
|
407
357
|
className: "flex min-w-0 flex-1 flex-col",
|
|
408
|
-
children:
|
|
358
|
+
children: s
|
|
409
359
|
}),
|
|
410
360
|
e != null && /* @__PURE__ */ r("div", {
|
|
411
361
|
className: "flex shrink-0 items-center gap-1",
|
|
@@ -414,104 +364,104 @@ function Ye({ avatar: t, actions: e, backLabel: a = "Back to conversations", cla
|
|
|
414
364
|
]
|
|
415
365
|
});
|
|
416
366
|
}
|
|
417
|
-
function
|
|
367
|
+
function Ge({ className: t, children: e, ...a }) {
|
|
418
368
|
return /* @__PURE__ */ r("h2", {
|
|
419
369
|
"data-chat-title": "",
|
|
420
|
-
className:
|
|
370
|
+
className: b("text-pho-primary font-heading m-0 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 overflow-visible text-base font-medium", t),
|
|
421
371
|
...a,
|
|
422
372
|
children: e
|
|
423
373
|
});
|
|
424
374
|
}
|
|
425
|
-
function
|
|
375
|
+
function qe({ className: t, ...e }) {
|
|
426
376
|
return /* @__PURE__ */ r("p", {
|
|
427
377
|
"data-chat-description": "",
|
|
428
|
-
className:
|
|
378
|
+
className: b("text-pho-description m-0 min-w-0 truncate text-xs", t),
|
|
429
379
|
...e
|
|
430
380
|
});
|
|
431
381
|
}
|
|
432
|
-
var
|
|
433
|
-
function
|
|
382
|
+
var Z = 40, Qe = "200px 0px 0px 0px";
|
|
383
|
+
function W(t, e) {
|
|
434
384
|
return e.getBoundingClientRect().top - t.getBoundingClientRect().top;
|
|
435
385
|
}
|
|
436
386
|
function X(t) {
|
|
437
387
|
return t != null && t.isConnected && t.getClientRects().length > 0;
|
|
438
388
|
}
|
|
439
|
-
function
|
|
389
|
+
function ee(t) {
|
|
440
390
|
const e = t?.querySelector("[data-message]") ?? null;
|
|
441
391
|
return X(e) ? e : null;
|
|
442
392
|
}
|
|
443
|
-
function
|
|
393
|
+
function Je({ hasEarlier: t = !1, loadingEarlier: e = !1, onLoadEarlier: a, earlierLabel: o = "Load earlier messages", className: s, children: d, ...l }) {
|
|
444
394
|
const u = S(null), h = S(null), w = S(null), y = S(!0), m = S(null), i = S(e), p = S(!1), f = S(a);
|
|
445
|
-
|
|
395
|
+
k(() => {
|
|
446
396
|
f.current = a;
|
|
447
397
|
});
|
|
448
|
-
const
|
|
398
|
+
const x = M(() => {
|
|
449
399
|
const n = u.current;
|
|
450
400
|
if (!n) return;
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
if (X(
|
|
454
|
-
m.current = null, y.current = n.scrollHeight - n.scrollTop - n.clientHeight <
|
|
401
|
+
const c = m.current;
|
|
402
|
+
if (c) {
|
|
403
|
+
if (X(c.row) ? n.scrollTop += W(n, c.row) - c.offset : n.scrollTop = n.scrollHeight - c.height + c.top, i.current) return;
|
|
404
|
+
m.current = null, y.current = n.scrollHeight - n.scrollTop - n.clientHeight < Z;
|
|
455
405
|
return;
|
|
456
406
|
}
|
|
457
407
|
y.current && (n.scrollTop = n.scrollHeight);
|
|
458
408
|
}, []);
|
|
459
|
-
|
|
460
|
-
const n = u.current,
|
|
461
|
-
if (!n || !
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
}, [
|
|
409
|
+
k(() => {
|
|
410
|
+
const n = u.current, c = h.current;
|
|
411
|
+
if (!n || !c || (x(), typeof ResizeObserver > "u")) return;
|
|
412
|
+
const P = new ResizeObserver(x);
|
|
413
|
+
return P.observe(c), P.observe(n), () => P.disconnect();
|
|
414
|
+
}, [x]), k(() => {
|
|
465
415
|
if (i.current = e, e) return;
|
|
466
416
|
const n = m.current;
|
|
467
|
-
n && (p.current =
|
|
468
|
-
}, [e,
|
|
469
|
-
const
|
|
417
|
+
n && (p.current = ee(h.current) === n.row), x();
|
|
418
|
+
}, [e, x]);
|
|
419
|
+
const v = () => {
|
|
470
420
|
const n = u.current;
|
|
471
421
|
if (!n) return;
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
},
|
|
422
|
+
const c = m.current;
|
|
423
|
+
c && (c.height = n.scrollHeight, c.top = n.scrollTop, X(c.row) && (c.offset = W(n, c.row))), y.current = n.scrollHeight - n.scrollTop - n.clientHeight < Z;
|
|
424
|
+
}, g = M(() => {
|
|
475
425
|
const n = u.current;
|
|
476
426
|
if (n) {
|
|
477
|
-
const
|
|
427
|
+
const c = ee(h.current);
|
|
478
428
|
m.current = {
|
|
479
|
-
row:
|
|
480
|
-
offset:
|
|
429
|
+
row: c,
|
|
430
|
+
offset: c ? W(n, c) : 0,
|
|
481
431
|
height: n.scrollHeight,
|
|
482
432
|
top: n.scrollTop
|
|
483
433
|
};
|
|
484
434
|
}
|
|
485
435
|
y.current = !1, f.current?.();
|
|
486
436
|
}, []);
|
|
487
|
-
return
|
|
488
|
-
const n = u.current,
|
|
437
|
+
return te(() => {
|
|
438
|
+
const n = u.current, c = w.current;
|
|
489
439
|
if (!t) {
|
|
490
440
|
p.current = !1;
|
|
491
441
|
return;
|
|
492
442
|
}
|
|
493
|
-
if (e || p.current || !n || !
|
|
494
|
-
const
|
|
495
|
-
L.some((_) => _.isIntersecting) &&
|
|
443
|
+
if (e || p.current || !n || !c || typeof IntersectionObserver > "u") return;
|
|
444
|
+
const P = new IntersectionObserver((L) => {
|
|
445
|
+
L.some((_) => _.isIntersecting) && g();
|
|
496
446
|
}, {
|
|
497
447
|
root: n,
|
|
498
|
-
rootMargin:
|
|
448
|
+
rootMargin: Qe
|
|
499
449
|
});
|
|
500
|
-
return
|
|
450
|
+
return P.observe(c), () => P.disconnect();
|
|
501
451
|
}, [
|
|
502
452
|
t,
|
|
503
453
|
e,
|
|
504
|
-
|
|
454
|
+
g
|
|
505
455
|
]), /* @__PURE__ */ r("div", {
|
|
506
456
|
"data-chat-messages": "",
|
|
507
|
-
className:
|
|
508
|
-
...
|
|
509
|
-
children: /* @__PURE__ */ N(
|
|
457
|
+
className: b("flex min-h-0 flex-1 flex-col [--pho-bubble-backdrop:var(--background-color-pho-primary)]", s),
|
|
458
|
+
...l,
|
|
459
|
+
children: /* @__PURE__ */ N(R.Root, {
|
|
510
460
|
className: "min-h-0 flex-1",
|
|
511
|
-
children: [/* @__PURE__ */ r(
|
|
461
|
+
children: [/* @__PURE__ */ r(R.Viewport, {
|
|
512
462
|
ref: u,
|
|
513
|
-
onScroll:
|
|
514
|
-
children: /* @__PURE__ */ N(
|
|
463
|
+
onScroll: v,
|
|
464
|
+
children: /* @__PURE__ */ N(R.Content, {
|
|
515
465
|
ref: h,
|
|
516
466
|
style: { minWidth: 0 },
|
|
517
467
|
className: "flex min-h-full flex-col gap-1 p-4",
|
|
@@ -520,55 +470,55 @@ function rt({ hasEarlier: t = !1, loadingEarlier: e = !1, onLoadEarlier: a, earl
|
|
|
520
470
|
"data-chat-earlier": "",
|
|
521
471
|
"aria-busy": e || void 0,
|
|
522
472
|
className: "flex min-h-8 items-center justify-center",
|
|
523
|
-
children: e ? /* @__PURE__ */ r(
|
|
473
|
+
children: e ? /* @__PURE__ */ r(he, {
|
|
524
474
|
"aria-label": "Loading earlier messages",
|
|
525
475
|
className: "text-pho-secondary"
|
|
526
476
|
}) : /* @__PURE__ */ r(F, {
|
|
527
477
|
variant: "outlined",
|
|
528
478
|
size: "sm",
|
|
529
479
|
onClick: (n) => {
|
|
530
|
-
n.currentTarget === document.activeElement && u.current?.focus({ preventScroll: !0 }), p.current = !1,
|
|
480
|
+
n.currentTarget === document.activeElement && u.current?.focus({ preventScroll: !0 }), p.current = !1, g();
|
|
531
481
|
},
|
|
532
|
-
children:
|
|
482
|
+
children: o
|
|
533
483
|
})
|
|
534
484
|
}), d]
|
|
535
485
|
})
|
|
536
|
-
}), /* @__PURE__ */ r(
|
|
486
|
+
}), /* @__PURE__ */ r(R.Scrollbar, { children: /* @__PURE__ */ r(R.Thumb, {}) })]
|
|
537
487
|
})
|
|
538
488
|
});
|
|
539
489
|
}
|
|
540
|
-
function
|
|
490
|
+
function Ye({ className: t, children: e, ...a }) {
|
|
541
491
|
return /* @__PURE__ */ r("div", {
|
|
542
492
|
"data-chat-divider": "",
|
|
543
|
-
className:
|
|
493
|
+
className: b("text-pho-description py-1 text-center text-xs", t),
|
|
544
494
|
...a,
|
|
545
495
|
children: e
|
|
546
496
|
});
|
|
547
497
|
}
|
|
548
|
-
function
|
|
498
|
+
function Ze({ className: t, ...e }) {
|
|
549
499
|
return /* @__PURE__ */ r("footer", {
|
|
550
500
|
"data-chat-footer": "",
|
|
551
|
-
className:
|
|
501
|
+
className: b("shrink-0 px-4 py-3", t),
|
|
552
502
|
...e
|
|
553
503
|
});
|
|
554
504
|
}
|
|
555
|
-
var
|
|
556
|
-
function
|
|
557
|
-
const f = S(null),
|
|
558
|
-
|
|
505
|
+
var et = 200;
|
|
506
|
+
function tt({ value: t, onValueChange: e, onSend: a, placeholder: o = "Message", sending: s = !1, disabled: d = !1, canSend: l, prefix: u, meta: h, sendLabel: w = "Send", children: y, textareaRef: m, className: i, ...p }) {
|
|
507
|
+
const f = S(null), x = !s && !d && (l ?? t.trim().length > 0);
|
|
508
|
+
k(() => {
|
|
559
509
|
const n = f.current;
|
|
560
|
-
n && (n.style.height = "0px", n.style.height = `${Math.min(n.scrollHeight,
|
|
510
|
+
n && (n.style.height = "0px", n.style.height = `${Math.min(n.scrollHeight, et)}px`);
|
|
561
511
|
}, [t]);
|
|
562
|
-
const
|
|
563
|
-
n.preventDefault(),
|
|
564
|
-
},
|
|
565
|
-
n.key === "Enter" && !n.shiftKey && !n.nativeEvent.isComposing && (n.preventDefault(),
|
|
512
|
+
const v = (n) => {
|
|
513
|
+
n.preventDefault(), x && a();
|
|
514
|
+
}, g = (n) => {
|
|
515
|
+
n.key === "Enter" && !n.shiftKey && !n.nativeEvent.isComposing && (n.preventDefault(), x && a());
|
|
566
516
|
};
|
|
567
517
|
return /* @__PURE__ */ N("form", {
|
|
568
518
|
"aria-label": "Message composer",
|
|
569
519
|
"data-chat-composer": "",
|
|
570
|
-
onSubmit:
|
|
571
|
-
className:
|
|
520
|
+
onSubmit: v,
|
|
521
|
+
className: b("rounded-base bg-pho-primary ring-pho-primary focus-within:ring-pho-brand ring-1 transition-shadow duration-100 ease-linear ring-inset focus-within:ring-2", d && "opacity-50", i),
|
|
572
522
|
...p,
|
|
573
523
|
children: [
|
|
574
524
|
y,
|
|
@@ -578,12 +528,12 @@ function ot({ value: t, onValueChange: e, onSend: a, placeholder: s = "Message",
|
|
|
578
528
|
},
|
|
579
529
|
value: t,
|
|
580
530
|
onChange: (n) => e(n.target.value),
|
|
581
|
-
onKeyDown:
|
|
531
|
+
onKeyDown: g,
|
|
582
532
|
rows: 1,
|
|
583
|
-
placeholder:
|
|
533
|
+
placeholder: o,
|
|
584
534
|
"aria-label": "Message",
|
|
585
535
|
disabled: d,
|
|
586
|
-
readOnly:
|
|
536
|
+
readOnly: s,
|
|
587
537
|
className: "text-pho-primary placeholder:text-pho-placeholder m-0 block w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none disabled:cursor-not-allowed"
|
|
588
538
|
}),
|
|
589
539
|
/* @__PURE__ */ N("div", {
|
|
@@ -600,26 +550,26 @@ function ot({ value: t, onValueChange: e, onSend: a, placeholder: s = "Message",
|
|
|
600
550
|
shape: "circle",
|
|
601
551
|
svgOnly: !0,
|
|
602
552
|
"aria-label": w,
|
|
603
|
-
disabled: !
|
|
604
|
-
loading:
|
|
605
|
-
children: /* @__PURE__ */ r(
|
|
553
|
+
disabled: !x,
|
|
554
|
+
loading: s,
|
|
555
|
+
children: /* @__PURE__ */ r(be, {})
|
|
606
556
|
})
|
|
607
557
|
]
|
|
608
558
|
})
|
|
609
559
|
]
|
|
610
560
|
});
|
|
611
561
|
}
|
|
612
|
-
function
|
|
562
|
+
function rt({ className: t, size: e = "sm", ...a }) {
|
|
613
563
|
return /* @__PURE__ */ r("div", {
|
|
614
564
|
"data-chat-empty": "",
|
|
615
|
-
className:
|
|
616
|
-
children: /* @__PURE__ */ r(
|
|
565
|
+
className: b("flex flex-1 flex-col items-center justify-center px-6 py-8", t),
|
|
566
|
+
children: /* @__PURE__ */ r(ye, {
|
|
617
567
|
size: e,
|
|
618
568
|
...a
|
|
619
569
|
})
|
|
620
570
|
});
|
|
621
571
|
}
|
|
622
|
-
function
|
|
572
|
+
function nt({ rows: t = 5 }) {
|
|
623
573
|
return /* @__PURE__ */ r("div", {
|
|
624
574
|
"aria-hidden": !0,
|
|
625
575
|
"data-chat-conversations-loading": "",
|
|
@@ -636,7 +586,7 @@ function lt({ rows: t = 5 }) {
|
|
|
636
586
|
}, a))
|
|
637
587
|
});
|
|
638
588
|
}
|
|
639
|
-
function
|
|
589
|
+
function at() {
|
|
640
590
|
return /* @__PURE__ */ N("div", {
|
|
641
591
|
"aria-hidden": !0,
|
|
642
592
|
"data-chat-messages-loading": "",
|
|
@@ -648,27 +598,27 @@ function ct() {
|
|
|
648
598
|
]
|
|
649
599
|
});
|
|
650
600
|
}
|
|
651
|
-
var
|
|
652
|
-
Root:
|
|
653
|
-
List:
|
|
654
|
-
Search:
|
|
655
|
-
Conversations:
|
|
656
|
-
ConversationList:
|
|
657
|
-
Conversation:
|
|
658
|
-
Thread:
|
|
659
|
-
Header:
|
|
660
|
-
Title:
|
|
661
|
-
Description:
|
|
662
|
-
Messages:
|
|
663
|
-
Divider:
|
|
664
|
-
Footer:
|
|
665
|
-
Composer:
|
|
666
|
-
Empty:
|
|
667
|
-
ConversationsLoading:
|
|
668
|
-
MessagesLoading:
|
|
601
|
+
var yt = {
|
|
602
|
+
Root: ze,
|
|
603
|
+
List: De,
|
|
604
|
+
Search: We,
|
|
605
|
+
Conversations: Ve,
|
|
606
|
+
ConversationList: Xe,
|
|
607
|
+
Conversation: je,
|
|
608
|
+
Thread: Be,
|
|
609
|
+
Header: Ke,
|
|
610
|
+
Title: Ge,
|
|
611
|
+
Description: qe,
|
|
612
|
+
Messages: Je,
|
|
613
|
+
Divider: Ye,
|
|
614
|
+
Footer: Ze,
|
|
615
|
+
Composer: tt,
|
|
616
|
+
Empty: rt,
|
|
617
|
+
ConversationsLoading: nt,
|
|
618
|
+
MessagesLoading: at
|
|
669
619
|
};
|
|
670
620
|
export {
|
|
671
|
-
|
|
621
|
+
yt as t
|
|
672
622
|
};
|
|
673
623
|
|
|
674
|
-
//# sourceMappingURL=chat-
|
|
624
|
+
//# sourceMappingURL=chat-D6SGRahp.js.map
|