@almanaclabs/blaze-ui 0.23.0 → 0.25.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/dist/components/app-shell/app-shell.d.ts +6 -2
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +35 -17
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +17 -16
- package/dist/components/chat-bar/chat-bar.d.ts +14 -2
- package/dist/components/chat-bar/chat-bar.d.ts.map +1 -1
- package/dist/components/chat-bar/chat-bar.js +64 -37
- package/dist/components/chat-list/chat-list.d.ts +48 -0
- package/dist/components/chat-list/chat-list.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.js +95 -0
- package/dist/components/chat-list/index.d.ts +2 -0
- package/dist/components/chat-list/index.d.ts.map +1 -0
- package/dist/components/chat-panel/chat-panel.d.ts +39 -0
- package/dist/components/chat-panel/chat-panel.d.ts.map +1 -0
- package/dist/components/chat-panel/chat-panel.js +153 -0
- package/dist/components/chat-panel/index.d.ts +2 -0
- package/dist/components/chat-panel/index.d.ts.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/components/post-card/post-card.d.ts +13 -1
- package/dist/components/post-card/post-card.d.ts.map +1 -1
- package/dist/components/post-card/post-card.js +151 -142
- package/dist/components/selectable-tile/index.d.ts +2 -0
- package/dist/components/selectable-tile/index.d.ts.map +1 -0
- package/dist/components/selectable-tile/selectable-tile.d.ts +40 -0
- package/dist/components/selectable-tile/selectable-tile.d.ts.map +1 -0
- package/dist/components/selectable-tile/selectable-tile.js +54 -0
- package/dist/components/sheet/sheet.d.ts +15 -2
- package/dist/components/sheet/sheet.d.ts.map +1 -1
- package/dist/components/sheet/sheet.js +25 -12
- package/dist/components/slide-deck/index.d.ts +2 -0
- package/dist/components/slide-deck/index.d.ts.map +1 -0
- package/dist/components/slide-deck/slide-deck.d.ts +50 -0
- package/dist/components/slide-deck/slide-deck.d.ts.map +1 -0
- package/dist/components/slide-deck/slide-deck.js +201 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -77
- package/package.json +1 -1
- package/src/styles/globals.css +8 -0
|
@@ -23,7 +23,7 @@ type AppShellProps = React.ComponentProps<'div'> & {
|
|
|
23
23
|
sidebarStorageKey?: string | null;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* The application frame: a sidebar column, a
|
|
26
|
+
* The application frame: a sidebar column, a 64px top bar row, and the page in a white panel on the canvas.
|
|
27
27
|
* The panel is positioned, so a `ChatBar` or other floating element can sit inside it.
|
|
28
28
|
*
|
|
29
29
|
* From 768px up the sidebar can be dragged between 160 and 360px by its right edge (double-click goes back to the
|
|
@@ -47,6 +47,10 @@ type AppSidebarItem = {
|
|
|
47
47
|
icon?: AppSidebarIcon;
|
|
48
48
|
/** Something waiting for the owner. Shown as a count pill when above zero. */
|
|
49
49
|
count?: number;
|
|
50
|
+
/** One thing needs the owner, such as a chat with a question waiting. Shown as a small dot. */
|
|
51
|
+
needsYou?: boolean;
|
|
52
|
+
/** The dot's accessible name. Defaults to "Needs you". */
|
|
53
|
+
needsYouLabel?: string;
|
|
50
54
|
/** Render the row as a link. */
|
|
51
55
|
href?: string;
|
|
52
56
|
onSelect?: () => void;
|
|
@@ -64,7 +68,7 @@ type AppSidebarProps = Omit<React.ComponentProps<'aside'>, 'onSelect'> & {
|
|
|
64
68
|
* The plain "New" row. It leads the first section when that section has no label, and otherwise sits in its own
|
|
65
69
|
* group. Its icon defaults to a plus.
|
|
66
70
|
*/
|
|
67
|
-
newItem?: Omit<AppSidebarItem, 'icon' | 'count'> & {
|
|
71
|
+
newItem?: Omit<AppSidebarItem, 'icon' | 'count' | 'needsYou' | 'needsYouLabel'> & {
|
|
68
72
|
icon?: AppSidebarIcon;
|
|
69
73
|
};
|
|
70
74
|
sections: readonly AppSidebarSection[];
|
|
@@ -1 +1 @@
|
|
|
1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ACtC,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,yJAAyJ;AACzJ,iBAAS,mBAAmB,CAAC,EAC3B,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,EAAE,wBAAwB,qBAyD1B;AAED,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,GACpB,CAAA"}
|
|
@@ -59,7 +59,7 @@ function F({ sidebar: t, topBar: n, mainClassName: r, defaultSidebarWidth: i = 1
|
|
|
59
59
|
"--app-shell-sidebar-width": `${x}px`,
|
|
60
60
|
...c
|
|
61
61
|
},
|
|
62
|
-
className: e("relative grid min-h-screen grid-cols-[188px_minmax(0,1fr)] grid-rows-[
|
|
62
|
+
className: e("relative grid min-h-screen grid-cols-[188px_minmax(0,1fr)] grid-rows-[64px_1fr] gap-x-2.5 bg-background px-4 pb-2.5 text-foreground", "md:grid-cols-[var(--app-shell-sidebar-width)_minmax(0,1fr)] md:transition-[grid-template-columns] md:duration-200 md:ease-out motion-reduce:transition-none data-resizing:transition-none", s),
|
|
63
63
|
...u,
|
|
64
64
|
children: [
|
|
65
65
|
t,
|
|
@@ -176,7 +176,7 @@ function L({ end: t, className: n, children: r, ...i }) {
|
|
|
176
176
|
}
|
|
177
177
|
var R = (e) => /* @__PURE__ */ y("a", { href: e.href });
|
|
178
178
|
function z({ item: t, active: n, collapsed: r, onNavigate: i, renderLink: a }) {
|
|
179
|
-
let o = t.icon, s = (e) => {
|
|
179
|
+
let o = t.icon, s = t.needsYouLabel ?? "Needs you", c = !!(t.needsYou && !t.count), l = (e) => {
|
|
180
180
|
e.detail > 0 && e.currentTarget.blur(), t.onSelect?.(), i?.(t);
|
|
181
181
|
};
|
|
182
182
|
return /* @__PURE__ */ b(m, {
|
|
@@ -189,20 +189,38 @@ function z({ item: t, active: n, collapsed: r, onNavigate: i, renderLink: a }) {
|
|
|
189
189
|
...t,
|
|
190
190
|
href: t.href
|
|
191
191
|
}) : void 0,
|
|
192
|
-
tooltip: { children: /* @__PURE__ */ b(v, { children: [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
tooltip: { children: /* @__PURE__ */ b(v, { children: [
|
|
193
|
+
t.label,
|
|
194
|
+
t.count ? /* @__PURE__ */ y("span", {
|
|
195
|
+
className: "ml-1.5 tabular-nums opacity-70",
|
|
196
|
+
children: t.count
|
|
197
|
+
}) : null,
|
|
198
|
+
c ? /* @__PURE__ */ b("span", {
|
|
199
|
+
className: "ml-1.5 opacity-70",
|
|
200
|
+
children: ["· ", s]
|
|
201
|
+
}) : null
|
|
202
|
+
] }) },
|
|
196
203
|
className: e(r && "justify-center px-0"),
|
|
197
|
-
onClick:
|
|
204
|
+
onClick: l,
|
|
198
205
|
children: [o ? /* @__PURE__ */ y(o, { "aria-hidden": "true" }) : null, r ? /* @__PURE__ */ b("span", {
|
|
199
206
|
className: "sr-only",
|
|
200
|
-
children: [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
children: [
|
|
208
|
+
t.label,
|
|
209
|
+
t.count ? ` (${t.count})` : null,
|
|
210
|
+
c ? `, ${s}` : null
|
|
211
|
+
]
|
|
212
|
+
}) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("span", {
|
|
213
|
+
className: "min-w-0 truncate whitespace-nowrap",
|
|
214
|
+
children: [t.label, c ? /* @__PURE__ */ b("span", {
|
|
215
|
+
className: "sr-only",
|
|
216
|
+
children: [", ", s]
|
|
217
|
+
}) : null]
|
|
218
|
+
}), c ? /* @__PURE__ */ y("span", {
|
|
219
|
+
"aria-hidden": "true",
|
|
220
|
+
"data-slot": "app-sidebar-item-needs-you",
|
|
221
|
+
className: "ml-auto size-[7px] flex-none rounded-full bg-primary"
|
|
222
|
+
}) : null] })]
|
|
223
|
+
}), (t.count || c) && r ? /* @__PURE__ */ y("span", {
|
|
206
224
|
"aria-hidden": "true",
|
|
207
225
|
"data-slot": "app-sidebar-item-dot",
|
|
208
226
|
className: "pointer-events-none absolute top-1.5 right-2 size-1.5 rounded-full bg-primary ring-2 ring-background"
|
|
@@ -237,7 +255,7 @@ function V({ collapsed: n }) {
|
|
|
237
255
|
"data-slot": "app-sidebar-toggle",
|
|
238
256
|
"aria-label": i,
|
|
239
257
|
"aria-expanded": !n,
|
|
240
|
-
className: e("hidden flex-none opacity-0 transition-opacity duration-100 focus-visible:opacity-100 motion-reduce:transition-none md:inline-flex [@media(hover:none)]:opacity-100", n ? "absolute inset-0 m-auto size-8 bg-background group-hover/app-sidebar-header:opacity-100" : "group-hover/app-sidebar:opacity-100"),
|
|
258
|
+
className: e("hidden flex-none opacity-0 transition-opacity duration-100 focus-visible:opacity-100 motion-reduce:transition-none md:inline-flex [@media(hover:none)]:opacity-100", n ? "absolute inset-0 m-auto size-8 bg-background group-hover/app-sidebar-header:opacity-100" : "absolute top-3 right-1 bg-background group-hover/app-sidebar:opacity-100"),
|
|
241
259
|
onClick: r
|
|
242
260
|
}),
|
|
243
261
|
children: /* @__PURE__ */ y(c, { "aria-hidden": "true" })
|
|
@@ -279,14 +297,14 @@ function G({ workspace: t, newItem: n, sections: r, bottomItems: i, activeId: a,
|
|
|
279
297
|
return /* @__PURE__ */ y("aside", {
|
|
280
298
|
"data-slot": "app-sidebar",
|
|
281
299
|
"data-state": m ? "collapsed" : "expanded",
|
|
282
|
-
className: e("group/app-sidebar sticky top-0 row-span-2 flex h-screen min-w-0 flex-col self-start overflow-x-hidden overflow-y-auto pb-3", u),
|
|
300
|
+
className: e("group/app-sidebar sticky top-0 row-span-2 flex h-screen min-w-0 flex-col self-start overflow-x-hidden overflow-y-auto scroll-pt-16 pb-3", u),
|
|
283
301
|
...d,
|
|
284
302
|
children: /* @__PURE__ */ b(U.Provider, {
|
|
285
303
|
value: m,
|
|
286
304
|
children: [
|
|
287
305
|
/* @__PURE__ */ b("div", {
|
|
288
306
|
"data-slot": "app-sidebar-header",
|
|
289
|
-
className: e("flex h-
|
|
307
|
+
className: e("sticky top-0 z-10 flex h-16 flex-none items-start gap-1 bg-background pt-2", !m && "md:has-data-[slot=app-sidebar-toggle]:**:data-[slot=app-sidebar-workspace]:pr-10", m && "group/app-sidebar-header"),
|
|
290
308
|
children: [/* @__PURE__ */ y("div", {
|
|
291
309
|
className: "w-full min-w-0 flex-1",
|
|
292
310
|
children: t
|
|
@@ -348,7 +366,7 @@ function K({ name: a, logo: o, children: s, triggerLabel: c, className: l }) {
|
|
|
348
366
|
})] })]
|
|
349
367
|
}), s ? /* @__PURE__ */ y(r, {
|
|
350
368
|
align: "start",
|
|
351
|
-
className: "min-w-56",
|
|
369
|
+
className: e("px-0 **:data-[slot=dropdown-menu-item]:rounded-none **:data-[slot=dropdown-menu-item]:px-3 **:data-[slot=dropdown-menu-separator]:mx-0", "w-max max-w-80", u ? "min-w-56" : "min-w-(--anchor-width)"),
|
|
352
370
|
children: s
|
|
353
371
|
}) : null] });
|
|
354
372
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CA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
@@ -52,26 +52,27 @@ function v({ className: e, ...n }) {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function y(e) {
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
55
|
+
let t = [], r = null, i = () => {
|
|
56
|
+
let e = r?.trim();
|
|
57
|
+
e && t.push(/* @__PURE__ */ a(v, { children: e }, `label-${t.length}`)), r = null;
|
|
58
|
+
};
|
|
59
|
+
for (let a of n.Children.toArray(e)) typeof a == "string" || typeof a == "number" ? r = (r ?? "") + String(a) : (i(), t.push(a));
|
|
60
|
+
return i(), t;
|
|
60
61
|
}
|
|
61
|
-
function b({ className: e, variant:
|
|
62
|
-
let
|
|
63
|
-
variant:
|
|
64
|
-
size:
|
|
65
|
-
shape:
|
|
62
|
+
function b({ className: e, variant: n = "primary", size: i = "page", shape: o = "default", children: s, ...c }) {
|
|
63
|
+
let l = _({
|
|
64
|
+
variant: n,
|
|
65
|
+
size: i,
|
|
66
|
+
shape: o
|
|
66
67
|
});
|
|
67
68
|
return /* @__PURE__ */ a(r, {
|
|
68
69
|
"data-slot": "button",
|
|
69
|
-
"data-variant":
|
|
70
|
-
"data-size":
|
|
71
|
-
"data-shape":
|
|
72
|
-
className: typeof e == "function" ? (n) => t(
|
|
73
|
-
...
|
|
74
|
-
children:
|
|
70
|
+
"data-variant": n,
|
|
71
|
+
"data-size": i,
|
|
72
|
+
"data-shape": o,
|
|
73
|
+
className: typeof e == "function" ? (n) => t(l, e(n)) : t(l, e),
|
|
74
|
+
...c,
|
|
75
|
+
children: y(s)
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
//#endregion
|
|
@@ -27,9 +27,21 @@ type ChatBarProps = Omit<React.ComponentProps<'div'>, 'onSubmit' | 'defaultValue
|
|
|
27
27
|
attachments?: React.ReactNode;
|
|
28
28
|
/** Send an empty message too, when something else goes with it (attachments). */
|
|
29
29
|
canSendEmpty?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The assistant is answering. A Stop button takes Send's place, and Enter doesn't send; the owner can keep
|
|
32
|
+
* typing the next message.
|
|
33
|
+
*/
|
|
34
|
+
working?: boolean;
|
|
35
|
+
/** Called when the owner presses Stop while `working`. */
|
|
36
|
+
onStop?: () => void;
|
|
37
|
+
/** The Stop button's accessible name. */
|
|
38
|
+
stopLabel?: string;
|
|
30
39
|
};
|
|
31
|
-
/**
|
|
32
|
-
|
|
40
|
+
/**
|
|
41
|
+
* The chat bar: a floating rounded message field with a round send button. The field grows with the message up to
|
|
42
|
+
* eight lines, then scrolls. Enter sends; Shift+Enter starts a new line.
|
|
43
|
+
*/
|
|
44
|
+
declare function ChatBar({ onSend, placeholder, inputLabel, sendLabel, defaultValue, floating, size, className, children, start, attachments, canSendEmpty, working, onStop, stopLabel, ...props }: ChatBarProps): React.JSX.Element;
|
|
33
45
|
type ChatBarAttachmentProps = Omit<React.ComponentProps<'div'>, 'children'> & {
|
|
34
46
|
/** The image to show. */
|
|
35
47
|
src: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-bar.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bar/chat-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"chat-bar.d.ts","sourceRoot":"","sources":["../../../src/components/chat-bar/chat-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI5C,QAAA,MAAM,mBAAmB;;;8EAuBxB,CAAA;AAiBD,KAAK,YAAY,GAAG,IAAI,CACtB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,cAAc,CAC5B,GACC,YAAY,CAAC,OAAO,mBAAmB,CAAC,GAA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,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wGAAwG;AACxG,iBAAS,iBAAiB,CAAC,EACzB,GAAG,EACH,GAAG,EACH,QAAQ,EACR,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,qBAwBxB;AAED,KAAK,qBAAqB,GAAG,IAAI,CAC/B,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACnC,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAC9C,GAAG;IACF,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAoB,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,qBAAqB,qBAuBvB;AAED,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,YAAY,GAClB,CAAA"}
|
|
@@ -4,13 +4,13 @@ import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../toolt
|
|
|
4
4
|
import * as a from "react";
|
|
5
5
|
import { cva as o } from "class-variance-authority";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
import { IconArrowUp as l,
|
|
7
|
+
import { IconArrowUp as l, IconPlayerStopFilled as u, IconPlus as d, IconX as f } from "@tabler/icons-react";
|
|
8
8
|
//#region src/components/chat-bar/chat-bar.tsx
|
|
9
|
-
var
|
|
9
|
+
var p = o("pointer-events-auto mx-auto flex w-full items-end border border-border bg-card", {
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
|
-
default: "min-h-[60px] max-w-[680px] gap-2.5 py-2 pr-2.5 pl-6 shadow-[0_10px_34px_-12px_rgb(0_0_0/.22),0_1px_3px_rgb(0_0_0/.06)]",
|
|
13
|
-
compact: "max-w-[560px] gap-2 py-1.5 pr-1.5 pl-5 shadow-sm"
|
|
12
|
+
default: "min-h-[60px] max-w-[680px] gap-2.5 rounded-[30px] py-2 pr-2.5 pl-6 shadow-[0_10px_34px_-12px_rgb(0_0_0/.22),0_1px_3px_rgb(0_0_0/.06)]",
|
|
13
|
+
compact: "max-w-[560px] gap-2 rounded-[22px] py-1.5 pr-1.5 pl-5 shadow-sm"
|
|
14
14
|
},
|
|
15
15
|
withStart: {
|
|
16
16
|
true: "",
|
|
@@ -30,65 +30,92 @@ var f = o("pointer-events-auto mx-auto flex w-full items-center rounded-full bor
|
|
|
30
30
|
size: "default",
|
|
31
31
|
withStart: !1
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), m = o("flex-none rounded-full", {
|
|
34
34
|
variants: { size: {
|
|
35
35
|
default: "size-10 [--icon-stroke-width:var(--icon-stroke-20)] [&_svg:not([class*=size-])]:size-5",
|
|
36
36
|
compact: "size-8 [--icon-stroke-width:var(--icon-stroke-16)] [&_svg:not([class*=size-])]:size-4"
|
|
37
37
|
} },
|
|
38
38
|
defaultVariants: { size: "default" }
|
|
39
|
-
});
|
|
40
|
-
function
|
|
41
|
-
let [
|
|
42
|
-
|
|
39
|
+
}), h = 8;
|
|
40
|
+
function g({ onSend: n, placeholder: r = "Ask me anything, or tell me what to do", inputLabel: i = "Message", sendLabel: o = "Send", defaultValue: d = "", floating: f = !0, size: g = "default", className: _, children: v, start: y, attachments: b, canSendEmpty: x = !1, working: S = !1, onStop: C, stopLabel: w = "Stop", ...T }) {
|
|
41
|
+
let [E, D] = a.useState(d), O = a.useRef(null), k = g === "compact" ? "max-w-[560px]" : "max-w-[680px]", A = g === "compact" ? "icon-md" : "icon-lg", j = a.useCallback(() => {
|
|
42
|
+
let e = O.current;
|
|
43
|
+
e && (e.style.height = "auto", e.style.height = `${e.scrollHeight}px`);
|
|
44
|
+
}, []);
|
|
45
|
+
return a.useLayoutEffect(j, [E, j]), a.useEffect(() => {
|
|
46
|
+
let e = O.current;
|
|
47
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
48
|
+
let t = e.clientWidth, n = new ResizeObserver(() => {
|
|
49
|
+
e.clientWidth !== t && (t = e.clientWidth, j());
|
|
50
|
+
});
|
|
51
|
+
return n.observe(e), document.fonts?.ready.then(j), () => n.disconnect();
|
|
52
|
+
}, [j]), /* @__PURE__ */ c("div", {
|
|
43
53
|
"data-slot": "chat-bar",
|
|
44
|
-
"data-size":
|
|
45
|
-
className: e(
|
|
46
|
-
...
|
|
54
|
+
"data-size": g,
|
|
55
|
+
className: e(f && "pointer-events-none sticky bottom-0 z-10 rounded-b-2xl bg-linear-to-t from-card from-75% to-transparent px-6 pt-6 pb-6", _),
|
|
56
|
+
...T,
|
|
47
57
|
children: [
|
|
48
|
-
|
|
58
|
+
b ? /* @__PURE__ */ s("div", {
|
|
49
59
|
"data-slot": "chat-bar-attachments",
|
|
50
|
-
className: e("pointer-events-auto mx-auto mb-2 flex flex-wrap gap-2 px-2",
|
|
51
|
-
children:
|
|
60
|
+
className: e("pointer-events-auto mx-auto mb-2 flex flex-wrap gap-2 px-2", k),
|
|
61
|
+
children: b
|
|
52
62
|
}) : null,
|
|
53
63
|
/* @__PURE__ */ c("form", {
|
|
54
64
|
"data-slot": "chat-bar-form",
|
|
55
|
-
className: e(
|
|
56
|
-
size:
|
|
57
|
-
withStart: !!
|
|
65
|
+
className: e(p({
|
|
66
|
+
size: g,
|
|
67
|
+
withStart: !!y
|
|
58
68
|
})),
|
|
59
69
|
onSubmit: (e) => {
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
let t =
|
|
62
|
-
!t && !
|
|
70
|
+
if (e.preventDefault(), S) return;
|
|
71
|
+
let t = E.trim();
|
|
72
|
+
!t && !x || (n?.(t), D(""));
|
|
63
73
|
},
|
|
64
74
|
children: [
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
y ? /* @__PURE__ */ s("div", {
|
|
76
|
+
"data-slot": "chat-bar-start",
|
|
77
|
+
className: e("flex flex-none items-center", g === "compact" ? "h-8" : "h-10"),
|
|
78
|
+
children: y
|
|
79
|
+
}) : null,
|
|
80
|
+
/* @__PURE__ */ s("textarea", {
|
|
81
|
+
ref: O,
|
|
67
82
|
"data-slot": "chat-bar-input",
|
|
68
83
|
"aria-label": i,
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
rows: 1,
|
|
85
|
+
value: E,
|
|
86
|
+
onChange: (e) => D(e.target.value),
|
|
87
|
+
onKeyDown: (e) => {
|
|
88
|
+
e.key !== "Enter" || e.shiftKey || e.nativeEvent.isComposing || (e.preventDefault(), S || e.currentTarget.form?.requestSubmit());
|
|
89
|
+
},
|
|
71
90
|
placeholder: r,
|
|
72
|
-
|
|
91
|
+
style: { maxHeight: `calc(${h}lh + 0.5rem)` },
|
|
92
|
+
className: "type-body min-w-0 flex-1 resize-none self-center overflow-y-auto bg-transparent py-1 text-foreground outline-none placeholder:text-foreground-tertiary"
|
|
73
93
|
}),
|
|
74
|
-
/* @__PURE__ */ s(t, {
|
|
94
|
+
S ? /* @__PURE__ */ s(t, {
|
|
95
|
+
type: "button",
|
|
96
|
+
"aria-label": w,
|
|
97
|
+
size: A,
|
|
98
|
+
onClick: C,
|
|
99
|
+
className: m({ size: g }),
|
|
100
|
+
children: /* @__PURE__ */ s(u, { "aria-hidden": "true" })
|
|
101
|
+
}) : /* @__PURE__ */ s(t, {
|
|
75
102
|
type: "submit",
|
|
76
103
|
"aria-label": o,
|
|
77
|
-
size:
|
|
78
|
-
className:
|
|
104
|
+
size: A,
|
|
105
|
+
className: m({ size: g }),
|
|
79
106
|
children: /* @__PURE__ */ s(l, { "aria-hidden": "true" })
|
|
80
107
|
})
|
|
81
108
|
]
|
|
82
109
|
}),
|
|
83
|
-
|
|
110
|
+
v ? /* @__PURE__ */ s("div", {
|
|
84
111
|
"data-slot": "chat-bar-footer",
|
|
85
|
-
className: e("pointer-events-auto mx-auto mt-3",
|
|
86
|
-
children:
|
|
112
|
+
className: e("pointer-events-auto mx-auto mt-3", k),
|
|
113
|
+
children: v
|
|
87
114
|
}) : null
|
|
88
115
|
]
|
|
89
116
|
});
|
|
90
117
|
}
|
|
91
|
-
function
|
|
118
|
+
function _({ src: t, alt: n, onRemove: r, removeLabel: i, className: a, ...o }) {
|
|
92
119
|
return /* @__PURE__ */ c("div", {
|
|
93
120
|
"data-slot": "chat-bar-attachment",
|
|
94
121
|
className: e("relative size-16 flex-none", a),
|
|
@@ -102,14 +129,14 @@ function h({ src: t, alt: n, onRemove: r, removeLabel: i, className: a, ...o })
|
|
|
102
129
|
"aria-label": i ?? `Remove ${n}`,
|
|
103
130
|
onClick: r,
|
|
104
131
|
className: "absolute -top-1.5 -right-1.5 flex size-5 items-center justify-center rounded-full bg-foreground text-background shadow-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
105
|
-
children: /* @__PURE__ */ s(
|
|
132
|
+
children: /* @__PURE__ */ s(f, {
|
|
106
133
|
"aria-hidden": "true",
|
|
107
134
|
className: "size-3"
|
|
108
135
|
})
|
|
109
136
|
}) : null]
|
|
110
137
|
});
|
|
111
138
|
}
|
|
112
|
-
function
|
|
139
|
+
function v({ label: a = "Add images", className: o, ...l }) {
|
|
113
140
|
return /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
|
|
114
141
|
render: /* @__PURE__ */ s(t, {
|
|
115
142
|
type: "button",
|
|
@@ -119,8 +146,8 @@ function g({ label: a = "Add images", className: o, ...l }) {
|
|
|
119
146
|
className: e("flex-none rounded-full text-muted-foreground hover:text-foreground", o),
|
|
120
147
|
...l
|
|
121
148
|
}),
|
|
122
|
-
children: /* @__PURE__ */ s(
|
|
149
|
+
children: /* @__PURE__ */ s(d, { "aria-hidden": "true" })
|
|
123
150
|
}), /* @__PURE__ */ s(r, { children: a })] });
|
|
124
151
|
}
|
|
125
152
|
//#endregion
|
|
126
|
-
export {
|
|
153
|
+
export { g as ChatBar, v as ChatBarAddButton, _ as ChatBarAttachment, p as chatBarFormVariants };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type ChatListGroupProps = React.ComponentProps<'section'> & {
|
|
4
|
+
/** The group's heading: "Today", "Yesterday", "Earlier this week", "Older". */
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
/** One date group of chats, under a quiet heading. Holds `ChatListItem`s. */
|
|
8
|
+
declare function ChatListGroup({ label, className, children, ...props }: ChatListGroupProps): React.JSX.Element;
|
|
9
|
+
type ChatListProps = React.ComponentProps<'ul'>;
|
|
10
|
+
/**
|
|
11
|
+
* A full page of chats, Claude's Chats page style: taller rows with a straight divider between them. Holds
|
|
12
|
+
* `ChatListItem`s.
|
|
13
|
+
*/
|
|
14
|
+
declare function ChatList({ className, ...props }: ChatListProps): React.JSX.Element;
|
|
15
|
+
type ChatListItemProps = Omit<React.ComponentProps<'li'>, 'children' | 'title'> & {
|
|
16
|
+
/** The chat's name. */
|
|
17
|
+
title: string;
|
|
18
|
+
/** Where the row goes. Pass `render` instead for a router link. */
|
|
19
|
+
href?: string;
|
|
20
|
+
/** The row's link element, such as a router's `<Link href="…" />`; defaults to an `<a>`. */
|
|
21
|
+
render?: useRender.RenderProp;
|
|
22
|
+
/** The chat needs the owner: a question waiting, a draft to review, a failed step. Shows a small dot. */
|
|
23
|
+
needsYou?: boolean;
|
|
24
|
+
/** The dot's accessible name. */
|
|
25
|
+
needsYouLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* When it was last active, muted at the right: "5:41 PM", "Fri", "Last message 2 hours ago". With `actions`, "…"
|
|
28
|
+
* takes its place on hover or focus.
|
|
29
|
+
*/
|
|
30
|
+
time?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* A muted second line under the name. It makes the row a two-line row.
|
|
33
|
+
*/
|
|
34
|
+
description?: React.ReactNode;
|
|
35
|
+
/** The open chat. */
|
|
36
|
+
active?: boolean;
|
|
37
|
+
/** The "…" menu's items (`DropdownMenuItem`s), such as Rename, Archive and Delete. It shows on hover or focus. */
|
|
38
|
+
actions?: React.ReactNode;
|
|
39
|
+
/** The "…" button's accessible name; defaults to "More for <title>". */
|
|
40
|
+
actionsLabel?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* One chat in a list, Claude-style: its name, a dot when it needs the owner, and when it was last updated. The "…" menu
|
|
44
|
+
* appears only on hover or focus. With a `description` it's a two-line row: the name, then a muted line under it.
|
|
45
|
+
*/
|
|
46
|
+
declare function ChatListItem({ title, href, render, needsYou, needsYouLabel, time, description, active, actions, actionsLabel, className, ...props }: ChatListItemProps): React.JSX.Element;
|
|
47
|
+
export { ChatList, ChatListGroup, ChatListItem, type ChatListGroupProps, type ChatListProps, type ChatListItemProps, };
|
|
48
|
+
//# sourceMappingURL=chat-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-list.d.ts","sourceRoot":"","sources":["../../../src/components/chat-list/chat-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAWrD,KAAK,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG;IAC1D,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,6EAA6E;AAC7E,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,qBAkBpB;AAED,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;AAK/C;;;GAGG;AACH,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,qBAUvD;AAED,KAAK,iBAAiB,GAAG,IAAI,CAC3B,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAC1B,UAAU,GAAG,OAAO,CACrB,GAAG;IACF,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4FAA4F;IAC5F,MAAM,CAAC,EAAE,SAAS,CAAC,UAAU,CAAA;IAC7B,yGAAyG;IACzG,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,qBAAqB;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,kHAAkH;IAClH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAgB,EAChB,aAA2B,EAC3B,IAAI,EACJ,WAAW,EACX,MAAc,EACd,OAAO,EACP,YAAY,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAmGnB;AAED,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "../button/button.js";
|
|
3
|
+
import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuTrigger as i } from "../dropdown-menu/dropdown-menu.js";
|
|
4
|
+
import * as a from "react";
|
|
5
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { IconDots as l } from "@tabler/icons-react";
|
|
7
|
+
import { mergeProps as u } from "@base-ui/react/merge-props";
|
|
8
|
+
import { useRender as d } from "@base-ui/react/use-render";
|
|
9
|
+
//#region src/components/chat-list/chat-list.tsx
|
|
10
|
+
function f({ label: t, className: n, children: r, ...i }) {
|
|
11
|
+
let o = a.useId();
|
|
12
|
+
return /* @__PURE__ */ c("section", {
|
|
13
|
+
"data-slot": "chat-list-group",
|
|
14
|
+
"aria-labelledby": o,
|
|
15
|
+
className: e("flex flex-col", n),
|
|
16
|
+
...i,
|
|
17
|
+
children: [/* @__PURE__ */ s("h2", {
|
|
18
|
+
id: o,
|
|
19
|
+
className: "type-meta m-0 mb-1 px-2.5 font-medium text-muted-foreground",
|
|
20
|
+
children: t
|
|
21
|
+
}), /* @__PURE__ */ s("ul", {
|
|
22
|
+
className: "m-0 flex list-none flex-col p-0",
|
|
23
|
+
children: r
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var p = a.createContext(!1);
|
|
28
|
+
function m({ className: t, ...n }) {
|
|
29
|
+
return /* @__PURE__ */ s(p.Provider, {
|
|
30
|
+
value: !0,
|
|
31
|
+
children: /* @__PURE__ */ s("ul", {
|
|
32
|
+
"data-slot": "chat-list",
|
|
33
|
+
className: e("m-0 flex list-none flex-col p-0", t),
|
|
34
|
+
...n
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function h({ title: f, href: m, render: h, needsYou: g = !1, needsYouLabel: _ = "Needs you", time: v, description: y, active: b = !1, actions: x, actionsLabel: S, className: C, ...w }) {
|
|
39
|
+
let T = a.useContext(p), E = /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("span", {
|
|
40
|
+
className: "min-w-0 truncate",
|
|
41
|
+
children: f
|
|
42
|
+
}), g ? /* @__PURE__ */ s("span", {
|
|
43
|
+
role: "img",
|
|
44
|
+
"aria-label": _,
|
|
45
|
+
className: "size-[7px] flex-none rounded-full bg-primary"
|
|
46
|
+
}) : null] }), D = d({
|
|
47
|
+
defaultTagName: "a",
|
|
48
|
+
render: h,
|
|
49
|
+
props: u({
|
|
50
|
+
href: m,
|
|
51
|
+
"aria-current": b ? "page" : void 0,
|
|
52
|
+
className: e("flex min-w-0 flex-1 items-center gap-2.5 self-stretch rounded-lg text-foreground no-underline outline-none focus-visible:ring-3 focus-visible:ring-ring/50", y ? "py-3" : T && "py-2"),
|
|
53
|
+
children: y ? /* @__PURE__ */ c("span", {
|
|
54
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
55
|
+
children: [/* @__PURE__ */ s("span", {
|
|
56
|
+
className: "flex min-w-0 items-center gap-2.5",
|
|
57
|
+
children: E
|
|
58
|
+
}), /* @__PURE__ */ s("span", {
|
|
59
|
+
"data-slot": "chat-list-item-description",
|
|
60
|
+
className: "type-detail truncate text-muted-foreground",
|
|
61
|
+
children: y
|
|
62
|
+
})]
|
|
63
|
+
}) : E
|
|
64
|
+
}, {})
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ c("li", {
|
|
67
|
+
"data-slot": "chat-list-item",
|
|
68
|
+
"data-active": b || void 0,
|
|
69
|
+
"data-lines": y ? 2 : 1,
|
|
70
|
+
className: e("group/chat type-body relative flex items-center gap-2.5 rounded-lg hover:bg-muted data-[active]:bg-muted", T ? "px-3 transition-colors duration-100 before:pointer-events-none before:absolute before:inset-x-3 before:top-0 before:h-px before:bg-border-subtle first:before:hidden hover:before:hidden [&:hover+li]:before:hidden" : "px-2.5", y ? "min-h-16" : T ? "min-h-14" : "h-11", C),
|
|
71
|
+
...w,
|
|
72
|
+
children: [D, v || x ? /* @__PURE__ */ c("span", {
|
|
73
|
+
className: "grid flex-none items-center justify-items-end *:col-start-1 *:row-start-1 [@media(hover:none)]:flex [@media(hover:none)]:gap-2.5",
|
|
74
|
+
children: [v ? /* @__PURE__ */ s("span", {
|
|
75
|
+
"data-slot": "chat-list-item-time",
|
|
76
|
+
className: e("type-detail text-foreground-tertiary", x && "group-focus-within/chat:invisible group-hover/chat:invisible group-has-data-[popup-open]/chat:invisible [@media(hover:none)]:visible"),
|
|
77
|
+
children: v
|
|
78
|
+
}) : null, x ? /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(i, {
|
|
79
|
+
render: /* @__PURE__ */ s(t, {
|
|
80
|
+
type: "button",
|
|
81
|
+
variant: "tertiary",
|
|
82
|
+
size: "icon-sm",
|
|
83
|
+
"aria-label": S ?? `More for ${f}`,
|
|
84
|
+
className: "opacity-0 group-hover/chat:opacity-100 group-focus-within/chat:opacity-100 data-[popup-open]:opacity-100 [@media(hover:none)]:opacity-100"
|
|
85
|
+
}),
|
|
86
|
+
children: /* @__PURE__ */ s(l, { "aria-hidden": "true" })
|
|
87
|
+
}), /* @__PURE__ */ s(r, {
|
|
88
|
+
align: "end",
|
|
89
|
+
children: x
|
|
90
|
+
})] }) : null]
|
|
91
|
+
}) : null]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { m as ChatList, f as ChatListGroup, h as ChatListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type ChatPanelProps = React.ComponentProps<'aside'> & {
|
|
3
|
+
/**
|
|
4
|
+
* Let the owner drag the panel's right edge to resize it, as the sidebar resizes: arrow keys step it, Home and End
|
|
5
|
+
* jump to the narrowest and widest, and a double-click puts it back. The width is remembered on this browser.
|
|
6
|
+
*/
|
|
7
|
+
resizable?: boolean;
|
|
8
|
+
/** The width a resizable panel starts at, and returns to on a double-click. */
|
|
9
|
+
defaultWidth?: number;
|
|
10
|
+
minWidth?: number;
|
|
11
|
+
maxWidth?: number;
|
|
12
|
+
/** The `localStorage` key that remembers the width. `null` remembers nothing. */
|
|
13
|
+
storageKey?: string | null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A chat docked beside the page, as builder's chat sits beside the sidebar: a card with the chat's name, a collapse
|
|
17
|
+
* button, the conversation, and its own composer at the foot. The app places it; collapsing hands control back to the
|
|
18
|
+
* page (for example, to a floating ChatBar). With `resizable`, the owner drags its edge to make it wider or narrower.
|
|
19
|
+
*/
|
|
20
|
+
declare function ChatPanel({ resizable, defaultWidth, minWidth, maxWidth, storageKey, className, style, children, ...props }: ChatPanelProps): React.JSX.Element;
|
|
21
|
+
type ChatPanelHeaderProps = Omit<React.ComponentProps<'header'>, 'children'> & {
|
|
22
|
+
/** The chat's name. */
|
|
23
|
+
title: string;
|
|
24
|
+
/** Called with the new name when the owner renames it in place. Without it the name is read-only. */
|
|
25
|
+
onRename?: (title: string) => void;
|
|
26
|
+
/** The name field's accessible name. */
|
|
27
|
+
titleLabel?: string;
|
|
28
|
+
/** Called when the owner collapses the panel. Without it there is no collapse button. */
|
|
29
|
+
onCollapse?: () => void;
|
|
30
|
+
collapseLabel?: string;
|
|
31
|
+
};
|
|
32
|
+
/** The panel's top: the chat's name in a soft filled field you can rename in place, and Collapse. */
|
|
33
|
+
declare function ChatPanelHeader({ title, onRename, titleLabel, onCollapse, collapseLabel, className, ...props }: ChatPanelHeaderProps): React.JSX.Element;
|
|
34
|
+
/** The conversation, scrolling between the header and the composer, set in the denser `type-chat`. */
|
|
35
|
+
declare function ChatPanelBody({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
36
|
+
/** The panel's composer, pinned at the foot. Holds a ChatBar with `floating={false}`. */
|
|
37
|
+
declare function ChatPanelFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
38
|
+
export { ChatPanel, ChatPanelBody, ChatPanelFooter, ChatPanelHeader, type ChatPanelHeaderProps, type ChatPanelProps, };
|
|
39
|
+
//# sourceMappingURL=chat-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-panel.d.ts","sourceRoot":"","sources":["../../../src/components/chat-panel/chat-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA2C9B,KAAK,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;IACpD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B,CAAA;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EACjB,SAAiB,EACjB,YAAuC,EACvC,QAA+B,EAC/B,QAA+B,EAC/B,UAAmC,EACnC,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,qBAsChB;AA0GD,KAAK,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,qGAAqG;IACrG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,qGAAqG;AACrG,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,UAAwB,EACxB,UAAU,EACV,aAAmC,EACnC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,qBA8DtB;AAED,sGAAsG;AACtG,iBAAS,aAAa,CAAC,EAAE,SAAS,E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